From ec6ed690881332bd75ec14509eeee19eedef3de3 Mon Sep 17 00:00:00 2001 From: Mohammed-Mamoun98 Date: Wed, 20 Nov 2024 19:19:16 +0200 Subject: [PATCH] pick the first found mm button --- apps/idos-sdk-e2e/tests/01-evm-auth.spec.ts | 4 ++-- apps/idos-sdk-e2e/tests/02-data.spec.ts | 6 +++--- apps/idos-sdk-e2e/tests/03-enclave.spec.ts | 4 ++-- apps/idos-sdk-e2e/tests/04-grants.spec.ts | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) 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 42a7f0447..6a57f8abd 100644 --- a/apps/idos-sdk-e2e/tests/01-evm-auth.spec.ts +++ b/apps/idos-sdk-e2e/tests/01-evm-auth.spec.ts @@ -19,7 +19,7 @@ test("should login successfully with an EVM wallet", 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 installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.connectToDapp(["Pristine"]); await page.waitForTimeout(2000); await expect(page.locator("#disconnect-wallet-btn")).toBeVisible(); @@ -33,7 +33,7 @@ test("should set successfully an EVM signer", 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 installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(2000); diff --git a/apps/idos-sdk-e2e/tests/02-data.spec.ts b/apps/idos-sdk-e2e/tests/02-data.spec.ts index fa2ddac6b..b4d5d73b8 100644 --- a/apps/idos-sdk-e2e/tests/02-data.spec.ts +++ b/apps/idos-sdk-e2e/tests/02-data.spec.ts @@ -22,7 +22,7 @@ test("should fetch credentials 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 installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(2000); @@ -35,7 +35,7 @@ test("should fetch wallets successfully", async ({ context, page, metamaskPage, await page.goto("/wallets"); const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); await page.getByRole("button", { name: "Connect a wallet" }).click(); - await page.getByRole("button", { name: "MetaMask installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(3000); @@ -57,7 +57,7 @@ test("should add / delete a wallet successfully", async ({ await page.goto("/wallets"); const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); await page.getByRole("button", { name: "Connect a wallet" }).click(); - await page.getByRole("button", { name: "MetaMask installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(3000); diff --git a/apps/idos-sdk-e2e/tests/03-enclave.spec.ts b/apps/idos-sdk-e2e/tests/03-enclave.spec.ts index 8f100a247..9a329f4a2 100644 --- a/apps/idos-sdk-e2e/tests/03-enclave.spec.ts +++ b/apps/idos-sdk-e2e/tests/03-enclave.spec.ts @@ -22,7 +22,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 installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(2000); @@ -52,7 +52,7 @@ test("should filter credentials by country successfully", async ({ await page.goto("e2e/credential-filtering-by-country"); await page.getByRole("button", { name: "Connect a wallet" }).click(); - await page.getByRole("button", { name: "MetaMask installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(2000); diff --git a/apps/idos-sdk-e2e/tests/04-grants.spec.ts b/apps/idos-sdk-e2e/tests/04-grants.spec.ts index 0feaab7ce..6431d7a07 100644 --- a/apps/idos-sdk-e2e/tests/04-grants.spec.ts +++ b/apps/idos-sdk-e2e/tests/04-grants.spec.ts @@ -14,7 +14,7 @@ test.beforeEach(async ({ context, page }) => { test("should create a grant successfully", async ({ context, page, metamaskPage, extensionId }) => { const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); await page.getByRole("button", { name: "Connect a wallet" }).click(); - await page.getByRole("button", { name: "MetaMask installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(2000); @@ -81,7 +81,7 @@ test("should revoke a grant successfully", async ({ context, page, metamaskPage, await page.waitForTimeout(50000); const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); await page.getByRole("button", { name: "Connect a wallet" }).click(); - await page.getByRole("button", { name: "MetaMask installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); @@ -117,7 +117,7 @@ test("should share a matching credential successfully", async ({ await page.goto("/e2e/credential-filtering"); const metamask = new MetaMask(context, metamaskPage, basicSetup.walletPassword, extensionId); await page.getByRole("button", { name: "Connect a wallet" }).click(); - await page.getByRole("button", { name: "MetaMask installed" }).click(); + await page.getByRole("button", { name: "MetaMask" }).first().click(); await metamask.switchAccount("Account 1"); await metamask.connectToDapp(["Account 1"]); await page.waitForTimeout(3000);