From 4bd5cd0d6236b04acd5e62822c2beb0cde027a46 Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Fri, 1 Sep 2023 15:22:18 +0200 Subject: [PATCH] Speed up multiple options switching in e2e tests --- .../Pages/settings_options_page.robot | 10 ++++ tests/EndToEnd/Tests/Otps/always_on.robot | 24 ++++++--- tests/EndToEnd/Tests/Otps/on_demand.robot | 50 ++++++++++++------- tests/EndToEnd/common.resource | 4 +- 4 files changed, 61 insertions(+), 27 deletions(-) diff --git a/tests/EndToEnd/Pages/settings_options_page.robot b/tests/EndToEnd/Pages/settings_options_page.robot index 4c67bde8..e02ccac2 100644 --- a/tests/EndToEnd/Pages/settings_options_page.robot +++ b/tests/EndToEnd/Pages/settings_options_page.robot @@ -17,6 +17,16 @@ Run Set Option Keyword And Come Back Go To Options Settings Page Run Keyword ${set option keyword} Go To ${current url} + +Run Multiple Set Option Keyword And Come Back + [Arguments] @{set option keywords} + ${current url} = Get Location + Go To Options Settings Page + FOR ${keyword} IN @{set option keywords} + Close Notification + Run Keyword ${keyword} + END + Go To ${current url} Options Tab Is Active Run Keyword And Return Status Element Should Have Class lnkTabOptions router-link-active diff --git a/tests/EndToEnd/Tests/Otps/always_on.robot b/tests/EndToEnd/Tests/Otps/always_on.robot index d10e3921..35c1f592 100644 --- a/tests/EndToEnd/Tests/Otps/always_on.robot +++ b/tests/EndToEnd/Tests/Otps/always_on.robot @@ -34,32 +34,40 @@ All Otp Digits Should Not Be Grouped END All Otp Digits Should Be Grouped By Pair - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Set Option Password Formatting By Pair + @{set option keywords} = Create List + ... Enable Option Password Formatting + ... Set Option Password Formatting By Pair + Run Multiple Set Option Keyword And Come Back @{set option keywords} @{otps} = Get OTP Values Shown On Home FOR ${otp} IN @{otps} Otp Digits Should Be Grouped By Pair ${otp} END All Otp Digits Should Be Grouped By Trio - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Set Option Password Formatting By Trio + @{set option keywords} = Create List + ... Enable Option Password Formatting + ... Set Option Password Formatting By Trio + Run Multiple Set Option Keyword And Come Back @{set option keywords} @{otps} = Get OTP Values Shown On Home FOR ${otp} IN @{otps} Otp Digits Should Be Grouped By Trio ${otp} END All Otp Digits Should Be Grouped By Half - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Set Option Password Formatting By Half + @{set option keywords} = Create List + ... Enable Option Password Formatting + ... Set Option Password Formatting By Half + Run Multiple Set Option Keyword And Come Back @{set option keywords} @{otps} = Get OTP Values Shown On Home FOR ${otp} IN @{otps} Otp Digits Should Be Grouped By Half ${otp} END Readable Otp Should Be Copied On Click - Run Set Option Keyword And Come Back Disable Option Show Otp As Dot - Run Set Option Keyword And Come Back Enable Option Password Formatting + @{set option keywords} = Create List + ... Disable Option Show Otp As Dot + ... Enable Option Password Formatting + Run Multiple Set Option Keyword And Come Back @{set option keywords} Click Otp On Home To Copy It A Success Notification Should Appear Otp Notified As Copied Should Be In Clipboard diff --git a/tests/EndToEnd/Tests/Otps/on_demand.robot b/tests/EndToEnd/Tests/Otps/on_demand.robot index 604de692..97658dcc 100644 --- a/tests/EndToEnd/Tests/Otps/on_demand.robot +++ b/tests/EndToEnd/Tests/Otps/on_demand.robot @@ -31,22 +31,28 @@ Otp Digits Should Not Be Grouped Otp Digits Should Not Be Grouped ${otp value} Otp Digits Should Be Grouped By Pair - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Set Option Password Formatting By Pair + @{set option keywords} = Create List + ... Enable Option Password Formatting + ... Set Option Password Formatting By Pair + Run Multiple Set Option Keyword And Come Back @{set option keywords} Show An Otp In Modal ${otp value}= Get OTP Value Shown In Modal Otp Digits Should Be Grouped By Pair ${otp value} Otp Digits Should Be Grouped By Trio - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Set Option Password Formatting By Trio + @{set option keywords} = Create List + ... Enable Option Password Formatting + ... Set Option Password Formatting By Trio + Run Multiple Set Option Keyword And Come Back @{set option keywords} Show An Otp In Modal ${otp value}= Get OTP Value Shown In Modal Otp Digits Should Be Grouped By Trio ${otp value} Otp Digits Should Be Grouped By Half - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Set Option Password Formatting By Half + @{set option keywords} = Create List + ... Enable Option Password Formatting + ... Set Option Password Formatting By Half + Run Multiple Set Option Keyword And Come Back @{set option keywords} Show An Otp In Modal ${otp value}= Get OTP Value Shown In Modal Otp Digits Should Be Grouped By Half ${otp value} @@ -66,9 +72,11 @@ Modal Should Not Be Closed After Otp Copy Element Should Be Visible ${OTP} Readable Otp Should Be Copied On Click - Run Set Option Keyword And Come Back Disable Option Show Otp As Dot - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Disable Option Copy Otp On Display + @{set option keywords} = Create List + ... Disable Option Show Otp As Dot + ... Enable Option Password Formatting + ... Disable Option Copy Otp On Display + Run Multiple Set Option Keyword And Come Back @{set option keywords} Show An Otp In Modal Click Otp In Modal To Copy It A Success Notification Should Appear @@ -77,9 +85,11 @@ Readable Otp Should Be Copied On Click Obfuscated Otp Should Be Copied On Click ${random value} = Generate Random String 8 [LETTERS] Copy To Clipboard ${random value} - Run Set Option Keyword And Come Back Enable Option Show Otp As Dot - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Enable Option Copy Otp On Display + @{set option keywords} = Create List + ... Enable Option Show Otp As Dot + ... Enable Option Password Formatting + ... Enable Option Copy Otp On Display + Run Multiple Set Option Keyword And Come Back @{set option keywords} Show An Otp In Modal Click Otp In Modal To Copy It A Success Notification Should Appear @@ -90,9 +100,11 @@ Obfuscated Otp Should Be Copied On Click Should Match Regexp ${clipboard} ^\\d+$ Readable Otp Should Be Copied On Display - Run Set Option Keyword And Come Back Disable Option Show Otp As Dot - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Enable Option Copy Otp On Display + @{set option keywords} = Create List + ... Disable Option Show Otp As Dot + ... Enable Option Password Formatting + ... Enable Option Copy Otp On Display + Run Multiple Set Option Keyword And Come Back @{set option keywords} Show An Otp In Modal A Success Notification Should Appear On Screen Otp Notified As Copied Should Be In Clipboard @@ -100,9 +112,11 @@ Readable Otp Should Be Copied On Display Obfuscated Otp Should Be Copied On Display ${random value} = Generate Random String 8 [LETTERS] Copy To Clipboard ${random value} - Run Set Option Keyword And Come Back Enable Option Show Otp As Dot - Run Set Option Keyword And Come Back Enable Option Password Formatting - Run Set Option Keyword And Come Back Enable Option Copy Otp On Display + @{set option keywords} = Create List + ... Enable Option Show Otp As Dot + ... Enable Option Password Formatting + ... Enable Option Copy Otp On Display + Run Multiple Set Option Keyword And Come Back @{set option keywords} Show An Otp In Modal A Success Notification Should Appear Close Modal Otp diff --git a/tests/EndToEnd/common.resource b/tests/EndToEnd/common.resource index 8b3799e7..4a28b455 100644 --- a/tests/EndToEnd/common.resource +++ b/tests/EndToEnd/common.resource @@ -26,7 +26,6 @@ ${OTP} otp ${SUCCESS NOTIFICATION} css:#vueNotification .is-success ${ALERT NOTIFICATION} css:#vueNotification .is-danger -${OTP OBFUSCATOR SYMBOL} ● ${CLEARED CLIPBOARD VALUE} -clear- *** Keywords *** @@ -54,6 +53,9 @@ Go Authenticated To A Success Notification Should Appear Wait Until Element Is Visible ${SUCCESS NOTIFICATION} +Close Notification + Run Keyword And Ignore Error Click Element ${SUCCESS NOTIFICATION} + An Error Notification Should Appear Wait Until Element Is Visible ${ALERT NOTIFICATION}