2022-08-04 21:32:24 +02:00
|
|
|
*** Settings ***
|
|
|
|
Documentation A resource file with reusable keywords and variables.
|
|
|
|
Library SeleniumLibrary
|
2022-08-07 19:36:23 +02:00
|
|
|
Resource workflows.resource
|
2022-08-04 21:32:24 +02:00
|
|
|
|
|
|
|
*** Variables ***
|
2023-08-04 14:06:23 +02:00
|
|
|
${SERVER} localhost
|
|
|
|
${BROWSER} chrome
|
|
|
|
# ${DELAY} 1
|
2022-08-04 21:32:24 +02:00
|
|
|
|
2023-08-04 14:06:23 +02:00
|
|
|
${USERNAME} Tester
|
|
|
|
${ADMIN EMAIL} testingadmin@2fauth.app
|
|
|
|
${USER EMAIL} testingadmin@2fauth.app
|
|
|
|
${PASSWORD} password
|
2022-08-07 19:36:23 +02:00
|
|
|
|
2023-08-04 14:06:23 +02:00
|
|
|
${ROOT URL} http://${SERVER}
|
2023-08-30 15:48:04 +02:00
|
|
|
|
2023-08-04 14:06:23 +02:00
|
|
|
${LOGOUT LINK} lnkSignOut
|
2023-08-30 15:48:04 +02:00
|
|
|
${ABOUT LINK} lnkAbout
|
|
|
|
${SETTINGS LINK} lnkSettings
|
|
|
|
${BACK BUTTON} lnkBack
|
|
|
|
${CANCEL BUTTON} btnCancel
|
|
|
|
${CLOSE BUTTON} btnClose
|
|
|
|
${OTP} otp
|
2022-08-04 21:32:24 +02:00
|
|
|
|
2023-08-29 09:10:10 +02:00
|
|
|
${SUCCESS NOTIFICATION} css:#vueNotification .is-success
|
|
|
|
${ALERT NOTIFICATION} css:#vueNotification .is-danger
|
|
|
|
|
2023-08-31 19:12:55 +02:00
|
|
|
${CLEARED CLIPBOARD VALUE} -clear-
|
|
|
|
|
2022-08-04 21:32:24 +02:00
|
|
|
*** Keywords ***
|
2023-08-04 14:06:23 +02:00
|
|
|
Open Custom Browser
|
|
|
|
[Arguments] ${url}=${ROOT URL}
|
|
|
|
# Set Selenium Speed ${DELAY}
|
2022-08-16 09:05:36 +02:00
|
|
|
${options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
|
|
|
|
Call Method ${options} add_argument --lang\=en,en-us
|
|
|
|
Call Method ${options} add_argument --disable-dev-shm-usage # See https://stackoverflow.com/questions/50642308/org-openqa-selenium-webdriverexception-unknown-error-devtoolsactiveport-file-d
|
|
|
|
${prefs}= Create Dictionary intl.accept_languages=en,en-us
|
|
|
|
Call Method ${options} add_experimental_option prefs ${prefs}
|
2023-08-04 14:06:23 +02:00
|
|
|
Open Browser url=${url} browser=${BROWSER} options=${options}
|
2022-08-09 09:47:29 +02:00
|
|
|
Maximize Browser Window
|
2022-08-04 21:32:24 +02:00
|
|
|
|
2022-08-07 19:36:23 +02:00
|
|
|
Go Authenticated To
|
|
|
|
[Arguments] ${url}
|
|
|
|
Go To ${url}
|
2023-09-13 15:34:28 +02:00
|
|
|
Wait Until Page Contains Element tag:footer
|
|
|
|
${is anonymous}= Run Keyword And Return Status Location Should Be ${LOGIN PAGE URL}
|
|
|
|
IF ${is anonymous} == True
|
2023-08-04 14:06:23 +02:00
|
|
|
Play Admin Sign In Workflow
|
2022-08-07 19:36:23 +02:00
|
|
|
Go To ${url}
|
2023-09-13 15:34:28 +02:00
|
|
|
Wait Until Page Contains Element tag:footer
|
2022-08-07 19:36:23 +02:00
|
|
|
END
|
2023-08-04 14:06:23 +02:00
|
|
|
|
|
|
|
A Success Notification Should Appear
|
2023-08-29 09:10:10 +02:00
|
|
|
Wait Until Element Is Visible ${SUCCESS NOTIFICATION}
|
2022-08-04 21:32:24 +02:00
|
|
|
|
2023-09-01 15:22:18 +02:00
|
|
|
Close Notification
|
|
|
|
Run Keyword And Ignore Error Click Element ${SUCCESS NOTIFICATION}
|
|
|
|
|
2022-08-07 19:36:23 +02:00
|
|
|
An Error Notification Should Appear
|
2023-08-29 09:10:10 +02:00
|
|
|
Wait Until Element Is Visible ${ALERT NOTIFICATION}
|
2022-08-04 21:32:24 +02:00
|
|
|
|
|
|
|
Field Should Show An Error
|
|
|
|
[Arguments] ${field error}
|
2023-08-04 14:06:23 +02:00
|
|
|
Wait Until Element Is Visible ${field error}
|
2022-08-09 09:47:29 +02:00
|
|
|
Should Not Be Empty ${field error}
|
|
|
|
|
|
|
|
Scroll To Bottom
|
2023-08-29 09:10:10 +02:00
|
|
|
Execute Javascript window.scrollTo(0,document.body.scrollHeight)
|
2023-08-04 14:06:23 +02:00
|
|
|
|
|
|
|
Element Should Have Class
|
|
|
|
[Arguments] ${element} ${className}
|
|
|
|
${class}= Get Element Attribute ${element} class
|
|
|
|
Should Contain ${class} ${className}
|
|
|
|
|
|
|
|
Element Should Not Have Class
|
|
|
|
[Arguments] ${element} ${className}
|
|
|
|
${class}= Get Element Attribute ${element} class
|
2023-08-29 09:10:10 +02:00
|
|
|
Should Not Contain ${class} ${className}
|
|
|
|
|
|
|
|
Set Footer As Static
|
2023-08-31 19:12:55 +02:00
|
|
|
Wait Until Page Contains Element tag:footer
|
2023-08-29 09:10:10 +02:00
|
|
|
execute javascript
|
2023-08-30 15:48:04 +02:00
|
|
|
... document.querySelector('footer').style = 'position: static';
|
|
|
|
|
|
|
|
Browse To Settings
|
|
|
|
Click Element ${SETTINGS LINK}
|