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

feat: NFT token transfer #27955

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions test/e2e/page-objects/pages/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class HomePage {
private readonly activityTab =
'[data-testid="account-overview__activity-tab"]';

private readonly nftTab = '[data-testid="account-overview__nfts-tab"]';

private readonly nftIconOnActivityList = '[data-testid="nft-item"]';

private readonly balance = '[data-testid="eth-overview__primary-currency"]';

private readonly basicFunctionalityOffWarningMessage = {
Expand Down Expand Up @@ -72,6 +76,15 @@ class HomePage {
await this.driver.waitForSelector(this.basicFunctionalityOffWarningMessage);
}

async goToNFTList(): Promise<void> {
console.log(`Open NFT tab on homepage`);
await this.driver.clickElement(this.nftTab);
}

async clickNFTIconOnActivityList() {
await this.driver.clickElement(this.nftIconOnActivityList);
}

/**
* This function checks if the specified number of confirmed transactions are displayed in the activity list on homepage.
* It waits up to 10 seconds for the expected number of confirmed transactions to be visible.
Expand Down
17 changes: 17 additions & 0 deletions test/e2e/page-objects/pages/nft-details-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Driver } from '../../webdriver/driver';

class NFTDetailsPage {
private driver: Driver;

private readonly nftSendButton = '[data-testid="nft-send-button"]';

constructor(driver: Driver) {
this.driver = driver;
}

async clickNFTSendButton() {
await this.driver.clickElement(this.nftSendButton);
}
}

export default NFTDetailsPage;
7 changes: 7 additions & 0 deletions test/e2e/page-objects/pages/send/send-token-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class SendTokenPage {

private inputAmount: string;

private inputNFTAmount: string;

private scanButton: string;

private continueButton: object;
Expand All @@ -26,6 +28,7 @@ class SendTokenPage {
constructor(driver: Driver) {
this.driver = driver;
this.inputAmount = '[data-testid="currency-input"]';
this.inputNFTAmount = '[data-testid="nft-input"]';
this.inputRecipient = '[data-testid="ens-input"]';
this.scanButton = '[data-testid="ens-qr-scan-button"]';
this.ensResolvedName =
Expand Down Expand Up @@ -79,6 +82,10 @@ class SendTokenPage {
);
}

async fillNFTAmount(amount: string) {
await this.driver.pasteIntoField(this.inputNFTAmount, amount);
}

async goToNextScreen(): Promise<void> {
await this.driver.clickElement(this.continueButton);
}
Expand Down
36 changes: 36 additions & 0 deletions test/e2e/page-objects/pages/test-dapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ class TestDapp {
tag: 'button',
};

private readonly erc721MintButton = '#mintButton';

private readonly erc721TransferFromButton = '#transferFromButton';

private readonly erc1155TokenIDInput = '#batchMintTokenIds';

private readonly erc1155TokenAmountInput = '#batchMintIdAmounts';

private readonly erc1155MintButton = '#batchMintButton';

private readonly erc1155WatchButton = '#watchAssetButton';

private readonly erc1155RevokeSetApprovalForAllButton =
'#revokeERC1155Button';

Expand Down Expand Up @@ -174,6 +186,30 @@ class TestDapp {
});
}

async clickERC721MintButton() {
await this.driver.clickElement(this.erc721MintButton);
}

async clickERC721TransferFromButton() {
await this.driver.clickElement(this.erc721TransferFromButton);
}

async fillERC1155TokenID(tokenID: string) {
await this.driver.pasteIntoField(this.erc1155TokenIDInput, tokenID);
}

async fillERC1155TokenAmount(amount: string) {
await this.driver.pasteIntoField(this.erc1155TokenAmountInput, amount);
}

async clickERC1155MintButton() {
await this.driver.clickElement(this.erc1155MintButton);
}

async clickERC1155WatchButton() {
await this.driver.clickElement(this.erc1155WatchButton);
}

async clickERC721SetApprovalForAllButton() {
await this.driver.clickElement(this.erc721SetApprovalForAllButton);
}
Expand Down
Loading