diff --git a/tests/EndToEnd/Pages/about_page.robot b/tests/EndToEnd/Pages/about_page.robot index 189c96e1..31a4f27b 100644 --- a/tests/EndToEnd/Pages/about_page.robot +++ b/tests/EndToEnd/Pages/about_page.robot @@ -7,7 +7,6 @@ Library String *** Variables *** ${ABOUT PAGE URL} ${ROOT URL}/about -${BACK BUTTON} lnkBack *** Keywords *** About Page Should Be Open @@ -16,6 +15,13 @@ About Page Should Be Open Go To About Page Go To ${ABOUT PAGE URL} +Browse To About Page + Click Link ${ABOUT LINK} + +Exit About Page + Wait Until Page Contains Element ${BACK BUTTON} + Click Link ${BACK BUTTON} + Block Vars Should Be Visible [Arguments] ${elementId} Wait Until Page Contains Element id:${elementId} diff --git a/tests/EndToEnd/Pages/account_import_page.robot b/tests/EndToEnd/Pages/account_import_page.robot index 19d602e2..5b055f96 100644 --- a/tests/EndToEnd/Pages/account_import_page.robot +++ b/tests/EndToEnd/Pages/account_import_page.robot @@ -7,9 +7,18 @@ Resource ../common.resource *** Variables *** ${IMPORT ACCOUNTS PAGE URL} ${ROOT URL}/account/import +${CANCEL BUTTON} btnCancel +${CLOSE BUTTON} btnClose + *** Keywords *** Import Accounts Page Should Be Open Location Should Be ${IMPORT ACCOUNTS PAGE URL} Go To Import Accounts Page - Go Authenticated To ${IMPORT ACCOUNTS PAGE URL} \ No newline at end of file + Go Authenticated To ${IMPORT ACCOUNTS PAGE URL} + +Exit Import Page + Click Link ${CLOSE BUTTON} + +Cancel Import + Click Link ${CANCEL BUTTON} \ No newline at end of file diff --git a/tests/EndToEnd/Pages/accounts_page.robot b/tests/EndToEnd/Pages/accounts_page.robot index 26101eb0..adc65d78 100644 --- a/tests/EndToEnd/Pages/accounts_page.robot +++ b/tests/EndToEnd/Pages/accounts_page.robot @@ -7,9 +7,28 @@ Resource ../common.resource *** Variables *** ${ACCOUNTS PAGE URL} ${ROOT URL}/accounts +${GROUP SWITCH} groupSwitch +${SHOW GROUP SWITCH BUTTON} btnShowGroupSwitch +${HIDE GROUP SWITCH BUTTON} btnHideGroupSwitch + *** Keywords *** Accounts Page Should Be Open - Location Should Be ${ACCOUNTS PAGE URL} + Wait Until Location Is ${ACCOUNTS PAGE URL} Go To Accounts Page - Go Authenticated To ${ACCOUNTS PAGE URL} \ No newline at end of file + Go Authenticated To ${ACCOUNTS PAGE URL} + +Show First Totp In Modal + 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} + +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} + Wait Until Page Does Not Contain Element ${GROUP SWITCH} \ No newline at end of file diff --git a/tests/EndToEnd/Pages/groups_page.robot b/tests/EndToEnd/Pages/groups_page.robot index 12ab59dc..e97241e0 100644 --- a/tests/EndToEnd/Pages/groups_page.robot +++ b/tests/EndToEnd/Pages/groups_page.robot @@ -8,7 +8,7 @@ ${GROUPS PAGE URL} ${ROOT URL}/groups *** Keywords *** Groups Page Should Be Open - Location Should Be ${GROUPS PAGE URL} + Wait Until Location Is ${GROUPS PAGE URL} Go To Groups Page Go Authenticated To ${GROUPS PAGE URL} \ No newline at end of file diff --git a/tests/EndToEnd/Pages/password_request_page.robot b/tests/EndToEnd/Pages/password_request_page.robot index d020f757..2974e6a3 100644 --- a/tests/EndToEnd/Pages/password_request_page.robot +++ b/tests/EndToEnd/Pages/password_request_page.robot @@ -9,7 +9,6 @@ ${PASSWORD REQUEST PAGE URL} ${ROOT URL}/password/request ${EMAIL FIELD} emlEmail ${EMAIL FIELD ERROR} valErrorEmail ${SUBMIT BUTTON} btnSendResetPwd -${CANCEL BUTTON} btnCancel *** Keywords *** Password Request Page Should Be Open diff --git a/tests/EndToEnd/Pages/password_reset_page.robot b/tests/EndToEnd/Pages/password_reset_page.robot index 8d597128..3f7e431b 100644 --- a/tests/EndToEnd/Pages/password_reset_page.robot +++ b/tests/EndToEnd/Pages/password_reset_page.robot @@ -13,7 +13,6 @@ ${PASSWORD FIELD ERROR} valErrorPassword ${TOKEN FIELD ERROR} valErrorToken ${SUBMIT BUTTON} btnSubmit ${CONTINUE BUTTON} btnContinue -${CANCEL BUTTON} btnCancel ${TOGGLE PASSWORD VISIBILITY BUTTON} btnTogglePassword *** Keywords *** diff --git a/tests/EndToEnd/Pages/settings.resource b/tests/EndToEnd/Pages/settings.resource new file mode 100644 index 00000000..394da597 --- /dev/null +++ b/tests/EndToEnd/Pages/settings.resource @@ -0,0 +1,20 @@ +*** Settings *** +Library SeleniumLibrary +*** Variables *** + +${OPTIONS TAB} lnkTabOptions +${ACCOUNT TAB} lnkTabAccount +${OAUTH TAB} lnkTabOAuth +${WEBAUTHN TAB} lnkTabWebauthn +${CLOSE BUTTON} btnClose + +*** Keywords *** +Exit Settings + Wait Until Page Contains Element ${CLOSE BUTTON} + Click Link ${CLOSE BUTTON} + +Activate Settings Tab + [Arguments] ${tab} + Wait Until Page Contains Element ${tab} + ${requested tab is active}= Run Keyword And Return Status Element Attribute Value Should Be .tabs > li.is-active a id ${tab} + Run Keyword If ${requested tab is active} == False Click Link ${tab} \ No newline at end of file diff --git a/tests/EndToEnd/Pages/settings_account_page.robot b/tests/EndToEnd/Pages/settings_account_page.robot index cab9cf5e..b798d1e2 100644 --- a/tests/EndToEnd/Pages/settings_account_page.robot +++ b/tests/EndToEnd/Pages/settings_account_page.robot @@ -2,8 +2,9 @@ Documentation A page object to use in Account settings tests. ... Library SeleniumLibrary -Resource ../common.resource Resource login_page.robot +Resource settings.resource +Resource ../common.resource *** Variables *** ${ACCOUNT SETTINGS PAGE URL} ${ROOT URL}/settings/account @@ -18,6 +19,9 @@ Account Settings Page Should Be Open Go To Account Settings Page Go Authenticated To ${ACCOUNT SETTINGS PAGE URL} +Activate Account Settings Tab + Activate Settings Tab ${ACCOUNT TAB} + Delete User Account Scroll To Bottom Input Text ${PASSWORD FIELD FOR DELETE} ${PASSWORD} diff --git a/tests/EndToEnd/Pages/settings_oauth_page.robot b/tests/EndToEnd/Pages/settings_oauth_page.robot index fdbd56f5..80e87cf1 100644 --- a/tests/EndToEnd/Pages/settings_oauth_page.robot +++ b/tests/EndToEnd/Pages/settings_oauth_page.robot @@ -2,6 +2,7 @@ Documentation A page object to use in OAuth settings tests. ... Library SeleniumLibrary +Resource settings.resource Resource ../common.resource *** Variables *** @@ -13,3 +14,6 @@ OAuth Settings Page Should Be Open Go To OAuth Settings Page Go Authenticated To ${OAUTH SETTINGS PAGE URL} + +Activate OAuth Settings Tab + Activate Settings Tab ${OAUTH TAB} \ No newline at end of file diff --git a/tests/EndToEnd/Pages/settings_options_page.robot b/tests/EndToEnd/Pages/settings_options_page.robot index d11aa1ea..fe69f2bc 100644 --- a/tests/EndToEnd/Pages/settings_options_page.robot +++ b/tests/EndToEnd/Pages/settings_options_page.robot @@ -2,6 +2,7 @@ Documentation A page object to use in User Options settings tests. ... Library SeleniumLibrary +Resource settings.resource Resource ../common.resource *** Variables *** @@ -13,3 +14,6 @@ Options Settings Page Should Be Open Go To Options Settings Page Go Authenticated To ${OPTIONS SETTINGS PAGE URL} + +Activate Options Settings Tab + Activate Settings Tab ${OPTIONS TAB} \ No newline at end of file diff --git a/tests/EndToEnd/Pages/settings_webauthn_page.robot b/tests/EndToEnd/Pages/settings_webauthn_page.robot index b0170435..8e0f8999 100644 --- a/tests/EndToEnd/Pages/settings_webauthn_page.robot +++ b/tests/EndToEnd/Pages/settings_webauthn_page.robot @@ -2,6 +2,7 @@ Documentation A page object to use in WebAuthn settings tests. ... Library SeleniumLibrary +Resource settings.resource Resource ../common.resource *** Variables *** @@ -9,7 +10,11 @@ ${WEBAUTHN SETTINGS PAGE URL} ${ROOT URL}/settings/webauthn *** Keywords *** Webauthn Settings Page Should Be Open - Location Should Be ${WEBAUTHN SETTINGS PAGE URL} + Wait Until Location Is ${WEBAUTHN SETTINGS PAGE URL} Go To Webauthn Settings Page Go Authenticated To ${WEBAUTHN SETTINGS PAGE URL} + +Activate Webauthn Settings Tab + Activate Settings Tab ${WEBAUTHN TAB} + Wait Until Page Does Not Contain Element icnSpinner \ No newline at end of file diff --git a/tests/EndToEnd/Pages/start_page.robot b/tests/EndToEnd/Pages/start_page.robot index c2a97a7d..5fe8e383 100644 --- a/tests/EndToEnd/Pages/start_page.robot +++ b/tests/EndToEnd/Pages/start_page.robot @@ -7,9 +7,16 @@ Resource ../common.resource *** Variables *** ${START PAGE URL} ${ROOT URL}/start +${IMPORT BUTTON} btnImport + *** Keywords *** Start Page Should Be Open Location Should Be ${START PAGE URL} Go To Start Page Go Authenticated To ${START PAGE URL} + Wait Until Page Contains Element ${BACK BUTTON} + Set Footer As Static + +Choose To Import Accounts + Click Element ${IMPORT BUTTON} diff --git a/tests/EndToEnd/Pages/webauthn_lost_page.robot b/tests/EndToEnd/Pages/webauthn_lost_page.robot index 54d916bb..633ca8e4 100644 --- a/tests/EndToEnd/Pages/webauthn_lost_page.robot +++ b/tests/EndToEnd/Pages/webauthn_lost_page.robot @@ -9,7 +9,6 @@ ${WEBAUTHN LOST PAGE URL} ${ROOT URL}/webauthn/lost ${EMAIL FIELD} emlEmail ${EMAIL FIELD ERROR} valErrorEmail ${SUBMIT BUTTON} btnSubmit -${CANCEL BUTTON} btnCancel *** Keywords *** Webauthn Device Lost Page Should Be Open diff --git a/tests/EndToEnd/Pages/webauthn_recover_page.robot b/tests/EndToEnd/Pages/webauthn_recover_page.robot index 465972e6..3a3bc70a 100644 --- a/tests/EndToEnd/Pages/webauthn_recover_page.robot +++ b/tests/EndToEnd/Pages/webauthn_recover_page.robot @@ -10,7 +10,6 @@ ${PASSWORD FIELD} pwdPassword ${PASSWORD FIELD ERROR} valErrorPassword ${REVOKE ALL CHECKBOX} revokeAll ${SUBMIT BUTTON} btnRecover -${CANCEL BUTTON} btnCancel ${RESET PASSWORD LINK} lnkResetPwd *** Keywords *** diff --git a/tests/EndToEnd/Tests/Auth/password_request.robot b/tests/EndToEnd/Tests/Auth/password_request.robot index 7c2a748c..219ef268 100644 --- a/tests/EndToEnd/Tests/Auth/password_request.robot +++ b/tests/EndToEnd/Tests/Auth/password_request.robot @@ -24,7 +24,7 @@ New Request While Pending One Is Rejected Email Submit Should Fail ${ADMIN EMAIL} Request Form Can Be Quit - Click Link ${CANCEL BUTTON} + Click Element ${CANCEL BUTTON} Login Page Should Be Open *** Keywords *** diff --git a/tests/EndToEnd/Tests/Auth/password_reset.robot b/tests/EndToEnd/Tests/Auth/password_reset.robot index 4c0ce7f3..79ef7055 100644 --- a/tests/EndToEnd/Tests/Auth/password_reset.robot +++ b/tests/EndToEnd/Tests/Auth/password_reset.robot @@ -48,7 +48,7 @@ Password Reset Is Submitted Sucessfully Reset Form Can Be Quit Go To Password Reset Page ${ADMIN EMAIL} ${TOKEN} - Click Link ${CANCEL BUTTON} + Click Element ${CANCEL BUTTON} Login Page Should Be Open *** Keywords *** diff --git a/tests/EndToEnd/Tests/Auth/webauthn_lost.robot b/tests/EndToEnd/Tests/Auth/webauthn_lost.robot index 0f73c615..9cf4f3f7 100644 --- a/tests/EndToEnd/Tests/Auth/webauthn_lost.robot +++ b/tests/EndToEnd/Tests/Auth/webauthn_lost.robot @@ -24,7 +24,7 @@ New Request While Pending One Is Rejected Email Submit Should Fail ${ADMIN EMAIL} Webauthn Lost Form Can Be Quit - Click Link ${CANCEL BUTTON} + Click Element ${CANCEL BUTTON} Login Page Should Be Open *** Keywords *** diff --git a/tests/EndToEnd/Tests/Auth/webauthn_recover.robot b/tests/EndToEnd/Tests/Auth/webauthn_recover.robot index dab98a36..d187d5af 100644 --- a/tests/EndToEnd/Tests/Auth/webauthn_recover.robot +++ b/tests/EndToEnd/Tests/Auth/webauthn_recover.robot @@ -34,7 +34,7 @@ Reset Passwork Link Should Be Visible Webauthn Recover Form Can Be Quit Go To Webauthn Recover Page \ \ - Click Link ${CANCEL BUTTON} + Click Element ${CANCEL BUTTON} Login Page Should Be Open *** Keywords *** diff --git a/tests/EndToEnd/Tests/Navigation/close_and_back_buttons.robot b/tests/EndToEnd/Tests/Navigation/close_and_back_buttons.robot new file mode 100644 index 00000000..e9312fe7 --- /dev/null +++ b/tests/EndToEnd/Tests/Navigation/close_and_back_buttons.robot @@ -0,0 +1,94 @@ +*** Settings *** +Documentation A test suite to check Close & Back buttons targeted urls. +Suite Setup Run keywords +... Open Custom Browser +... AND Play Admin Sign In Workflow +Suite Teardown Close All Browsers +Resource ../../Pages/login_page.robot +Resource ../../Pages/about_page.robot +Resource ../../Pages/accounts_page.robot +Resource ../../Pages/groups_page.robot +Resource ../../Pages/settings_options_page.robot +Resource ../../Pages/settings_webauthn_page.robot +Resource ../../Pages/start_page.robot +Resource ../../Pages/account_import_page.robot +Resource ../../common.resource + +*** Variables *** +${STARTING URL} ${OPTIONS SETTINGS PAGE URL} + +*** Test Cases *** +Back Button From About Page Should Send To Previous Page + Go To ${STARTING URL} + Click Link ${ABOUT LINK} + Click Link ${BACK BUTTON} + Wait Until Location Is ${STARTING URL} + +Back Button From About Page Without History Should Send To Accounts Page + Go To ${STARTING URL} + Go To About Page + Click Link ${BACK BUTTON} + Wait Until Location Is ${ACCOUNTS PAGE URL} + +Back Button From Start Page Should Send To Accounts Page + Go To Start Page + Click Link ${BACK BUTTON} + Wait Until Location Is ${ACCOUNTS PAGE URL} + +Back Button From Import Page Should Send To Accounts Page + Go To Start Page + Choose To Import Accounts + Exit Import Page + Wait Until Location Is ${ACCOUNTS PAGE URL} + +Cancel Button From Import Page Should Send To Accounts Page + Go To Start Page + Choose To Import Accounts + Cancel Import + Wait Until Location Is ${ACCOUNTS PAGE URL} + +Close Button Should Close Modal Window + Go To ${ACCOUNTS PAGE URL} + Show First Totp In Modal + Click Element ${CLOSE BUTTON} + Wait Until Element Is Not Visible class:modal-otp + +Close Button Should Close Group Switch + Go To ${ACCOUNTS PAGE URL} + Show Group Switch + Wait Until Page Contains Element ${CLOSE BUTTON} + Click Element ${CLOSE BUTTON} + Wait Until Page Does Not Contain Element ${GROUP SWITCH} + +Close Button From Groups Page Should Send To Accounts Page + Go To ${GROUPS PAGE URL} + Wait Until Page Contains Element ${CLOSE BUTTON} + Click Element ${CLOSE BUTTON} + Wait Until Location Is ${ACCOUNTS PAGE URL} + +Close Button From Settings Should Send To Page Before Settings Browsing + [Template] Close Button From A Settings Tab Should Send To Previous Page + ${OPTIONS TAB} + ${WEBAUTHN TAB} + ${ACCOUNT TAB} + ${OAUTH TAB} + +Visiting About Page Via Settings Pages Should End To Starting Page + Go To Groups Page + Browse To Settings + Activate Webauthn Settings Tab + Browse To About Page + Exit About Page + Webauthn Settings Page Should Be Open + Exit Settings + Groups Page Should Be Open + + +*** Keywords *** +Close Button From A Settings Tab Should Send To Previous Page + [Arguments] ${tab} + Go To Groups Page + Browse To Settings + Activate Settings Tab ${tab} + Exit Settings + Groups Page Should Be Open \ No newline at end of file diff --git a/tests/EndToEnd/common.resource b/tests/EndToEnd/common.resource index f695e7d9..788e3656 100644 --- a/tests/EndToEnd/common.resource +++ b/tests/EndToEnd/common.resource @@ -14,7 +14,14 @@ ${USER EMAIL} testingadmin@2fauth.app ${PASSWORD} password ${ROOT URL} http://${SERVER} + ${LOGOUT LINK} lnkSignOut +${ABOUT LINK} lnkAbout +${SETTINGS LINK} lnkSettings +${BACK BUTTON} lnkBack +${CANCEL BUTTON} btnCancel +${CLOSE BUTTON} btnClose +${OTP} otp ${SUCCESS NOTIFICATION} css:#vueNotification .is-success ${ALERT NOTIFICATION} css:#vueNotification .is-danger @@ -67,4 +74,7 @@ Element Should Not Have Class Set Footer As Static execute javascript - ... document.querySelector('footer').style = 'position: static'; \ No newline at end of file + ... document.querySelector('footer').style = 'position: static'; + +Browse To Settings + Click Element ${SETTINGS LINK} \ No newline at end of file