Skip to content
Merged
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"branches": [
"main",
{
"name": "anvil-logs",
"channel": "mm-disable-st",
"prerelease": "mm-disable-st"
"name": "develop",
"channel": "alpha",
"prerelease": "alpha"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ export class MetamaskPage implements WalletPage<WalletConnectTypes.EOA> {
await this.navigate();
if (!(await this.header.accountMenuButton.isVisible())) {
await this.onboardingPage.firstTimeSetup();
await this.loginPage.unlock();
await this.popoverElements.closePopover();
await this.popoverElements.closeConnectingProblemPopover();
await this.walletOperation.cancelAllTxInQueue(); // reject all tx in queue if exist
await this.navigate();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class OnboardingPage {
importWalletOptionBtn: Locator;
metricAgreeButton: Locator;
secretPhraseTextArea: Locator;
clearSecretPhraseButton: Locator;
secretPhraseImportButton: Locator;
createPasswordInput: Locator;
confirmPasswordInput: Locator;
Expand Down Expand Up @@ -41,6 +42,9 @@ export class OnboardingPage {
this.secretPhraseTextArea = this.page.getByTestId(
'srp-input-import__srp-note',
);
this.clearSecretPhraseButton = this.page.getByRole('button', {
name: 'Clear all',
});
this.secretPhraseImportButton = this.page.getByTestId('import-srp-confirm');
this.createPasswordInput = this.page.getByTestId(
'create-password-new-input',
Expand All @@ -62,17 +66,35 @@ export class OnboardingPage {
await this.iHaveExistingWalletButton.click();
await this.importWalletOptionBtn.click();
await this.fillSecretPhrase(this.accountConfig.SECRET_PHRASE);
await this.secretPhraseImportButton.click();
await this.createPassword(this.accountConfig.PASSWORD);
await this.metricAgreeButton.click();
await this.completeButton.click();
await this.page.waitForURL('**/home.html#');
await this.page.close();
});
}

async fillSecretPhrase(secretPhrase: string) {
await test.step('Fill onboarding secret phrase field', async () => {
await this.secretPhraseTextArea.pressSequentially(secretPhrase);
let attempts = 3;
while (attempts >= 0) {
attempts--;

await this.secretPhraseTextArea.pressSequentially(secretPhrase, {
delay: 10,
});

if (await this.secretPhraseImportButton.isDisabled()) {
await this.clearSecretPhraseButton.click();
if (attempts == 0)
throw new Error(
'Failed to fill the secret phrase after 3 attempts',
);
continue;
}

await this.secretPhraseImportButton.click();
break;
}
});
}

Expand Down
Loading