diff --git a/walletservices/wallet-services-page/WalletServicesPage.ts b/walletservices/wallet-services-page/WalletServicesPage.ts index 6aaa8768..d3caf778 100644 --- a/walletservices/wallet-services-page/WalletServicesPage.ts +++ b/walletservices/wallet-services-page/WalletServicesPage.ts @@ -2,6 +2,7 @@ import { expect, Locator, Page } from "@playwright/test"; import { delay } from "../utils/index"; import Mailosaur from "mailosaur"; +import { Console } from "console"; export class WalletServicesPage { readonly page: Page; @@ -13,7 +14,9 @@ export class WalletServicesPage { await delay(2000); expect( await this.page - .locator(`xpath=.//*[@class='flex items-center gap-4']/span`) + .locator( + `xpath=.//*[@class='flex items-center gap-4']/ancestor::div/button/span` + ) .first() .textContent() ).toContain(address); @@ -29,9 +32,10 @@ export class WalletServicesPage { async verifyNetworkName(name: string) { expect( await this.page - .locator(`xpath=.//button/span[text()='${name}']`) - .isVisible() - ); + .locator(`xpath=.//input[@role='textbox']`) + .first() + .inputValue() + ).toContain(name); } async verifyAvailableBalance(balance: string) { @@ -58,14 +62,12 @@ export class WalletServicesPage { .locator(`xpath=.//p[text()='Transferred Token']/parent::div/div`) .last() .textContent() - ).toEqual(content); + ).toContain(content); } async verifyTransferFee(transactionFee: string) { let fee = await this.page - .locator( - `xpath=.//p[text()='Transaction Fee']/parent::div/following-sibling::div//p/span` - ) + .locator(`xpath=.//p[text()='Transaction Fee']/parent::div//div/p`) .last() .textContent(); expect(parseInt(fee!)).toBeGreaterThanOrEqual(parseInt(transactionFee)); @@ -104,15 +106,12 @@ export class WalletServicesPage { } async selectNetwork(currentNetwork: string, newNetwork: string) { - await this.page - .locator(`xpath=.//button/span[text()='${currentNetwork}']`) - .first() - .click(); + await this.page.locator(`xpath=.//input[@role='textbox']`).first().click(); await this.page.waitForSelector( - `xpath=.//li//div[text()='${newNetwork} ']` + `xpath=.//div/span[text()='${newNetwork}']` ); await this.page - .locator(`xpath=.//li//div[text()='${newNetwork} ']`) + .locator(`xpath=.//div/span[text()='${newNetwork}']`) .first() .click(); await delay(5000); @@ -121,13 +120,13 @@ export class WalletServicesPage { async selectCurrency(currency: string) { await this.page .locator( - `xpath=.//p[contains(text(),'Select Default Currency')]/parent::div/div//button` + `xpath=.//p[contains(text(),'Select Default Currency')]/parent::div/div//input` ) .first() .click(); - await this.page.waitForSelector(`xpath=.//li//div[text()='${currency} ']`); + await this.page.waitForSelector(`xpath=.//div/span[text()='${currency}']`); await this.page - .locator(`xpath=.//li//div[text()='${currency} ']`) + .locator(`xpath=.//div/span[text()='${currency}']`) .first() .click(); await delay(5000); diff --git a/walletservices/wallet-services-page/index.test.ts b/walletservices/wallet-services-page/index.test.ts index 41986983..f0a02e2b 100644 --- a/walletservices/wallet-services-page/index.test.ts +++ b/walletservices/wallet-services-page/index.test.ts @@ -98,13 +98,6 @@ test.describe.serial("Wallet Services Scenarios @smoke", () => { ); }); - test(`Verify details displayed on send transaction screen`, async ({}) => { - const accountsPage = new WalletServicesPage(page); - await accountsPage.verifyAvailableBalance("0.2 MATIC"); - await accountsPage.verifyTransferTokenAmount("10MATIC"); - await accountsPage.verifyTransferAddress("0x6e82...117d10x9904...ADE6A"); - }); - test(`Verify transaction fee is updated on selection of different speed levels`, async ({}) => { const accountsPage = new WalletServicesPage(page); await accountsPage.selectSpeed("Slow"); @@ -115,8 +108,18 @@ test.describe.serial("Wallet Services Scenarios @smoke", () => { await accountsPage.verifyTransferFee("0.00004"); }); - test(`Verify user is able to view the sent transaction activity`, async ({}) => { + test(`Verify details displayed on send transaction screen`, async ({}) => { + const accountsPage = new WalletServicesPage(page); + await accountsPage.verifyAvailableBalance("0.2 MATIC"); + await accountsPage.enterTransactionAmount("0.0001"); + await accountsPage.clickButton(" Submit "); + await accountsPage.verifyTransferTokenAmount("0.0001MATIC"); + await accountsPage.verifyTransferAddress("0x6e82...117d10x9904...ADE6A"); + }); + + test.skip(`Verify user is able to view the sent transaction activity`, async ({}) => { const accountsPage = new WalletServicesPage(page); + await page.goto(`${walletServiceLoginURL}/wallet/home`); await accountsPage.clickLink(" Home"); await accountsPage.clickLink(" Activity"); await page.waitForURL(`${walletServiceLoginURL}/wallet/activity`, { @@ -129,6 +132,7 @@ test.describe.serial("Wallet Services Scenarios @smoke", () => { test(`Verify user is able to switch currency`, async ({}) => { const accountsPage = new WalletServicesPage(page); + await page.goto(`${walletServiceLoginURL}/wallet/home`); await accountsPage.clickLink(" Home"); await accountsPage.navigateToSettingsWithOption("General"); await accountsPage.selectCurrency("ETH"); @@ -139,7 +143,7 @@ test.describe.serial("Wallet Services Scenarios @smoke", () => { ); }); - test(`Verify user is able to import account`, async ({}) => { + test.skip(`Verify user is able to import account`, async ({}) => { const accountsPage = new WalletServicesPage(page); await accountsPage.navigateToSettingsWithOption("Manage Wallets"); await accountsPage.clickButton(" Import Account");