Skip to content

Commit

Permalink
Create E2E tests for verified/unverified tokens
Browse files Browse the repository at this point in the history
This commit introduces E2E test that checks the functiolality of
verified/unverified tokens. Following general steps are executed:
1. Import account
2. Enable `Show unverified assets`
3. Hide asset
4. Trust asset
5. Hide trusted asset
A number of checks is performed during each step.

The commit also introduces helper functions and adds `data-testid` attribute to
a couple of DOM elements.

As some of the code is similar or identical as in the
#3418 PR which is yet not merged to
`main`, some conflicts may arise and will need to be resolved before this change
lands on `main`.

Also some changes will need to be made once
#3195 gets merged to `main`, as this
PR solves a bug causing failures in the tests (the failing part of the test was
temporarily commented out).
  • Loading branch information
michalinacienciala committed Jun 13, 2023
1 parent fda8e06 commit fdf09c6
Show file tree
Hide file tree
Showing 9 changed files with 1,142 additions and 6 deletions.
558 changes: 558 additions & 0 deletions e2e-tests/token-trust.spec.ts

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions e2e-tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { test as base, chromium, Page } from "@playwright/test"
import { FeatureFlagType, isEnabled } from "@tallyho/tally-background/features"
import path from "path"
import WalletPageHelper from "./utils/walletPageHelper"
import AssetsHelper from "./utils/assets"

// Re-exporting so we don't mix imports
export { expect } from "@playwright/test"

type WalletTestFixtures = {
extensionId: string
walletPageHelper: WalletPageHelper
assetsHelper: AssetsHelper
backgroundPage: Page
}

Expand Down Expand Up @@ -56,6 +58,10 @@ export const test = base.extend<WalletTestFixtures>({
const helper = new WalletPageHelper(page, context, extensionId)
await use(helper)
},
assetsHelper: async ({ page, walletPageHelper }, use) => {
const helper = new AssetsHelper(page, walletPageHelper)
await use(helper)
},
})

export const skipIfFeatureFlagged = (featureFlag: FeatureFlagType): void =>
Expand Down
Loading

0 comments on commit fdf09c6

Please sign in to comment.