Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproduce issue 3486 (DO NOT MERGE) #3512

Closed
wants to merge 1 commit into from
Closed
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
69 changes: 69 additions & 0 deletions e2e-tests/3486.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { wait } from "@tallyho/tally-background/lib/utils"
import { test, expect } from "./utils"

Check failure on line 2 in e2e-tests/3486.spec.ts

View workflow job for this annotation

GitHub Actions / lint

'expect' is defined but never used
import { account1Address, account1Name } from "./utils/onboarding"

test.describe("NFTs", () => {
test("User can view nft collections, poaps and badges", async ({
page,
backgroundPage,
walletPageHelper,
}) => {
await test.step("Shows loading state", async () => {
let shouldInterceptRequests = true

Check failure on line 12 in e2e-tests/3486.spec.ts

View workflow job for this annotation

GitHub Actions / lint

'shouldInterceptRequests' is never reassigned. Use 'const' instead

// Set a delay so we don't miss loading states
await backgroundPage.route(/api\.simplehash\.com/i, async (route) => {
if (!shouldInterceptRequests) {
route.continue()
return
}

const response = await route.fetch().catch((err) => {
// Waiting for the response doesn't prevent context disposed errors
// consistently
if (
err instanceof Error &&
err.message.includes("Request context disposed")
) {
// noop
} else {
throw err
}
})

if (response) {
await wait(800)
await route.fulfill({ response })
}
})

await walletPageHelper.onboarding.addReadOnlyAccount(account1Address)

await walletPageHelper.goToStartPage()
await walletPageHelper.setViewportSize()

// Switch to Optimism, then to Polygon and then to Arbitrum (to load NFTs
// on those chains).
await page.getByTestId("top_menu_network_switcher").last().click()
await page.getByText(/^Optimism$/).click()
await page.getByTestId("top_menu_network_switcher").last().click()
await page.getByText(/^Polygon$/).click()
await page.getByTestId("top_menu_network_switcher").last().click()
await page.getByText(/^Arbitrum$/).click()

await walletPageHelper.navigateTo("NFTs")
})

await test.step("Filtering accounts", async () => {
await page.getByRole("button", { name: "Filter collections" }).click()

await page
.getByTestId("nft_account_filters")
.filter({
hasText: account1Name,
})
.getByRole("checkbox")
.click()
})
})
})
Loading