2FAuth/tests/EndToEnd/Tests/Otps/on_demand.robot

140 lines
5.7 KiB
Plaintext
Raw Normal View History

2023-08-31 19:12:55 +02:00
*** Settings ***
Documentation A test suite containing tests related to OTP generation and display.
Suite Setup Run Keywords
... Open Custom Browser
... AND Play Admin Sign In Workflow
... AND Run Set Option Keyword And Come Back Set Option Show Password To On Demand
Suite Teardown Close All Browsers
Library String
Resource ../../Pages/accounts_page.robot
Resource ../../Pages/settings_options_page.robot
Resource ../../common.resource
2023-09-01 14:43:27 +02:00
Resource otps.resource
2023-08-31 19:12:55 +02:00
*** Test Cases ***
Readable Otp Should Be Displayed
Run Set Option Keyword And Come Back Disable Option Show Otp As Dot
Show An Otp In Modal
${otp value}= Get OTP Value Shown In Modal
2023-09-01 14:43:27 +02:00
Otp Should Not Be Obfuscated ${otp value}
2023-08-31 19:12:55 +02:00
Obfuscated Otp Should Be Displayed
Run Set Option Keyword And Come Back Enable Option Show Otp As Dot
Show An Otp In Modal
${otp value}= Get OTP Value Shown In Modal
2023-09-01 14:43:27 +02:00
Otp Should Be Obfuscated ${otp value}
2023-08-31 19:12:55 +02:00
Otp Digits Should Not Be Grouped
Run Set Option Keyword And Come Back Disable Option Password Formatting
Show An Otp In Modal
${otp value}= Get OTP Value Shown In Modal
2023-09-01 14:43:27 +02:00
Otp Digits Should Not Be Grouped ${otp value}
2023-08-31 19:12:55 +02:00
Otp Digits Should Be Grouped 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}
2023-08-31 19:12:55 +02:00
Show An Otp In Modal
${otp value}= Get OTP Value Shown In Modal
2023-09-01 14:43:27 +02:00
Otp Digits Should Be Grouped By Pair ${otp value}
2023-08-31 19:12:55 +02:00
Otp Digits Should Be Grouped 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}
2023-08-31 19:12:55 +02:00
Show An Otp In Modal
${otp value}= Get OTP Value Shown In Modal
2023-09-01 14:43:27 +02:00
Otp Digits Should Be Grouped By Trio ${otp value}
2023-08-31 19:12:55 +02:00
Otp Digits Should Be Grouped 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}
2023-08-31 19:12:55 +02:00
Show An Otp In Modal
${otp value}= Get OTP Value Shown In Modal
2023-09-01 14:43:27 +02:00
Otp Digits Should Be Grouped By Half ${otp value}
2023-08-31 19:12:55 +02:00
Modal Should Be Closed After Otp Copy
Run Set Option Keyword And Come Back Enable Option Close Otp After Copy
Show An Otp In Modal
2023-09-01 14:43:27 +02:00
Click Otp In Modal To Copy It
A Success Notification Should Appear
2023-08-31 19:12:55 +02:00
Wait Until Element Is Not Visible ${OTP}
Modal Should Not Be Closed After Otp Copy
Run Set Option Keyword And Come Back Disable Option Close Otp After Copy
Show An Otp In Modal
2023-09-01 14:43:27 +02:00
Click Otp In Modal To Copy It
A Success Notification Should Appear
2023-08-31 19:12:55 +02:00
Element Should Be Visible ${OTP}
Readable Otp Should Be Copied On Click
@{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}
2023-08-31 19:12:55 +02:00
Show An Otp In Modal
2023-09-01 14:43:27 +02:00
Click Otp In Modal To Copy It
2023-08-31 19:12:55 +02:00
A Success Notification Should Appear
On Screen Otp Notified As Copied Should Be In Clipboard
Obfuscated Otp Should Be Copied On Click
${random value} = Generate Random String 8 [LETTERS]
Copy To Clipboard ${random value}
@{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}
2023-08-31 19:12:55 +02:00
Show An Otp In Modal
2023-09-01 14:43:27 +02:00
Click Otp In Modal To Copy It
2023-08-31 19:12:55 +02:00
A Success Notification Should Appear
Close Modal Otp
Wait Until Element Is Visible ${SEARCH FIELD}
Press Keys ${SEARCH FIELD} CTRL+v
${clipboard} = Get Value ${SEARCH FIELD}
Should Match Regexp ${clipboard} ^\\d+$
Readable Otp Should Be Copied 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}
2023-08-31 19:12:55 +02:00
Show An Otp In Modal
A Success Notification Should Appear
On Screen Otp Notified As Copied Should Be In Clipboard
Obfuscated Otp Should Be Copied On Display
${random value} = Generate Random String 8 [LETTERS]
Copy To Clipboard ${random value}
@{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}
2023-08-31 19:12:55 +02:00
Show An Otp In Modal
A Success Notification Should Appear
Close Modal Otp
Wait Until Element Is Visible ${SEARCH FIELD}
Press Keys ${SEARCH FIELD} CTRL+v
${clipboard} = Get Value ${SEARCH FIELD}
Should Match Regexp ${clipboard} ^\\d+$
Otp Should Not Be Copied On Display
${random value} = Generate Random String
Copy To Clipboard ${random value}
Run Set Option Keyword And Come Back Disable Option Copy Otp On Display
Show An Otp In Modal
Clipboard Should Contain ${random value}
*** Keywords ***
On Screen Otp Notified As Copied Should Be In Clipboard
${displayed otp}= Get OTP Value Shown In Modal
${otp} = Replace String ${displayed otp} ${SPACE} ${EMPTY}
Clipboard Should Contain ${otp}