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

75 lines
2.3 KiB
Plaintext
Raw Normal View History

2022-08-04 21:32:24 +02:00
*** Settings ***
Documentation A page object to use in Accounts tests.
...
Library SeleniumLibrary
Resource ../common.resource
*** Variables ***
2022-08-16 09:05:36 +02:00
${ACCOUNTS PAGE URL} ${ROOT URL}/accounts
2022-08-04 21:32:24 +02:00
2023-08-30 15:48:04 +02:00
${GROUP SWITCH} groupSwitch
2023-08-31 19:12:55 +02:00
${SEARCH FIELD} txtSearch
${MODAL OTP} class:modal-otp
2023-08-30 15:48:04 +02:00
${SHOW GROUP SWITCH BUTTON} btnShowGroupSwitch
${HIDE GROUP SWITCH BUTTON} btnHideGroupSwitch
2022-08-04 21:32:24 +02:00
*** Keywords ***
Accounts Page Should Be Open
2023-08-30 15:48:04 +02:00
Wait Until Location Is ${ACCOUNTS PAGE URL}
Go To Accounts Page
2023-08-30 15:48:04 +02:00
Go Authenticated To ${ACCOUNTS PAGE URL}
2023-08-31 19:12:55 +02:00
Show An Otp In Modal
2023-08-30 15:48:04 +02:00
Wait Until Page Contains Element class:tfa-cell
${account} = Get WebElement class:tfa-cell:first-child
Click Element ${account}
Wait Until Element Is Visible ${OTP}
2023-08-31 19:12:55 +02:00
Get OTP Value Shown In Modal
${string}= Get Text ${OTP}
[return] ${string}
2023-08-30 15:48:04 +02:00
Show Group Switch
Wait Until Page Contains Element ${SHOW GROUP SWITCH BUTTON}
Click Element ${SHOW GROUP SWITCH BUTTON}
Wait Until Page Contains Element ${GROUP SWITCH}
Hide Group Switch
Click Element ${HIDE GROUP SWITCH BUTTON}
2023-08-31 19:12:55 +02:00
Wait Until Page Does Not Contain Element ${GROUP SWITCH}
Click Otp To Copy It
Click Element ${OTP}
A Success Notification Should Appear
Clipboard Should Contain
[Arguments] ${expected}
Close Modal Otp
Wait Until Element Is Visible ${SEARCH FIELD}
Press Keys ${SEARCH FIELD} CTRL+v
${clipboard} = Get Value ${SEARCH FIELD}
Should Be Equal ${expected} ${clipboard}
Input Text ${SEARCH FIELD} ${CLEARED CLIPBOARD VALUE}
Press Keys ${SEARCH FIELD} CTRL+c
Clear Search
Clear Search
Run Keyword And Ignore Error Click Element btnClearSearch
Copy To Clipboard
[Arguments] ${string}
Close Modal Otp
Wait Until Element Is Visible ${SEARCH FIELD}
Input Text ${SEARCH FIELD} ${string}
Set Focus To Element ${SEARCH FIELD}
Press Keys None CTRL+a
Press Keys None CTRL+c
Clear Search
Close Modal Otp
${modal is open} = Run Keyword And Return Status Element Should Be Visible ${MODAL OTP}
Run Keyword If ${modal is open} Click Element ${CLOSE BUTTON}
Wait Until Element Is Not Visible ${MODAL OTP}