Skip to content

Warning modals (pending test tag) #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions tests/automation/onboarding.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
},
);
1 change: 1 addition & 0 deletions tests/automation/types/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@ export type DataTestId =
| 'modal-heading'
| 'call-notification-answered-a-call'
| 'call-notification-started-call'
| 'back-button'
| 'session-recovery-password';