From 9fadd2151c8acdf3a2bc049277a63182b00ec5b7 Mon Sep 17 00:00:00 2001 From: Michalina Date: Thu, 22 Jun 2023 11:58:59 +0200 Subject: [PATCH 1/3] Change expected account name in NFTs tests to ENS domain We have configured a ENS name for the `0x6f1b1f1feb01235e15a7962f16c389c7f8218ed6` address. We need to update the tests to reflect that. --- e2e-tests/nfts.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/nfts.spec.ts b/e2e-tests/nfts.spec.ts index 45daf73aaf..722fad2329 100644 --- a/e2e-tests/nfts.spec.ts +++ b/e2e-tests/nfts.spec.ts @@ -80,7 +80,7 @@ test.describe("NFTs", () => { await page .getByTestId("nft_account_filters") .filter({ - hasText: /^(Phoenix|Matilda|Sirius|Topa|Atos|Sport|Lola|Foz)$/, + hasText: /^e2e\.testertesting\.eth$/, }) .getByRole("checkbox") .click() @@ -107,7 +107,7 @@ test.describe("NFTs", () => { .getByTestId("nft_account_filters") .getByTestId("toggle_item") .filter({ - hasText: /^(Phoenix|Matilda|Sirius|Topa|Atos|Sport|Lola|Foz)$/, + hasText: /^e2e\.testertesting\.eth$/, }) .getByRole("checkbox") .click() From b270c295d7307fd351ff3c456bb316840929b308 Mon Sep 17 00:00:00 2001 From: Michalina Date: Thu, 22 Jun 2023 13:44:46 +0200 Subject: [PATCH 2/3] Parametrize account name We're adding a `const` variable for the account name so that we can reuse it easily. --- e2e-tests/nfts.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e-tests/nfts.spec.ts b/e2e-tests/nfts.spec.ts index 722fad2329..f5cbd5e9a5 100644 --- a/e2e-tests/nfts.spec.ts +++ b/e2e-tests/nfts.spec.ts @@ -75,12 +75,14 @@ test.describe("NFTs", () => { }) await test.step("Filtering accounts", async () => { + const accountName = /^e2e\.testertesting\.eth$/ + await page.getByRole("button", { name: "Filter collections" }).click() await page .getByTestId("nft_account_filters") .filter({ - hasText: /^e2e\.testertesting\.eth$/, + hasText: accountName, }) .getByRole("checkbox") .click() @@ -107,7 +109,7 @@ test.describe("NFTs", () => { .getByTestId("nft_account_filters") .getByTestId("toggle_item") .filter({ - hasText: /^e2e\.testertesting\.eth$/, + hasText: accountName, }) .getByRole("checkbox") .click() From 5821c559d022ae7265adcbb8458df79c643f9d77 Mon Sep 17 00:00:00 2001 From: Michalina Date: Thu, 22 Jun 2023 16:05:20 +0200 Subject: [PATCH 3/3] Parametrize account-related data and move to utils We're moving the account address and name to `utils`, so that they could be easily reused in other tests. We're numering the account, as likely there will be more acounts used in tests (different accounts may be needed for different purposes). --- e2e-tests/nfts.spec.ts | 11 ++++------- e2e-tests/utils/onboarding.ts | 4 ++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/e2e-tests/nfts.spec.ts b/e2e-tests/nfts.spec.ts index f5cbd5e9a5..edf18b3085 100644 --- a/e2e-tests/nfts.spec.ts +++ b/e2e-tests/nfts.spec.ts @@ -1,5 +1,6 @@ import { wait } from "@tallyho/tally-background/lib/utils" import { test, expect } from "./utils" +import { account1Address, account1Name } from "./utils/onboarding" test.describe("NFTs", () => { test("User can view nft collections, poaps and badges", async ({ @@ -36,9 +37,7 @@ test.describe("NFTs", () => { } }) - await walletPageHelper.onboarding.addReadOnlyAccount( - "0x6f1b1f1feb01235e15a7962f16c389c7f8218ed6" - ) + await walletPageHelper.onboarding.addReadOnlyAccount(account1Address) await walletPageHelper.goToStartPage() await walletPageHelper.setViewportSize() @@ -75,14 +74,12 @@ test.describe("NFTs", () => { }) await test.step("Filtering accounts", async () => { - const accountName = /^e2e\.testertesting\.eth$/ - await page.getByRole("button", { name: "Filter collections" }).click() await page .getByTestId("nft_account_filters") .filter({ - hasText: accountName, + hasText: account1Name, }) .getByRole("checkbox") .click() @@ -109,7 +106,7 @@ test.describe("NFTs", () => { .getByTestId("nft_account_filters") .getByTestId("toggle_item") .filter({ - hasText: accountName, + hasText: account1Name, }) .getByRole("checkbox") .click() diff --git a/e2e-tests/utils/onboarding.ts b/e2e-tests/utils/onboarding.ts index c622272d48..f4947644b5 100644 --- a/e2e-tests/utils/onboarding.ts +++ b/e2e-tests/utils/onboarding.ts @@ -25,6 +25,10 @@ export const getOnboardingPage = async ( } const DEFAULT_PASSWORD = "12345678" +// The account1 is a 3rd address associated with the testertesting.eth account. +// It owns some NFTs/badges. +export const account1Address = "0x6f1b1f1feb01235e15a7962f16c389c7f8218ed6" +export const account1Name = /^e2e\.testertesting\.eth$/ export default class OnboardingHelper { constructor(