diff --git a/apps/idos-sdk-e2e/tests/01-evm-auth.spec.ts b/apps/idos-sdk-e2e/tests/01-evm-auth.spec.ts index b1b62615f..41ada30c4 100644 --- a/apps/idos-sdk-e2e/tests/01-evm-auth.spec.ts +++ b/apps/idos-sdk-e2e/tests/01-evm-auth.spec.ts @@ -23,7 +23,7 @@ test("should login successfully with an EVM wallet", async ({ await page.getByRole("button", { name: "Connect a wallet" }).click(); await page.getByRole("button", { name: "Metamask" }).first().click(); - await metamask.connectToDapp(); + await metamask.connectToDapp(["Pristine"]); await page.waitForTimeout(2000); await metamask.confirmSignature(); diff --git a/apps/idos-sdk-e2e/tests/02-data.spec.ts b/apps/idos-sdk-e2e/tests/02-data.spec.ts index 9c706f715..a22e40fb4 100644 --- a/apps/idos-sdk-e2e/tests/02-data.spec.ts +++ b/apps/idos-sdk-e2e/tests/02-data.spec.ts @@ -22,11 +22,9 @@ test("should fetch credentials successfully", async ({ }) => { const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); await page.goto("/"); - await page.getByRole("button", { name: "Connect a wallet" }).click(); await page.getByRole("button", { name: "Metamask" }).first().click(); - - await metamask.connectToDapp(); + await metamask.connectToDapp(["Pristine"]); await page.waitForTimeout(2000); await metamask.confirmSignature(); @@ -41,11 +39,11 @@ test("should fetch wallets successfully", async ({ context, page, metamaskPage, await page.getByRole("button", { name: "Connect a wallet" }).click(); await page.getByRole("button", { name: "Metamask" }).first().click(); - await metamask.connectToDapp(); + await metamask.connectToDapp(["Pristine"]); await page.waitForTimeout(2000); await metamask.confirmSignature(); - const list = await page.locator("#wallets-list"); + const list = page.locator("#wallets-list"); await expect(list.getByRole("listitem")).toHaveCount(1); const address = await metamask.getAccountAddress(); await expect(list.getByRole("listitem").first().locator("p").last()).toHaveText( @@ -59,29 +57,32 @@ test("should add / delete a wallet successfully", async ({ metamaskPage, extensionId, }) => { - await page.goto("/wallets"); const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); + await page.goto("/"); await page.getByRole("button", { name: "Connect a wallet" }).click(); await page.getByRole("button", { name: "Metamask" }).first().click(); - await metamask.connectToDapp(); + await metamask.connectToDapp(["Pristine"]); await page.waitForTimeout(2000); await metamask.confirmSignature(); + await page.waitForTimeout(2000); - const list = await page.locator("#wallets-list"); + await page.goto("/wallets"); // Testing wallet addition const addWalletButton = page.locator("#add-wallet-button"); await addWalletButton.click(); await page.locator("#address").fill(TEST_WALLET_ADDRESS); await page.locator("#add-wallet-form-submit").click(); + await page.waitForTimeout(3000); await metamask.confirmSignature(); - await page.waitForTimeout(5000); - await expect(list.getByRole("listitem")).toHaveCount(2); + await page.waitForTimeout(10000); + const list = await page.locator("#wallets-list"); + await expect(list.getByRole("listitem")).toHaveCount(2); // Testing wallet deletion - const deleteButton = list.locator(`#delete-wallet-${TEST_WALLET_ADDRESS}`); + const deleteButton = await list.locator(`#delete-wallet-${TEST_WALLET_ADDRESS}`); await deleteButton.click(); await page.locator(`#confirm-delete-wallet-${TEST_WALLET_ADDRESS}`).click(); await metamask.confirmSignature(); diff --git a/apps/idos-sdk-e2e/tests/03-enclave.spec.ts b/apps/idos-sdk-e2e/tests/03-enclave.spec.ts index 5e57709fa..850a6f310 100644 --- a/apps/idos-sdk-e2e/tests/03-enclave.spec.ts +++ b/apps/idos-sdk-e2e/tests/03-enclave.spec.ts @@ -23,8 +23,7 @@ test("should decrypt a credential successfully", async ({ const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); await page.getByRole("button", { name: "Connect a wallet" }).click(); await page.getByRole("button", { name: "Metamask" }).first().click(); - - await metamask.connectToDapp(); + await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(2000); await metamask.confirmSignature(); await page.waitForTimeout(2000); @@ -41,8 +40,9 @@ test("should decrypt a credential successfully", async ({ await passwordInput.fill("qwerty"); await idOSPopup.getByRole("button", { name: "Unlock" }).click(); + await page.waitForTimeout(4000); - const code = await page.locator("#credential-details"); + const code = await page.locator("#credential-details") expect(code).toHaveText(credentialContent); }); @@ -53,14 +53,16 @@ test("should filter credentials by country successfully", async ({ extensionId, }) => { const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); - await page.goto("e2e/credential-filtering-by-country"); - await metamask.connectToDapp(); + await page.getByRole("button", { name: "Connect a wallet" }).click(); + await page.getByRole("button", { name: "Metamask" }).first().click(); + await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(2000); await metamask.confirmSignature(); await page.waitForTimeout(2000); + await page.goto("e2e/credential-filtering-by-country"); + await page.waitForTimeout(2000); - await page.getByRole("button", { name: "View details" }).first().click(); const idOSButton = await page.frameLocator("#idos-enclave-iframe").locator("#unlock"); await idOSButton.click(); const popupPromise = await page.waitForEvent("popup");