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
|
|
|
# Library RequestsLibrary
|
|
|
|
Resource workflows.resource
|
2022-08-04 21:32:24 +02:00
|
|
|
|
|
|
|
*** Variables ***
|
|
|
|
${SERVER} localhost
|
|
|
|
${BROWSER} chrome
|
|
|
|
${DELAY} 0.1
|
|
|
|
|
2022-08-07 19:36:23 +02:00
|
|
|
${USERNAME} Tester
|
|
|
|
${EMAIL} testing@2fauth.app
|
|
|
|
${PASSWORD} password
|
|
|
|
|
|
|
|
${HOME PAGE URL} http://${SERVER}/
|
|
|
|
${LOGOUT LINK} lnkSignOut
|
2022-08-04 21:32:24 +02:00
|
|
|
|
|
|
|
*** Keywords ***
|
2022-08-07 19:36:23 +02:00
|
|
|
Open Blank Browser
|
2022-08-04 21:32:24 +02:00
|
|
|
Set Selenium Speed ${DELAY}
|
2022-08-07 19:36:23 +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}
|
|
|
|
# Create Webdriver Chrome chrome_options=${options}
|
|
|
|
# Go To ${HOME PAGE URL}
|
|
|
|
Open Browser ${HOME PAGE URL} Chrome
|
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}
|
|
|
|
${is_authenticated}= Run Keyword And Return Status Location Should Be ${url}
|
|
|
|
IF ${is_authenticated} == False
|
|
|
|
Play sign In Workflow
|
|
|
|
Go To ${url}
|
|
|
|
END
|
2022-08-04 21:32:24 +02:00
|
|
|
|
2022-08-07 19:36:23 +02:00
|
|
|
An Error Notification Should Appear
|
|
|
|
Element Should Be Visible css:#vueNotification >> css:.is-danger
|
2022-08-04 21:32:24 +02:00
|
|
|
|
|
|
|
Field Should Show An Error
|
|
|
|
[Arguments] ${field error}
|
|
|
|
Element Should Be Visible ${field error}
|
2022-08-09 09:47:29 +02:00
|
|
|
Should Not Be Empty ${field error}
|
|
|
|
|
|
|
|
Scroll To Bottom
|
|
|
|
Execute Javascript window.scrollTo(0,document.body.scrollHeight)
|