Skip to content

Commit

Permalink
test(extension): cleanup onboarding steps
Browse files Browse the repository at this point in the history
  • Loading branch information
wklos-iohk committed Apr 17, 2024
1 parent 6608599 commit eaa6342
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 141 deletions.
10 changes: 0 additions & 10 deletions packages/e2e-tests/src/assert/modalAssert.ts
Expand Up @@ -35,16 +35,6 @@ class ModalAssert {
await this.assertSeeConfirmButton(confirmButtonLabel);
}

async assertSeeRestoringMultiAddressWalletModal() {
const title = await t('browserView.walletSetup.confirmRestoreModal.header');
const description = await t('browserView.walletSetup.confirmRestoreModal.content');
const cancelButtonLabel = await t('general.button.cancel');
const confirmButtonLabel = await t('browserView.walletSetup.confirmRestoreModal.confirm');
const parsedDescription = description.replace('<b>', '').replace('</b>', '');

await this.assertSeeModal(title, parsedDescription, cancelButtonLabel, confirmButtonLabel);
}

async assertSeeRemoveWalletModal(shouldBeDisplayed: boolean) {
if (shouldBeDisplayed) {
const title = await t('browserView.settings.wallet.general.removeWalletAlert.title');
Expand Down
71 changes: 0 additions & 71 deletions packages/e2e-tests/src/elements/onboarding/analyticsPage.ts

This file was deleted.

Expand Up @@ -174,7 +174,7 @@ Feature: Onboarding - Create wallet
| sad |
| saddle |
| sadness |
And I click header to loose focus
And I click header to lose focus
Then I do not see autocomplete options list
And I click on mnemonic input
Then I see following autocomplete options:
Expand Down
36 changes: 18 additions & 18 deletions packages/e2e-tests/src/features/OnboardingRestoreWallet.feature
Expand Up @@ -3,56 +3,56 @@ Feature: Onboarding - Restore wallet

@LW-2457
Scenario: Restore Wallet - Mnemonic writedown page - next button
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
Then "Mnemonic verification" page is displayed from "Restore wallet" flow with 24 words
And "Next" button is disabled during onboarding process

@LW-2459
Scenario: Restore Wallet - happy path to "Name your wallet" page
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And I go to "Wallet setup" page from "Restore" wallet flow
And "Wallet setup" page is displayed

@LW-2460
Scenario: Restore Wallet - Mnemonic verification - fill all fields - wrong mnemonic
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And I go to "Mnemonic verification" page from "Restore" wallet flow
When I add characters "asd" in word 7
Then "Next" button is disabled during onboarding process

@LW-2461
Scenario: Restore Wallet - Name your wallet - back button
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And I go to "Wallet setup" page from "Restore" wallet flow
And "Wallet setup" page is displayed
When I click "Back" button during wallet setup
Then "Mnemonic verification" page is displayed from "Restore wallet" flow with 24 words

@LW-2462 @Smoke
Scenario: Restore Wallet - Name your wallet - happy path to "Enter wallet step"
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And I enter 24 correct mnemonic words on "Mnemonic verification" page
And I click "Next" button during wallet setup
And I enter wallet name: "ValidName", password: "N_8J@bne87A" and password confirmation: "N_8J@bne87A"
Then "Enter wallet" button is enabled

@LW-2977
Scenario Outline: Restore Wallet - Set password - Recommendation for password: <passw_err>, password: <password>, password confirmation: <password_conf>
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And I go to "Wallet setup" page from "Restore" wallet flow and "not fill" values
When I enter wallet name: "wallet", password: "<password>" and password confirmation: "<password_conf>"
Then Password recommendation: "<passw_err>", complexity bar level: "<complex_bar_lvl>" and password confirmation error: "<passw_conf_err>" are displayed
Examples:
| password | password_conf | passw_err | complex_bar_lvl | passw_conf_err |
| password | password_conf | passw_err | complex_bar_lvl | passw_conf_err |
| a | | core.walletNameAndPasswordSetupStep.firstLevelPasswordStrengthFeedback | 1 | empty |
| P@ss | | core.walletNameAndPasswordSetupStep.firstLevelPasswordStrengthFeedback | 1 | empty |
| N_8J@bne | | core.walletNameAndPasswordSetupStep.secondLevelPasswordStrengthFeedback | 2 | empty |
| N_8J@bne87 | | empty | 3 | empty |
| N_8J@bne87A | N_8J@bne87 | empty | 4 | core.walletSetupRegisterStep.noMatchPassword |
| N_8J@bne87 | | empty | 3 | empty |
| N_8J@bne87A | N_8J@bne87 | empty | 4 | core.walletSetupRegisterStep.noMatchPassword |

@LW-2464
Scenario: Restore Wallet - All done page - happy path
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And I go to "Wallet setup" page from "Restore" wallet flow
When I click "Enter wallet" button
Then I see LW homepage
Expand All @@ -78,14 +78,14 @@ Feature: Onboarding - Restore wallet

@LW-2628
Scenario: Restore Wallet - autofill words
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
Then "Mnemonic verification" page is displayed from "Restore wallet" flow with 24 words
When I fill mnemonic input with "s"
Then I see following autocomplete options:
| sad |
| saddle |
| sadness |
And I click header to loose focus
And I click header to lose focus
Then I do not see autocomplete options list
And I click on mnemonic input
Then I see following autocomplete options:
Expand All @@ -109,15 +109,15 @@ Feature: Onboarding - Restore wallet

@LW-4612
Scenario: Restore Wallet - Mnemonic verification - mnemonic length limited to 10 characters - paste word exceeding the limit
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And "Mnemonic verification" page is displayed from "Restore wallet" flow with 24 words
When I fill mnemonic input with "abcdefghijklmnopqrstuvwxyz"
Then the mnemonic input contains the word "abcdefghij"
And the word in mnemonic input has only 10 characters

@LW-4613
Scenario: Restore Wallet - Mnemonic verification - mnemonic length limited to 10 characters - add letter to mnemonic to exceed the limit
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And "Mnemonic verification" page is displayed from "Restore wallet" flow with 24 words
When I fill mnemonic input with "abcdefghij"
And I add characters "x" in word 0
Expand All @@ -126,7 +126,7 @@ Feature: Onboarding - Restore wallet

@LW-4546 @LW-4549
Scenario Outline: Restore wallet - Limit the wallet name input - Realtime error when inputs name with size of <value> character
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And I go to "Wallet setup" page from "Restore" wallet flow
When I enter wallet name with size of: <value> characters
Then wallet name error "core.walletSetupRegisterStep.nameMaxLength" <is_displayed> displayed
Expand Down Expand Up @@ -162,7 +162,7 @@ Feature: Onboarding - Restore wallet

@LW-6080 @LW-5839 @LW-5838
Scenario Outline: Restore Wallet - "Recovery phrase length page" restore <mnemonicLength> words happy path
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And I select <mnemonicLength> word passphrase length
Then "Mnemonic verification" page is displayed from "Restore wallet" flow with <mnemonicLength> words
When I enter <mnemonicLength> correct mnemonic words on "Mnemonic verification" page
Expand All @@ -178,7 +178,7 @@ Feature: Onboarding - Restore wallet

@LW-6081
Scenario Outline: Restore Wallet - error message is displayed for <mnemonicLength> passphrase length
Given I click "Restore" button and confirm
Given I click "Restore" button on wallet setup page
And "Mnemonic verification" page is displayed from "Restore wallet" flow with 24 words
And I select <mnemonicLength> word passphrase length
When I enter <mnemonicLength> incorrect mnemonic words on "Mnemonic verification" page
Expand All @@ -194,7 +194,7 @@ Feature: Onboarding - Restore wallet
Given I set <mode> theme mode in Local Storage
When "Get started" page is displayed
Then I see current onboarding page in <mode> mode
And I click "Restore" button and confirm
And I click "Restore" button on wallet setup page
When "Mnemonic verification" page is displayed from "Restore wallet" flow with 24 words
Then I see current onboarding page in <mode> mode
And I enter 24 correct mnemonic words on "Mnemonic verification" page
Expand Down
Expand Up @@ -363,7 +363,7 @@ Feature: General Settings - Extended Browser View
And I click "Remove wallet" button on "Remove wallet" modal
And I accept analytics banner on "Get started" page
Then "Get started" page is displayed
When I click "Restore" button and confirm
When I click "Restore" button on wallet setup page
And I go to "Wallet setup" page with wallet TAWalletNoFunds from "Restore" wallet flow
When I click "Enter wallet" button
Then I see LW homepage
Expand Down
41 changes: 1 addition & 40 deletions packages/e2e-tests/src/steps/onboardingSteps.ts
Expand Up @@ -5,8 +5,6 @@ import { switchToLastWindow } from '../utils/window';
import { t } from '../utils/translationService';
import CommonOnboardingElements from '../elements/onboarding/commonOnboardingElements';
import Modal from '../elements/modal';
import ModalAssert from '../assert/modalAssert';
import OnboardingAnalyticsPage from '../elements/onboarding/analyticsPage';
import OnboardingCommonAssert from '../assert/onboarding/onboardingCommonAssert';
import OnboardingConnectHWPageAssert from '../assert/onboarding/onboardingConnectHWPageAssert';
import OnboardingMainPage from '../elements/onboarding/mainPage';
Expand Down Expand Up @@ -76,27 +74,6 @@ When(/^I select ([^"]*) account on Select Account page$/, async (accountNumber:
await SelectAccountPage.accountRadioButtons[accountNumber - 1].click();
});

When(/^I click "(Back|Skip|Agree)" button on Analytics page$/, async (button: 'Back' | 'Skip' | 'Agree') => {
switch (button) {
case 'Back':
await OnboardingAnalyticsPage.backButton.click();
break;
case 'Skip':
await OnboardingAnalyticsPage.skipButton.click();
break;
case 'Agree':
await OnboardingAnalyticsPage.nextButton.click();
break;
default:
throw new Error(`Unsupported button name: ${button}`);
}
});

When(/^I click "Go to my wallet" button on "All done" page$/, async () => {
await RecoveryPhrasePage.nextButton.waitForClickable();
await RecoveryPhrasePage.nextButton.click();
});

When(
/^I click "(Cancel|OK)" button on "(Limited support for DApp|Restoring a multi-address wallet\?|Are you sure you want to start again\?)" modal$/,
// eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars
Expand All @@ -115,10 +92,6 @@ When(
}
);

Given(/^I click "Restore" button and confirm$/, async () => {
await OnboardingMainPage.restoreWalletButton.click();
});

When(/^I enter wallet name: "([^"]*)"$/, async (walletName: string) => {
await OnboardingWalletSetupPage.setWalletNameInput(walletName === 'empty' ? '' : walletName);
});
Expand All @@ -128,10 +101,6 @@ When(/^I enter wallet name with size of: ([^"]*) characters$/, async (numberOfCh
await OnboardingWalletSetupPage.setWalletNameInput(walletName);
});

Then(/^Name error "([^"]*)" is displayed/, async (nameError: string) => {
await OnboardingWalletSetupPageAssert.assertSeeWalletNameError(await t(nameError));
});

Then(
// eslint-disable-next-line max-len
/^Password recommendation: "([^"]*)", complexity bar level: "(\d{0,4})" and password confirmation error: "([^"]*)" are displayed$/,
Expand Down Expand Up @@ -168,10 +137,6 @@ Then(/^I click Trezor wallet icon$/, async () => {
await OnboardingConnectHardwareWalletPage.trezorButton.click();
});

Then(/^"Restoring a multi-address wallet\?" modal is displayed$/, async () => {
await ModalAssert.assertSeeRestoringMultiAddressWalletModal();
});

Then(/^I clear saved words$/, async () => {
mnemonicWordsForReference.length = 0;
});
Expand Down Expand Up @@ -220,7 +185,7 @@ Then(/^I see following autocomplete options:$/, async (options: DataTable) => {
await onboardingRecoveryPhrasePageAssert.assertSeeMnemonicAutocompleteOptions(dataTableAsStringArray(options));
});

Then(/^I click header to loose focus$/, async () => {
Then(/^I click header to lose focus$/, async () => {
await RecoveryPhrasePage.clickHeaderToLoseFocus();
});

Expand All @@ -247,10 +212,6 @@ Then(/^the word in mnemonic input has only ([^"]*) characters$/, async (expected
await onboardingRecoveryPhrasePageAssert.assertMnemonicInputLength(0, Number(expectedLength));
});

When(/^I click on Privacy Policy link$/, async () => {
await OnboardingAnalyticsPage.privacyPolicyLinkWithinDescription.click();
});

When(
/^I click on "(Cookie policy|Privacy policy|Terms of service)" legal link(?: on "(Main page)")?$/,
async (link: 'Cookie policy' | 'Privacy policy' | 'Terms of service', page?: 'Main page') => {
Expand Down

0 comments on commit eaa6342

Please sign in to comment.