2FAuth/tests/EndToEnd/Pages/settings_options_page.robot

109 lines
3.2 KiB
Plaintext
Raw Normal View History

2022-08-16 09:05:36 +02:00
*** Settings ***
Documentation A page object to use in User Options settings tests.
...
Library SeleniumLibrary
2023-08-30 15:48:04 +02:00
Resource settings.resource
2022-08-16 09:05:36 +02:00
Resource ../common.resource
*** Variables ***
${OPTIONS SETTINGS PAGE URL} ${ROOT URL}/settings/options
2023-08-31 19:12:55 +02:00
${ACTIVE BUTTON CLASS} is-link
2022-08-16 09:05:36 +02:00
*** Keywords ***
2023-08-31 19:12:55 +02:00
Run Set Option Keyword And Come Back
[Arguments] ${set option keyword}
${current url} = Get Location
Go To Options Settings Page
Run Keyword ${set option keyword}
Go To ${current url}
Options Tab Is Active
Run Keyword And Return Status Element Should Have Class lnkTabOptions router-link-active
2022-08-16 09:05:36 +02:00
Options Settings Page Should Be Open
Location Should Be ${OPTIONS SETTINGS PAGE URL}
Go To Options Settings Page
Go Authenticated To ${OPTIONS SETTINGS PAGE URL}
2023-08-31 19:12:55 +02:00
Set Footer As Static
Browse To Options Settings Tab
Browse To Settings Tab ${OPTIONS TAB}
# Show Password
Set Option Show Password To On Demand
Activate Option Button btnGetotponrequesttrue
Set Option Show Password To Constantly
Activate Option Button btnGetotponrequestfalse
# Show OTP as dots
Enable Option Show Otp As Dot
Set Option Checkbox As showOtpAsDot True
Disable Option Show Otp As Dot
Set Option Checkbox As showOtpAsDot False
# Password formatting
Enable Option Password Formatting
Set Option Checkbox As formatPassword True
Disable Option Password Formatting
Set Option Checkbox As formatPassword False
Set Option Password Formatting By Pair
Activate Option Button btnFormatpasswordby2
Set Option Password Formatting By Trio
Activate Option Button btnFormatpasswordby3
Set Option Password Formatting By Half
Activate Option Button btnFormatpasswordby0.5
# Close OTP after copy
Enable Option Close Otp After Copy
Set Option Checkbox As closeOtpOnCopy True
Disable Option Close Otp After Copy
Set Option Checkbox As closeOtpOnCopy False
# Copy OTP on display
Enable Option Copy Otp On Display
Set Option Checkbox As copyOtpOnDisplay True
Disable Option Copy Otp On Display
Set Option Checkbox As copyOtpOnDisplay False
# ---------------------------------------------------
Set Option Checkbox As
[Arguments] ${checkbox} ${checked}
execute javascript
... document.querySelector('#${checkbox}').classList.remove('is-checkradio');
Wait For Condition return document.querySelector('#isReady').value == 'true'
${current_state}= Run Keyword And Return Status Checkbox Should Be Selected ${checkbox}
IF ${current_state} != ${checked}
IF ${checked}
Select Checkbox ${checkbox}
ELSE
Unselect Checkbox ${checkbox}
END
A Success Notification Should Appear
END
2023-08-30 15:48:04 +02:00
2023-08-31 19:12:55 +02:00
Activate Option Button
[Arguments] ${button}
Wait For Condition return document.querySelector('#isReady').value == 'true'
Wait Until Page Contains Element ${button}
${is active} = Run Keyword And Return Status Element Should Have Class ${button} ${ACTIVE BUTTON CLASS}
IF ${is active} == False
Click Element ${button}
A Success Notification Should Appear
END