diff --git a/tests/automation/onboarding.spec.ts b/tests/automation/onboarding.spec.ts new file mode 100644 index 0000000..cee341b --- /dev/null +++ b/tests/automation/onboarding.spec.ts @@ -0,0 +1,55 @@ +import { englishStrippedStr } from '../locale/localizedString'; +import { test_Alice_1W_no_network } from './setup/sessionTest'; +import { + checkModalStrings, + clickOnTestIdWithText, + typeIntoInput, + waitForTestIdWithText, +} from './utilities/utils'; + +test_Alice_1W_no_network( + 'Warning modal new account', + async ({ aliceWindow1 }) => { + // Create User + await clickOnTestIdWithText(aliceWindow1, 'create-account-button'); + // Need to implement a back button on Desktop + await clickOnTestIdWithText(aliceWindow1, 'back-button'); + // Expect modal to appear with warning message + await checkModalStrings( + aliceWindow1, + englishStrippedStr('warning').toString(), + englishStrippedStr('onboardingBackAccountCreation').toString(), + ); + await clickOnTestIdWithText( + aliceWindow1, + 'session-confirm-ok-button', + englishStrippedStr('quit').toString(), + ); + // Should reload page and take you back to create account page + await waitForTestIdWithText(aliceWindow1, 'create-account-button'); + }, +); + +test_Alice_1W_no_network( + 'Warning modal restore account', + async ({ aliceWindow1 }) => { + const seedPhrase = + 'eldest fazed hybrid buzzer nasty domestic digit pager unusual purged makeup assorted domestic'; + // Restore user + await clickOnTestIdWithText(aliceWindow1, 'existing-account-button'); + // Input recovery phrase + await typeIntoInput(aliceWindow1, 'recovery-phrase-input', seedPhrase); + // Click continue to go to loading page + await clickOnTestIdWithText(aliceWindow1, 'continue-button'); + // Need to implement a back button on Desktop + await clickOnTestIdWithText(aliceWindow1, 'back-button'); + // Expect modal to appear with warning message + await checkModalStrings( + aliceWindow1, + englishStrippedStr('warning').toString(), + englishStrippedStr('onboardingBackLoadAccount').toString(), + ); + // Should reload page and take you back to create account page + await waitForTestIdWithText(aliceWindow1, 'create-account-button'); + }, +); diff --git a/tests/automation/types/testing.ts b/tests/automation/types/testing.ts index abe233d..1ae74e4 100644 --- a/tests/automation/types/testing.ts +++ b/tests/automation/types/testing.ts @@ -179,4 +179,5 @@ export type DataTestId = | 'modal-heading' | 'call-notification-answered-a-call' | 'call-notification-started-call' + | 'back-button' | 'session-recovery-password';