mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-25 14:32:09 +02:00
Update E2E tests
This commit is contained in:
parent
66a4ddde0a
commit
ef5d55fe39
@ -5,7 +5,7 @@ Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
${ACCOUNTS PAGE URL} http://${SERVER}/accounts
|
||||
${ACCOUNTS PAGE URL} ${ROOT URL}/accounts
|
||||
|
||||
*** Keywords ***
|
||||
Accounts Page Should Be Open
|
||||
|
15
tests/EndToEnd/Pages/create_account_page.robot
Normal file
15
tests/EndToEnd/Pages/create_account_page.robot
Normal file
@ -0,0 +1,15 @@
|
||||
*** Settings ***
|
||||
Documentation A page object to use in 2FA accounts creation tests.
|
||||
...
|
||||
Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
${CREATE ACCOUNT PAGE URL} ${ROOT URL}/account/create
|
||||
|
||||
*** Keywords ***
|
||||
Create Account Page Should Be Open
|
||||
Location Should Be ${CREATE ACCOUNT PAGE URL}
|
||||
|
||||
Go To Create Account Page
|
||||
Go Authenticated To ${CREATE ACCOUNT PAGE URL}
|
16
tests/EndToEnd/Pages/edit_account_page.robot
Normal file
16
tests/EndToEnd/Pages/edit_account_page.robot
Normal file
@ -0,0 +1,16 @@
|
||||
*** Settings ***
|
||||
Documentation A page object to use in 2FA account edition tests.
|
||||
...
|
||||
Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
|
||||
*** Keywords ***
|
||||
Edit Page Should Be Open For Account
|
||||
[Arguments] ${account id}
|
||||
Location Should Be ${ROOT URL}/account/${account id}/edit
|
||||
|
||||
Go To Edit Page For Account
|
||||
[Arguments] ${account id}
|
||||
Go Authenticated To ${ROOT URL}/account/${account id}/edit
|
@ -5,7 +5,7 @@ Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
${LOGIN PAGE URL} http://${SERVER}/login
|
||||
${LOGIN PAGE URL} ${ROOT URL}/login
|
||||
${EMAIL FIELD} emlEmail
|
||||
${EMAIL FIELD ERROR} valErrorEmail
|
||||
${PASSWORD FIELD} pwdPassword
|
||||
@ -48,11 +48,15 @@ Password Field Should Show An Error
|
||||
Show Legacy Form
|
||||
${is_not_visible}= Run Keyword And Return Status Element Should Be Visible ${SIGN IN WITH LOGIN PASSWORD LINK}
|
||||
Run Keyword If ${is_not_visible} Click Link ${SIGN IN WITH LOGIN PASSWORD LINK}
|
||||
|
||||
Legacy Form Should Be Visible
|
||||
Element Should Be Visible ${LEGACY FORM}
|
||||
|
||||
Show Webauthn Form
|
||||
${is_not_visible}= Run Keyword And Return Status Element Should Be Visible ${SIGN IN WITH WEBAUTHN LINK}
|
||||
Run Keyword If ${is_not_visible} Click Link ${SIGN IN WITH WEBAUTHN LINK}
|
||||
|
||||
Webauthn Form Should Be Visible
|
||||
Element Should Not Be Visible ${LEGACY FORM}
|
||||
|
||||
User Should Be Welcomed
|
||||
|
@ -5,7 +5,7 @@ Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
${REGISTER PAGE URL} http://${SERVER}/register
|
||||
${REGISTER PAGE URL} ${ROOT URL}/register
|
||||
${USERNAME FIELD} txtName
|
||||
${USERNAME FIELD ERROR} valErrorName
|
||||
${EMAIL FIELD} emlEmail
|
||||
@ -25,7 +25,7 @@ Go To Register Page
|
||||
Register Page Should Be Open
|
||||
Location Should Be ${REGISTER PAGE URL}
|
||||
|
||||
Submit Account Data To Registration Form
|
||||
Submit User Data To Registration Form
|
||||
[Arguments] ${username} ${email} ${password} ${password confirmation}
|
||||
Input Text ${USERNAME FIELD} ${username}
|
||||
Input Text ${EMAIL FIELD} ${email}
|
||||
|
@ -6,7 +6,7 @@ Resource ../common.resource
|
||||
Resource login_page.robot
|
||||
|
||||
*** Variables ***
|
||||
${ACCOUNT SETTINGS PAGE URL} http://${SERVER}/settings/account
|
||||
${ACCOUNT SETTINGS PAGE URL} ${ROOT URL}/settings/account
|
||||
${PASSWORD FIELD FOR DELETE} css:form#frmDeleteAccount >> css:input#pwdPassword
|
||||
${DELETE YOUR ACCOUNT BUTTON} btnDeleteAccount
|
||||
|
||||
|
15
tests/EndToEnd/Pages/settings_oauth_page.robot
Normal file
15
tests/EndToEnd/Pages/settings_oauth_page.robot
Normal file
@ -0,0 +1,15 @@
|
||||
*** Settings ***
|
||||
Documentation A page object to use in OAuth settings tests.
|
||||
...
|
||||
Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
${OAUTH SETTINGS PAGE URL} ${ROOT URL}/settings/oauth
|
||||
|
||||
*** Keywords ***
|
||||
OAuth Settings Page Should Be Open
|
||||
Location Should Be ${OAUTH SETTINGS PAGE URL}
|
||||
|
||||
Go To OAuth Settings Page
|
||||
Go Authenticated To ${OAUTH SETTINGS PAGE URL}
|
15
tests/EndToEnd/Pages/settings_options_page.robot
Normal file
15
tests/EndToEnd/Pages/settings_options_page.robot
Normal file
@ -0,0 +1,15 @@
|
||||
*** Settings ***
|
||||
Documentation A page object to use in User Options settings tests.
|
||||
...
|
||||
Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
${OPTIONS SETTINGS PAGE URL} ${ROOT URL}/settings/options
|
||||
|
||||
*** Keywords ***
|
||||
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}
|
15
tests/EndToEnd/Pages/settings_webauthn_page.robot
Normal file
15
tests/EndToEnd/Pages/settings_webauthn_page.robot
Normal file
@ -0,0 +1,15 @@
|
||||
*** Settings ***
|
||||
Documentation A page object to use in WebAuthn settings tests.
|
||||
...
|
||||
Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
${WEBAUTHN SETTINGS PAGE URL} ${ROOT URL}/settings/webauthn
|
||||
|
||||
*** Keywords ***
|
||||
Webauthn Settings Page Should Be Open
|
||||
Location Should Be ${WEBAUTHN SETTINGS PAGE URL}
|
||||
|
||||
Go To Webauthn Settings Page
|
||||
Go Authenticated To ${WEBAUTHN SETTINGS PAGE URL}
|
15
tests/EndToEnd/Pages/start_page.robot
Normal file
15
tests/EndToEnd/Pages/start_page.robot
Normal file
@ -0,0 +1,15 @@
|
||||
*** Settings ***
|
||||
Documentation A page object to use in 2FA accounts acquisition tests.
|
||||
...
|
||||
Library SeleniumLibrary
|
||||
Resource ../common.resource
|
||||
|
||||
*** Variables ***
|
||||
${START PAGE URL} ${ROOT URL}/start
|
||||
|
||||
*** Keywords ***
|
||||
Start Page Should Be Open
|
||||
Location Should Be ${START PAGE URL}
|
||||
|
||||
Go To Start Page
|
||||
Go Authenticated To ${START PAGE URL}
|
@ -1,7 +1,7 @@
|
||||
*** Settings ***
|
||||
Documentation A test suite to check available links on the login page.
|
||||
Suite Setup Suite Setup
|
||||
Suite Teardown Close Browser
|
||||
Suite Setup Available Links Suite Setup
|
||||
Suite Teardown Close All Browsers
|
||||
Resource ../../Pages/login_page.robot
|
||||
|
||||
*** Test Cases ***
|
||||
@ -13,13 +13,16 @@ Webauthn login Link Is Visible
|
||||
|
||||
Legacy login Link Is Visible
|
||||
Show Webauthn Form
|
||||
Webauthn Form Should Be Visible
|
||||
Element Should Be Visible ${SIGN IN WITH LOGIN PASSWORD LINK}
|
||||
|
||||
Recover Account Link Is Visible
|
||||
Show Webauthn Form
|
||||
Webauthn Form Should Be Visible
|
||||
Element Should Be Visible ${RECOVER YOUR ACCOUNT LINK}
|
||||
|
||||
*** Keywords ***
|
||||
Suite Setup
|
||||
Available Links Suite Setup
|
||||
Open Blank Browser
|
||||
Go To Legacy Login Page
|
||||
Go To Legacy Login Page
|
||||
Legacy Form Should Be Visible
|
@ -1,10 +1,11 @@
|
||||
*** Settings ***
|
||||
Documentation A test suite containing tests related to invalid login.
|
||||
Suite Setup Open Blank Browser
|
||||
Suite Teardown Close Browser
|
||||
Suite Teardown Close All Browsers
|
||||
Test Setup Run keywords
|
||||
... Go To Legacy Login Page
|
||||
... AND Location Should Be ${LOGIN PAGE URL}
|
||||
... AND Login Page Should Be Open
|
||||
... AND Legacy Form Should Be Visible
|
||||
Resource ../../Pages/login_page.robot
|
||||
Resource authentication.resource
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
*** Settings ***
|
||||
Documentation A test suite containing tests related to invalid registration.
|
||||
Suite Setup Suite Setup
|
||||
Suite Teardown Suite Teardown
|
||||
Suite Setup Register Suite Setup
|
||||
Suite Teardown Register Suite Teardown
|
||||
Test Setup Register Test Setup
|
||||
Resource ../../Pages/register_page.robot
|
||||
Resource ../../Pages/accounts_page.robot
|
||||
Resource authentication.resource
|
||||
@ -25,42 +26,34 @@ Invalid Password
|
||||
${PASSWORD} ${INVALID PASSWORD}
|
||||
${INVALID PASSWORD TOO SHORT} ${INVALID PASSWORD TOO SHORT}
|
||||
|
||||
A User Already Exists
|
||||
Submit Account Data To Registration Form ${USERNAME} ${EMAIL} ${PASSWORD} ${PASSWORD}
|
||||
An Error Notification Should Appear
|
||||
|
||||
*** Keywords ***
|
||||
Registering With Invalid Username Should Fail
|
||||
[Arguments] ${bad username}
|
||||
Submit Account Data To Registration Form ${bad username} ${EMAIL} ${PASSWORD} ${PASSWORD}
|
||||
Page Should Remain Register Page
|
||||
Username Field Should Show An Error
|
||||
Submit User Data To Registration Form ${bad username} ${EMAIL} ${PASSWORD} ${PASSWORD}
|
||||
register_page.Username Field Should Show An Error
|
||||
|
||||
Registering With Invalid Email Should Fail
|
||||
[Arguments] ${bad email}
|
||||
Submit Account Data To Registration Form ${USERNAME} ${bad email} ${PASSWORD} ${PASSWORD}
|
||||
Page Should Remain Register Page
|
||||
Submit User Data To Registration Form ${USERNAME} ${bad email} ${PASSWORD} ${PASSWORD}
|
||||
register_page.Email Field Should Show An Error
|
||||
|
||||
Registering With Invalid Passwords Should Fail
|
||||
[Arguments] ${bad password} ${bad password confirmation}
|
||||
Submit Account Data To Registration Form ${USERNAME} ${EMAIL} ${bad password} ${bad password confirmation}
|
||||
Page Should Remain Register Page
|
||||
Submit User Data To Registration Form ${USERNAME} ${EMAIL} ${bad password} ${bad password confirmation}
|
||||
register_page.Password Field Should Show An Error
|
||||
|
||||
User should be asked To Register A Webauthn Device
|
||||
Page Should Contain Element ${REGISTER NEW DEVICE BUTTON}
|
||||
Page Should Contain Element ${MAYBE LATER BUTTON}
|
||||
|
||||
Page Should Remain Register Page
|
||||
Location Should Be ${REGISTER PAGE URL}
|
||||
|
||||
Suite Setup
|
||||
Register Suite Setup
|
||||
Open Blank Browser
|
||||
Play Delete User Account Workflow
|
||||
Go To Register Page
|
||||
Location Should Be ${REGISTER PAGE URL}
|
||||
|
||||
Suite Teardown
|
||||
Close Browser
|
||||
Play Register New User Workflow
|
||||
Register Suite Teardown
|
||||
Close All Browsers
|
||||
Play Register New User Workflow
|
||||
|
||||
Register Test Setup
|
||||
Go To Register Page
|
||||
Location Should Be ${REGISTER PAGE URL}
|
14
tests/EndToEnd/Tests/Auth/max_registration.robot
Normal file
14
tests/EndToEnd/Tests/Auth/max_registration.robot
Normal file
@ -0,0 +1,14 @@
|
||||
*** Settings ***
|
||||
Documentation A test suite containing tests related to maximum user registration.
|
||||
Suite Setup Open Blank Browser
|
||||
Suite Teardown Close All Browsers
|
||||
Resource ../../Pages/register_page.robot
|
||||
Resource ../../Pages/accounts_page.robot
|
||||
Resource authentication.resource
|
||||
|
||||
*** Test Cases ***
|
||||
A User Already Exists
|
||||
Go To Register Page
|
||||
Location Should Be ${REGISTER PAGE URL}
|
||||
Submit User Data To Registration Form ${USERNAME} ${EMAIL} ${PASSWORD} ${PASSWORD}
|
||||
An Error Notification Should Appear
|
@ -1,11 +1,9 @@
|
||||
*** Settings ***
|
||||
Documentation A test suite containing tests related to valid login.
|
||||
Suite Setup Open Blank Browser
|
||||
Suite Teardown Close Browser
|
||||
Suite Teardown Close All Browsers
|
||||
Resource ../../Pages/login_page.robot
|
||||
Resource ../../Pages/accounts_page.robot
|
||||
Resource authentication.resource
|
||||
Resource invalid_registration.robot
|
||||
|
||||
*** Test Cases ***
|
||||
Valid Login
|
||||
|
@ -1,7 +1,7 @@
|
||||
*** Settings ***
|
||||
Documentation A test suite containing tests related to valid registration.
|
||||
Suite Setup Open Blank Browser
|
||||
Suite Teardown Close Browser
|
||||
Suite Teardown Close All Browsers
|
||||
Resource ../../Pages/register_page.robot
|
||||
Resource ../../Pages/accounts_page.robot
|
||||
Resource authentication.resource
|
||||
@ -11,7 +11,7 @@ Valid Registration Without Webauthn Device
|
||||
Play Delete User Account Workflow
|
||||
Go To Register Page
|
||||
Register Page Should Be Open
|
||||
Submit Account Data To Registration Form ${USERNAME} ${EMAIL} ${PASSWORD} ${PASSWORD}
|
||||
Submit User Data To Registration Form ${USERNAME} ${EMAIL} ${PASSWORD} ${PASSWORD}
|
||||
User Should Be Asked To Register A Webauthn Device Or Postpone
|
||||
Postpone Webauthn Registration
|
||||
|
||||
|
33
tests/EndToEnd/Tests/Redirections/protected_page.robot
Normal file
33
tests/EndToEnd/Tests/Redirections/protected_page.robot
Normal file
@ -0,0 +1,33 @@
|
||||
*** Settings ***
|
||||
Documentation A test suite containing tests related to browsing redirections.
|
||||
Suite Setup Open Blank Browser
|
||||
Suite Teardown Close All Browsers
|
||||
Resource ../../Pages/register_page.robot
|
||||
Resource ../../Pages/accounts_page.robot
|
||||
Resource ../../Pages/settings_account_page.robot
|
||||
Resource ../../Pages/settings_oauth_page.robot
|
||||
Resource ../../Pages/settings_options_page.robot
|
||||
Resource ../../Pages/settings_webauthn_page.robot
|
||||
Resource ../../Pages/start_page.robot
|
||||
Resource ../../Pages/create_account_page.robot
|
||||
Resource ../../Pages/edit_account_page.robot
|
||||
Resource ../../common.resource
|
||||
|
||||
*** Test Cases ***
|
||||
Protected Page
|
||||
[Template] Anonymous Should Be Redirected To Login Page
|
||||
${ACCOUNTS PAGE URL}
|
||||
${ACCOUNT SETTINGS PAGE URL}
|
||||
${OAUTH SETTINGS PAGE URL}
|
||||
${OPTIONS SETTINGS PAGE URL}
|
||||
${WEBAUTHN SETTINGS PAGE URL}
|
||||
${CREATE ACCOUNT PAGE URL}
|
||||
${EDIT ACCOUNT PAGE URL}
|
||||
${START PAGE URL}
|
||||
|
||||
*** Keywords ***
|
||||
Anonymous Should Be Redirected To Login Page
|
||||
[Arguments] ${url}
|
||||
Delete All Cookies
|
||||
Go To ${url}
|
||||
Location Should Be ${LOGIN PAGE URL}
|
13
tests/EndToEnd/Tests/temp.robot
Normal file
13
tests/EndToEnd/Tests/temp.robot
Normal file
@ -0,0 +1,13 @@
|
||||
# *** Settings ***
|
||||
# Documentation A test suite to check available links on the login page.
|
||||
# Suite Setup Open Blank Browser
|
||||
# Suite Teardown Close Browser
|
||||
# Resource Pages/login_page.robot
|
||||
# Resource workflows.resource
|
||||
|
||||
# *** Variables ***
|
||||
# ${ROOT URL} https://${SERVER}/
|
||||
|
||||
# *** Test Cases ***
|
||||
# My Test
|
||||
# Play Delete User Account Workflow
|
@ -1,32 +1,29 @@
|
||||
*** Settings ***
|
||||
Documentation A resource file with reusable keywords and variables.
|
||||
Library SeleniumLibrary
|
||||
# Library RequestsLibrary
|
||||
Resource workflows.resource
|
||||
|
||||
*** Variables ***
|
||||
${SERVER} localhost
|
||||
${SERVER} 2fauth
|
||||
${BROWSER} chrome
|
||||
${DELAY} 0.1
|
||||
${DELAY} 0.5
|
||||
|
||||
${USERNAME} Tester
|
||||
${EMAIL} testing@2fauth.app
|
||||
${PASSWORD} password
|
||||
|
||||
${HOME PAGE URL} http://${SERVER}/
|
||||
${ROOT URL} https://${SERVER}
|
||||
${LOGOUT LINK} lnkSignOut
|
||||
|
||||
*** Keywords ***
|
||||
Open Blank Browser
|
||||
Set Selenium Speed ${DELAY}
|
||||
# ${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
|
||||
${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}
|
||||
Open Browser url=${ROOT URL} browser=${BROWSER} options=${options}
|
||||
Maximize Browser Window
|
||||
|
||||
Go Authenticated To
|
||||
@ -39,7 +36,7 @@ Go Authenticated To
|
||||
END
|
||||
|
||||
An Error Notification Should Appear
|
||||
Element Should Be Visible css:#vueNotification >> css:.is-danger
|
||||
Wait Until Element Is Visible css:#vueNotification .is-danger
|
||||
|
||||
Field Should Show An Error
|
||||
[Arguments] ${field error}
|
||||
@ -47,4 +44,4 @@ Field Should Show An Error
|
||||
Should Not Be Empty ${field error}
|
||||
|
||||
Scroll To Bottom
|
||||
Execute Javascript window.scrollTo(0,document.body.scrollHeight)
|
||||
Execute Javascript window.scrollTo(0,document.body.scrollHeight)
|
||||
|
@ -1,13 +0,0 @@
|
||||
*** Settings ***
|
||||
Documentation A test suite to check available links on the login page.
|
||||
Suite Setup Open Blank Browser
|
||||
# Suite Teardown Close Browser
|
||||
Resource Pages/login_page.robot
|
||||
Resource workflows.resource
|
||||
|
||||
*** Variables ***
|
||||
${HOME PAGE URL} http://${SERVER}/
|
||||
|
||||
*** Test Cases ***
|
||||
My Test
|
||||
Play Delete User Account Workflow
|
@ -3,7 +3,6 @@ Documentation Workflows execute recurrent tasks.
|
||||
... They don't assert anything.
|
||||
... They must be triggered while a browser is already opened.
|
||||
... They must not close the browser
|
||||
Library SeleniumLibrary
|
||||
Resource common.resource
|
||||
Resource Pages/login_page.robot
|
||||
Resource Pages/register_page.robot
|
||||
@ -21,15 +20,14 @@ Play Delete User Account Workflow
|
||||
Play sign In Workflow
|
||||
Delete All Cookies
|
||||
Go To Legacy Login Page
|
||||
Login Page Should Be Open
|
||||
Submit Credentials To Legacy Form Login ${EMAIL} ${PASSWORD}
|
||||
|
||||
Play Register New User Workflow
|
||||
Go To Register Page
|
||||
Submit Account Data To Registration Form ${USERNAME} ${EMAIL} ${PASSWORD} ${PASSWORD}
|
||||
Submit User Data To Registration Form ${USERNAME} ${EMAIL} ${PASSWORD} ${PASSWORD}
|
||||
|
||||
Play Logout Workflow
|
||||
Go To http://${SERVER}/accounts
|
||||
Go To ${ROOT URL}/accounts
|
||||
${is_authenticated}= Run Keyword And Return Status Page Should Contain Element ${LOGOUT LINK}
|
||||
IF ${is_authenticated} == True
|
||||
Click Element ${LOGOUT LINK}
|
||||
|
Loading…
x
Reference in New Issue
Block a user