-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: ✅ adding e2e test - user displays his nft collection
- Loading branch information
Showing
8 changed files
with
111 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"ledger-live-desktop": minor | ||
"@ledgerhq/live-common": minor | ||
--- | ||
|
||
Adding New E2E tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect } from "@playwright/test"; | ||
import { step } from "tests/misc/reporters/step"; | ||
import { AppPage } from "tests/page/abstractClasses"; | ||
import { Account } from "@ledgerhq/live-common/e2e/enum/Account"; | ||
import invariant from "invariant"; | ||
|
||
export class NftGallery extends AppPage { | ||
private locateNftInGalleryByName = (nftName: string) => this.page.locator(`text=${nftName}`); | ||
private nftListGallery = (nftContract: string) => | ||
this.page.getByTestId(`nft-row-gallery-${nftContract}`); | ||
|
||
@step("Select NFT $0") | ||
async selectNFT(nftName: string) { | ||
await this.locateNftInGalleryByName(nftName).click(); | ||
} | ||
|
||
@step("Expect NFT list to be visible in gallery") | ||
async verifyNftPresenceInGallery(account: Account) { | ||
invariant(account.nft && account.nft.length > 0, "No NFT found in account"); | ||
|
||
for (const nft of account.nft) { | ||
const nftLocator = this.nftListGallery(nft.nftContract); | ||
await expect(nftLocator).toBeVisible(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters