-
Notifications
You must be signed in to change notification settings - Fork 357
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
99 additions
and
42 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,25 @@ | ||
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"; | ||
|
||
export class NftGallery extends AppPage { | ||
private locateNft = (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.locateNft(nftName).click(); | ||
} | ||
|
||
@step("Expect NFT list $0 to be visible in gallery") | ||
async checkNftListInGallery(account: Account) { | ||
if (account.nft) { | ||
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