From 746e4d2730bc252a31ebb96237baf3aa8cee9f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:36:14 -0600 Subject: [PATCH] add(test): add more tests for import export accounts --- playwright/PageObjects/ImportAccount.ts | 21 +- playwright/PageObjects/MainPage.ts | 7 + playwright/PageObjects/SaveRecoverySeed.ts | 9 +- .../PageObjects/Settings/SettingsProfile.ts | 60 ++- .../PageObjects/Settings/downloads/export.upk | Bin 0 -> 701 bytes playwright/assets/export.upk | Bin 0 -> 1019 bytes playwright/assets/seed-phrase.txt | 1 + playwright/specs/04-import-account.spec.ts | 376 +++++++++++++++++- playwright/specs/07-settings-profile.spec.ts | 2 +- 9 files changed, 443 insertions(+), 33 deletions(-) create mode 100644 playwright/PageObjects/Settings/downloads/export.upk create mode 100644 playwright/assets/export.upk create mode 100644 playwright/assets/seed-phrase.txt diff --git a/playwright/PageObjects/ImportAccount.ts b/playwright/PageObjects/ImportAccount.ts index a743ef2..5b97865 100644 --- a/playwright/PageObjects/ImportAccount.ts +++ b/playwright/PageObjects/ImportAccount.ts @@ -90,7 +90,7 @@ export class ImportAccountPage extends MainPage { async importAccountFromFile( phraseType: "file" | "manual", - importFilePath: string, + backUpFile: string, seedPhrasePath?: string, seedPhrase?: string[], ) { @@ -101,7 +101,7 @@ export class ImportAccountPage extends MainPage { } else { throw new Error("Invalid passphrase type"); } - await this.uploadImportedFile(importFilePath); + await this.uploadImportedFile(backUpFile); } async importAccountFromRemote( @@ -126,7 +126,6 @@ export class ImportAccountPage extends MainPage { } async uploadImportedFile(filePath: string) { - await expect(this.buttonImportAccountFromFile).toHaveClass("enabled"); const fileChooserPromise = this.page.waitForEvent("filechooser"); await this.clickOnImportAccountFromFile(); const fileChooser = await fileChooserPromise; @@ -134,12 +133,24 @@ export class ImportAccountPage extends MainPage { } async uploadSeedPhraseFile(filePath: string) { - await expect(this.buttonImportAccountFromFile).toHaveClass("disabled"); const fileChooserPromise = this.page.waitForEvent("filechooser"); await this.clickOnUploadPassphrase(); const fileChooser = await fileChooserPromise; await fileChooser.setFiles(filePath); - await expect(this.buttonImportAccountFromFile).toHaveClass("enabled"); + } + + async validateToastInvalidPhrase() { + await this.toastNotificationText.waitFor({ state: "attached" }); + await expect(this.toastNotificationText).toHaveText( + "Invalid word in phrase", + ); + } + + async validateToastUnkwnownError() { + await this.toastNotificationText.waitFor({ state: "attached" }); + await expect(this.toastNotificationText).toHaveText( + "An unknown error occurred", + ); } async validatePageIsLoaded() { diff --git a/playwright/PageObjects/MainPage.ts b/playwright/PageObjects/MainPage.ts index eaabcfb..dc22998 100644 --- a/playwright/PageObjects/MainPage.ts +++ b/playwright/PageObjects/MainPage.ts @@ -1,4 +1,5 @@ import { expect, type Locator, type Page } from "@playwright/test"; +import { readFile } from "fs/promises"; const fs = require("fs"); const path = require("path"); export default class MainPage { @@ -288,6 +289,12 @@ export default class MainPage { }); } + async readRecoveryPhraseFile(filePath: string) { + const fileContent = await readFile(filePath, "utf-8"); + const fileSeedPhraseArray = fileContent.split(/\s+/).filter(Boolean); + return fileSeedPhraseArray; + } + async validateNoFavoritesAreVisible() { await this.clickOnShowSidebarIfClosed(); await this.favoriteCircle.waitFor({ state: "detached" }); diff --git a/playwright/PageObjects/SaveRecoverySeed.ts b/playwright/PageObjects/SaveRecoverySeed.ts index abc996e..affc973 100644 --- a/playwright/PageObjects/SaveRecoverySeed.ts +++ b/playwright/PageObjects/SaveRecoverySeed.ts @@ -1,6 +1,5 @@ import MainPage from "./MainPage"; -import { expect, type Locator, type Page } from "@playwright/test"; -import { readFile } from "fs/promises"; +import { type Locator, type Page } from "@playwright/test"; export class SaveRecoverySeedPage extends MainPage { readonly buttonDownloadPhrase: Locator; @@ -58,12 +57,6 @@ export class SaveRecoverySeedPage extends MainPage { return count; } - async readRecoveryPhraseFile(filePath: string) { - const fileContent = await readFile(filePath, "utf-8"); - const fileSeedPhraseArray = fileContent.split(/\s+/).filter(Boolean); - return fileSeedPhraseArray; - } - async saveRecoverySeed() { // Wait for the download event const filename = "seed-phrase.txt"; diff --git a/playwright/PageObjects/Settings/SettingsProfile.ts b/playwright/PageObjects/Settings/SettingsProfile.ts index 52d5199..62beccb 100644 --- a/playwright/PageObjects/Settings/SettingsProfile.ts +++ b/playwright/PageObjects/Settings/SettingsProfile.ts @@ -1,5 +1,7 @@ import { expect, type Locator, type Page } from "@playwright/test"; import { SettingsBase } from "./SettingsBase"; +const fs = require("fs"); +const path = require("path"); export class SettingsProfile extends SettingsBase { readonly accountIntegrations: Locator; @@ -37,6 +39,11 @@ export class SettingsProfile extends SettingsBase { readonly deleteAccountSectionButton: Locator; readonly deleteAccountSectionLabel: Locator; readonly deleteAccountSectionText: Locator; + readonly exportAccountSection: Locator; + readonly exportAccountSectionLabel: Locator; + readonly exportAccountSectionText: Locator; + readonly exportAccountSectionFileButton: Locator; + readonly exportAccountSectionRemoteButton: Locator; readonly identiconSettingsProfile: Locator; readonly inputSettingsProfileShortID: Locator; readonly inputSettingsProfileShortIDGroup: Locator; @@ -201,6 +208,18 @@ export class SettingsProfile extends SettingsBase { this.deleteAccountSectionText = this.deleteAccountSection.getByTestId( "setting-section-text", ); + this.exportAccountSection = this.page.getByTestId("export-account"); + this.exportAccountSectionLabel = this.exportAccountSection.getByTestId( + "setting-section-label", + ); + this.exportAccountSectionText = this.exportAccountSection.getByTestId( + "setting-section-text", + ); + this.exportAccountSectionFileButton = this.exportAccountSection.getByTestId( + "export-account-file", + ); + this.exportAccountSectionRemoteButton = + this.exportAccountSection.getByTestId("export-account-remote"); this.identiconSettingsProfile = this.page .locator(".identicon") .locator("img"); @@ -329,12 +348,39 @@ export class SettingsProfile extends SettingsBase { ); } - // Rewrite everything here in playwright - async copyShortID() { await this.inputSettingsProfileShortIDGroup.click(); } + async deleteAccount() { + await this.deleteAccountSectionButton.click(); + } + + async exportAccountToFile() { + const downloadPath = path.join(__dirname, "downloads"); + if (!fs.existsSync(downloadPath)) { + fs.mkdirSync(downloadPath); + } + + const downloadPromise = this.page.waitForEvent("download"); + await this.exportAccountSectionFileButton.click(); + const download = await downloadPromise; + + const fileName = download.suggestedFilename(); // Get the suggested filename + const filePath = path.join(downloadPath, fileName); + await download.saveAs(filePath); // Save the file to the designated path + + // Validate the downloaded file + expect(fs.existsSync(filePath)).toBeTruthy(); // Check file exists + expect([".upk"]).toContain(path.extname(fileName)); // Validate file extension + } + + async exportAccountToRemote() { + await this.exportAccountSectionRemoteButton.click(); + await this.validateToastSuccessRemoteExport(); + await this.waitForToastNotificationToDisappear(); + } + async getProfileIdenticonSource() { const source = await this.identiconSettingsProfile.getAttribute("src"); return source; @@ -517,6 +563,16 @@ export class SettingsProfile extends SettingsBase { await expect(this.toastNotificationText).toHaveText("Profile Updated!"); } + async validateToastSuccessRemoteExport() { + await this.toastNotification.waitFor({ state: "attached" }); + const textToast = this.toastNotification.getByText( + "Successfully exported account to remote", + ); + await expect(textToast).toHaveText( + "Successfully exported account to remote", + ); + } + async uploadProfileBanner(file: string) { await this.profileBanner.click(); await this.profileBannerInput.setInputFiles(file); diff --git a/playwright/PageObjects/Settings/downloads/export.upk b/playwright/PageObjects/Settings/downloads/export.upk new file mode 100644 index 0000000000000000000000000000000000000000..4f75023443c77d2a7e07b169b995d2ccd997ed07 GIT binary patch literal 701 zcmV;u0z&=CC^Pd4(=HY0vu4>F4o2{j$;!|9v7$Ic?@FKx3h8mulvGc@*%+f_=c6>oqVA z0;XkM!l~;Ey*Du1=WRJb)-$ZCIu1mJmjyP?pj#!*C9Vma)-MvPo6SIxia>Tdn4HN$ zhY5l&mTS$1xCp4a$hUVqIZyT{<1wb(l~p-{4PEQcrR*Or5*_n^V2%gd2JLX9@&VgRE zWM(W-1ggQKk{10nnhI9jSYaJi*@EM-3u}Z7?upfdm^HQyYBmZ%Lq9?TIHcZ&+PDS( z7!rw9sD_C%*G%j%iHd<35iq~Yyz3sQ^n#>!dh$(a=P2N)Ci@(zw>O9BmK3c}U+tn^oF z$!B(Sl>ClNO+JjZm>LJuqeYop!(PkqGwxEU)bEmj4b~cKQ88Yv*8nf5KuJ37Gj`%R zh-e{~PWpVL!nPfehNM}lHO49>!a2!pKN=X}D*SFQA@DZIyxS-mbLQQGV+<4%Xp#ag zV{H0-#&TWAQ*eV@K9x0Qv>7zt!e%Sic2T(m$Co*qqVyR3SkP)KKEmrwcLEfCptzBg=0Fq!~i>&_S7FofpFH@Ky9`71Mt`!mRdCgu+uk>+M$q9COL>}~ zYxCl);w#P5UnY@cNeF&Z!A%Jh+0LaEw6?q*E2S1bG9_v#C)7y$VB+UU8$DzQ1z{-; z)=V^zhVyWaSg8VsRuaYS@jHF#qL(TpG^B^aOyeN#{sx?^VE!2GK(}|x3;Rte zOs}j`!Hxm+;cBV0Bj0Ht|l?9@zUV2X%cJwj82)8xFy z(rq__e|W`T&>5?rg`0diE-eVnwz7(c;C~X%FoVDG-8NRXlrVK$)ww?q^tb^7-MRY& zUA!Ulh;zL=HnCeE?zS+%HzA>E!_+;qac1rFQ1qCtnEiWwXkD41Uw46jvHg2jZu-qy zw4a=-mU->p6w^+uqt8lAmq}LZ?D^;DWkHzW#g2<74yrefr&@a zJFB*vk!hwD8tB3X$nkMT!;2SihAF12`bC|^_ZChk5$NYt=MWd5GMVL z^AZS1oKUIt>FtWzx? { - test("U1 - Import Account - Negative Input tests, go back and scramble keypad", async ({ + test("U1 to U6 - Import Account - Negative Input tests, go back and scramble keypad", async ({ enterPinUserContext, }) => { const page = enterPinUserContext.page; @@ -18,6 +24,10 @@ test.describe("Import Account Tests", () => { await createOrImport.clickImportAccount(); }); + await test.step("Dismiss installer download banner", async () => { + await createOrImport.dismissDownloadAlert(); + }); + await test.step("Enter valid PIN", async () => { await loginPinPage.enterDefaultPin(); }); @@ -54,7 +64,7 @@ test.describe("Import Account Tests", () => { ); }); - await test.step("PIN should have at least 3 digits otherwise continue button is disabled", async () => { + await test.step("PIN should have at least 4 digits otherwise continue button is disabled", async () => { await loginPinPage.enterPin("123"); await loginPinPage.validateConfirmButtonIsDisabled(); }); @@ -72,31 +82,363 @@ test.describe("Import Account Tests", () => { }); }); - test.skip("U2 - Import Account - Seed phrase from file", async ({ + test("U7, U10 - Import Account From File Backup - Seed phrase from file", async ({ enterPinUserContext, - }) => {}); + }) => { + const page = enterPinUserContext.page; + const viewport = enterPinUserContext.viewport; + const chatsPage = new ChatsMainPage(page, viewport); + const createOrImport = new CreateOrImportPage(page, viewport); + const importAccount = new ImportAccountPage(page, viewport); + const loginPinPage = new LoginPinPage(page, viewport); - test.skip("U3 - Import Account - Seed phrase entered manually", async ({ - enterPinUserContext, - }) => {}); + await test.step("Validate Create or Import Page is displayed and then click on Import Account", async () => { + await createOrImport.validatePageIsDisplayed(); + await createOrImport.clickImportAccount(); + }); - test.skip("U4 - Import Account - Provide wrong seed phrase", async ({ + await test.step("Dismiss installer download banner", async () => { + await createOrImport.dismissDownloadAlert(); + }); + + await test.step("Enter valid PIN", async () => { + await loginPinPage.enterDefaultPin(); + }); + + await test.step("Import account using a seed phrase from file", async () => { + await importAccount.validatePageIsLoaded(); + await importAccount.importAccountFromFile( + "file", + "playwright/assets/export.upk", + "playwright/assets/seed-phrase.txt", + ); + }); + + await test.step("After succesful import from file, user is redirected to chats page", async () => { + await page.waitForURL("/chat"); + await chatsPage.validateChatsMainPageIsShown(); + }); + }); + + test("U8, U10 - Import Account From File Backup - Seed phrase entered manually", async ({ enterPinUserContext, - }) => {}); + }) => { + const page = enterPinUserContext.page; + const viewport = enterPinUserContext.viewport; + const chatsPage = new ChatsMainPage(page, viewport); + const createOrImport = new CreateOrImportPage(page, viewport); + const importAccount = new ImportAccountPage(page, viewport); + const loginPinPage = new LoginPinPage(page, viewport); + + await test.step("Validate Create or Import Page is displayed and then click on Import Account", async () => { + await createOrImport.validatePageIsDisplayed(); + await createOrImport.clickImportAccount(); + }); - test.skip("U5 - Import Account - Import account from File", async ({ + await test.step("Dismiss installer download banner", async () => { + await createOrImport.dismissDownloadAlert(); + }); + + await test.step("Enter valid PIN", async () => { + await loginPinPage.enterDefaultPin(); + }); + + await test.step("Import account entering seed phrase manually ", async () => { + await importAccount.validatePageIsLoaded(); + const recoverySeedArray = await importAccount.readRecoveryPhraseFile( + "playwright/assets/seed-phrase.txt", + ); + await importAccount.importAccountFromFile( + "manual", + "playwright/assets/export.upk", + "", + recoverySeedArray, + ); + }); + + await test.step("After succesful import entering seed phrase manually, user is redirected to chats page", async () => { + await page.waitForURL("/chat"); + await chatsPage.validateChatsMainPageIsShown(); + }); + }); + + test("U9 - Import Account - Provide wrong seed phrase", async ({ enterPinUserContext, - }) => {}); + }) => { + const page = enterPinUserContext.page; + const viewport = enterPinUserContext.viewport; + const createOrImport = new CreateOrImportPage(page, viewport); + const importAccount = new ImportAccountPage(page, viewport); + const loginPinPage = new LoginPinPage(page, viewport); + + await test.step("Validate Create or Import Page is displayed and then click on Import Account", async () => { + await createOrImport.validatePageIsDisplayed(); + await createOrImport.clickImportAccount(); + }); + + await test.step("Dismiss installer download banner", async () => { + await createOrImport.dismissDownloadAlert(); + }); + + await test.step("Enter valid PIN", async () => { + await loginPinPage.enterDefaultPin(); + }); + + await test.step("Import account entering seed phrase manually ", async () => { + await importAccount.validatePageIsLoaded(); + let invalidRecoverySeedArray = await importAccount.readRecoveryPhraseFile( + "playwright/assets/seed-phrase.txt", + ); + invalidRecoverySeedArray[invalidRecoverySeedArray.length - 1] = "invalid"; + await importAccount.importAccountFromFile( + "manual", + "playwright/assets/export.upk", + "", + invalidRecoverySeedArray, + ); + }); - test.skip("U6 - Import Account - Import account from Remote", async ({ + await test.step("Validate toast notification for wrong phrase is shown", async () => { + await importAccount.validateToastInvalidPhrase(); + }); + }); + + test("U11 - Import Account - Import account from Remote", async ({ enterPinUserContext, - }) => {}); + }) => { + const page = enterPinUserContext.page; + const viewport = enterPinUserContext.viewport; + const createOrImport = new CreateOrImportPage(page, viewport); + const importAccount = new ImportAccountPage(page, viewport); + const loginPinPage = new LoginPinPage(page, viewport); + + await test.step("Validate Create or Import Page is displayed and then click on Import Account", async () => { + await createOrImport.validatePageIsDisplayed(); + await createOrImport.clickImportAccount(); + }); + + await test.step("Dismiss installer download banner", async () => { + await createOrImport.dismissDownloadAlert(); + }); + + await test.step("Enter valid PIN", async () => { + await loginPinPage.enterDefaultPin(); + }); + + await test.step("Import account from remote by entering seed phrase manually ", async () => { + await importAccount.validatePageIsLoaded(); + const recoverySeedArray = await importAccount.readRecoveryPhraseFile( + "playwright/assets/seed-phrase.txt", + ); + await importAccount.importAccountFromRemote( + "manual", + "", + recoverySeedArray, + ); + }); + + await test.step("Since remote import is not implemented yet a toast notification for unknown error is shown", async () => { + await importAccount.validateToastUnkwnownError(); + }); + }); - test.skip("U7 - Export Account - Export account to File", async ({ + test("U12 - Export Account - Export account to File", async ({ enterPinUserContext, - }) => {}); + }) => { + const page = enterPinUserContext.page; + const viewport = enterPinUserContext.viewport; + const authNewAccount = new AuthNewAccount(page, viewport); + const chatsPage = new ChatsMainPage(page, viewport); + const createOrImport = new CreateOrImportPage(page, viewport); + const deleteAccount = new DeleteAccountModal(page, viewport); + const importAccount = new ImportAccountPage(page, viewport); + const loginPinPage = new LoginPinPage(page, viewport); + const saveRecoverySeed = new SaveRecoverySeedPage(page, viewport); + const settingsProfile = new SettingsProfile(page, viewport); + const username = + faker.person.firstName() + faker.number.int({ min: 100, max: 10000 }); + const status = faker.lorem.sentence(3); + + await test.step("Validate Create or Import Page is shown and then click on Create New Account", async () => { + await createOrImport.validatePageIsDisplayed(); + await createOrImport.clickCreateNewAccount(); + }); - test.skip("U8 - Export Account - Export account to Remote", async ({ + await test.step("Enter username and status and continue", async () => { + await authNewAccount.validateLoadingHeader(); + await authNewAccount.typeOnUsername(username); + await authNewAccount.typeOnStatus(status); + await authNewAccount.buttonNewAccountCreate.click(); + }); + + await test.step("Enter a valid pin and continue", async () => { + await loginPinPage.waitUntilPageIsLoaded(); + await loginPinPage.enterDefaultPin(); + }); + + await test.step("Save Recovery Seed file and continue", async () => { + await saveRecoverySeed.validatePageIsLoaded(); + await saveRecoverySeed.saveRecoverySeed(); + await saveRecoverySeed.clickOnSavedIt(); + }); + + await test.step("Go to settings profile", async () => { + // Once that user is in Chats page, go to Settings Profile + await page.waitForURL("/chat"); + await chatsPage.goToSettings(); + await page.waitForURL("/settings/profile"); + + // Hide sidebar if viewport is Mobile Chrome + if (viewport === "mobile-chrome") { + await chatsPage.buttonHideSidebar.click(); + } + }); + + await test.step("Validate Export Account Section contents", async () => { + await expect(settingsProfile.exportAccountSectionLabel).toHaveText( + "Export", + ); + await expect(settingsProfile.exportAccountSectionText).toHaveText( + "Export your account manually to remote or a file", + ); + }); + + await test.step("Validate user can export account to file", async () => { + await settingsProfile.exportAccountToFile(); + }); + + await test.step("Now Delete the Account so it can be restored from remote", async () => { + await settingsProfile.deleteAccount(); + await deleteAccount.enterDefaultPin(); + await createOrImport.validatePageIsDisplayed(); + }); + + await test.step("Validate Create or Import Page is displayed and then click on Import Account", async () => { + await createOrImport.validatePageIsDisplayed(); + await createOrImport.clickImportAccount(); + }); + + await test.step("Dismiss installer download banner", async () => { + await createOrImport.dismissDownloadAlert(); + }); + + await test.step("Enter valid PIN", async () => { + await loginPinPage.enterDefaultPin(); + }); + + await test.step("Import account using a seed phrase from file", async () => { + await importAccount.validatePageIsLoaded(); + await importAccount.importAccountFromFile( + "file", + "./downloads/export.upk", + "./downloads/seed-phrase.txt", + ); + }); + + await test.step("After succesful import from file, user is redirected to chats page", async () => { + await page.waitForURL("/chat"); + await chatsPage.validateChatsMainPageIsShown(); + }); + }); + + test("U13 - Export Account - Export account to Remote", async ({ enterPinUserContext, - }) => {}); + }) => { + const page = enterPinUserContext.page; + const viewport = enterPinUserContext.viewport; + const authNewAccount = new AuthNewAccount(page, viewport); + const chatsMainPage = new ChatsMainPage(page, viewport); + const createOrImport = new CreateOrImportPage(page, viewport); + const deleteAccount = new DeleteAccountModal(page, viewport); + const importAccount = new ImportAccountPage(page, viewport); + const loginPinPage = new LoginPinPage(page, viewport); + const saveRecoverySeed = new SaveRecoverySeedPage(page, viewport); + const settingsProfile = new SettingsProfile(page, viewport); + const username = + faker.person.firstName() + faker.number.int({ min: 100, max: 10000 }); + const status = faker.lorem.sentence(3); + + await test.step("Validate Create or Import Page is shown and then click on Create New Account", async () => { + await createOrImport.validatePageIsDisplayed(); + await createOrImport.clickCreateNewAccount(); + }); + + await test.step("Enter username and status and continue", async () => { + await authNewAccount.validateLoadingHeader(); + await authNewAccount.typeOnUsername(username); + await authNewAccount.typeOnStatus(status); + await authNewAccount.buttonNewAccountCreate.click(); + }); + + await test.step("Enter a valid pin and continue", async () => { + await loginPinPage.waitUntilPageIsLoaded(); + await loginPinPage.enterDefaultPin(); + }); + + await test.step("Save Recovery Seed file and continue", async () => { + await saveRecoverySeed.validatePageIsLoaded(); + await saveRecoverySeed.saveRecoverySeed(); + await saveRecoverySeed.clickOnSavedIt(); + }); + + await test.step("Go to settings profile", async () => { + // Once that user is in Chats page, go to Settings Profile + await page.waitForURL("/chat"); + await chatsMainPage.goToSettings(); + await page.waitForURL("/settings/profile"); + + // Hide sidebar if viewport is Mobile Chrome + if (viewport === "mobile-chrome") { + await chatsMainPage.buttonHideSidebar.click(); + } + }); + + await test.step("Validate Export Account Section contents", async () => { + await expect(settingsProfile.exportAccountSectionLabel).toHaveText( + "Export", + ); + await expect(settingsProfile.exportAccountSectionText).toHaveText( + "Export your account manually to remote or a file", + ); + }); + + await test.step("Validate user can export account to remote", async () => { + await settingsProfile.exportAccountToRemote(); + }); + + await test.step("Now Delete the Account so it can be restored from remote", async () => { + await settingsProfile.deleteAccount(); + await deleteAccount.enterDefaultPin(); + await createOrImport.validatePageIsDisplayed(); + }); + + await test.step("Validate Create or Import Page is displayed and then click on Import Account", async () => { + await createOrImport.validatePageIsDisplayed(); + await createOrImport.clickImportAccount(); + }); + + await test.step("Dismiss installer download banner", async () => { + await createOrImport.dismissDownloadAlert(); + }); + + await test.step("Enter valid PIN", async () => { + await loginPinPage.enterDefaultPin(); + }); + + await test.step("Import account from remote by entering seed phrase manually ", async () => { + await importAccount.validatePageIsLoaded(); + const recoverySeedArray = await importAccount.readRecoveryPhraseFile( + "./downloads/assets/seed-phrase.txt", + ); + await importAccount.importAccountFromRemote( + "manual", + "", + recoverySeedArray, + ); + }); + + await test.step("Since remote import is not implemented yet a toast notification for unknown error is shown", async () => { + await importAccount.validateToastUnkwnownError(); + }); + }); }); diff --git a/playwright/specs/07-settings-profile.spec.ts b/playwright/specs/07-settings-profile.spec.ts index 78802e1..87903fc 100644 --- a/playwright/specs/07-settings-profile.spec.ts +++ b/playwright/specs/07-settings-profile.spec.ts @@ -591,7 +591,7 @@ test.describe("Settings Profile Tests", () => { }); await test.step("Click on Delete Account button and validate contents from modal prompt", async () => { - await settingsProfile.deleteAccountSectionButton.click(); + await settingsProfile.deleteAccount(); await expect(deleteAccount.textDeleteAccount).toHaveText( "This action will delete your account permanently", );