diff --git a/.github/workflows/walletservice.yml b/.github/workflows/walletservice.yml index e35e789..120f4ca 100644 --- a/.github/workflows/walletservice.yml +++ b/.github/workflows/walletservice.yml @@ -5,7 +5,7 @@ on: branches: - master schedule: - - cron: "0 */2 * * *" + - cron: "0 0 * * *" env: NODE_VERSION: 20 diff --git a/walletservices/wallet-service/WalletServicesPage.ts b/walletservices/wallet-service/WalletServicesPage.ts index b81431e..99355c7 100644 --- a/walletservices/wallet-service/WalletServicesPage.ts +++ b/walletservices/wallet-service/WalletServicesPage.ts @@ -29,13 +29,13 @@ export class WalletServicesPage { } async verifyTransferFromAddress(content: string) { - expect( - await this.page.locator(`xpath=.//p[text()='Sepolia Test Network']/parent::div/following-sibling::div//p`).first().textContent() - ).toContain(content); + expect(await this.page.locator(`xpath=.//p[text()='Polygon Amoy']/parent::div/following-sibling::div//p`).first().textContent()).toContain( + content + ); } async verifyTransferToAddress(content: string) { - expect(await this.page.locator(`xpath=.//p[text()='Sepolia Test Network']/parent::div/following-sibling::div//p`).last().textContent()).toContain( + expect(await this.page.locator(`xpath=.//p[text()='Polygon Amoy']/parent::div/following-sibling::div//p`).last().textContent()).toContain( content ); } diff --git a/walletservices/wallet-service/index.test.ts b/walletservices/wallet-service/index.test.ts index 499e368..671c9be 100644 --- a/walletservices/wallet-service/index.test.ts +++ b/walletservices/wallet-service/index.test.ts @@ -5,7 +5,7 @@ import { WalletServicesPage } from "./WalletServicesPage"; const walletServiceLoginURL = "https://develop-wallet.web3auth.io"; -const testEmail = "kelg8.j5s90ldb0b35@inbox.testmail.app"; +const testEmail = "kelg8.wallet@inbox.testmail.app"; test.describe.serial("Core Wallet Services Scenarios @smoke", () => { let page: Page; @@ -28,18 +28,18 @@ test.describe.serial("Core Wallet Services Scenarios @smoke", () => { await accountsPage.enableTestNetworks(); await accountsPage.selectNetwork("Ethereum", "Ethereum"); await accountsPage.clickHome(); - await accountsPage.verifyBalanceAndAddress("0x0dBa...4e49F", "0"); + await accountsPage.verifyBalanceAndAddress("0xed21...4C0a7", "0"); }); test(`Verify network switch and balance on wallet services`, async () => { const accountsPage = new WalletServicesPage(page); await accountsPage.verifyNetworkName("Ethereum"); await accountsPage.navigateToSettingsWithOption("General"); - await accountsPage.selectNetwork("Ethereum", "Sepolia Test Network"); + await accountsPage.selectNetwork("Ethereum", "Polygon Amoy"); await accountsPage.selectCurrency("USD"); await accountsPage.clickHome(); - await accountsPage.verifyNetworkName("Sepolia Test Network"); - await accountsPage.verifyBalanceAndAddress("0x0dBa...4e49F", "1500"); + await accountsPage.verifyNetworkName("Polygon Amoy"); + await accountsPage.verifyBalanceAndAddress("0xed21...4C0a7", "0.08"); }); test(`Verify validations on send transaction screen`, async () => { @@ -64,62 +64,51 @@ test.describe.serial("Core Wallet Services Scenarios @smoke", () => { test(`Verify details displayed on send transaction screen`, async () => { const accountsPage = new WalletServicesPage(page); - await accountsPage.verifyAvailableBalance("0.6"); + await accountsPage.verifyAvailableBalance("0.1899 MATIC"); await accountsPage.enterTransactionAmount("0.0001"); await accountsPage.clickButton("Submit"); - await accountsPage.verifyTransferTokenAmount("0.0001 ETH"); - await accountsPage.verifyTransferFromAddress("0x0dBa...4e49F"); + await accountsPage.verifyTransferTokenAmount("0.0001 MATIC"); + await accountsPage.verifyTransferFromAddress("0xed21...4C0a7"); await accountsPage.verifyTransferToAddress("0x9904...ADE6A"); }); test.skip(`Verify existing assets are displayed`, async () => { const accountsPage = new WalletServicesPage(page); - await page.goto(`${walletServiceLoginURL}/wallet/home`); - await accountsPage.navigateToSettingsWithOption("General"); - await accountsPage.selectNetwork("Main Ethereum Network", "Sepolia Test Network"); await accountsPage.clickHome(); await accountsPage.navigateToSettingsWithOption("General"); await accountsPage.selectNetwork("Main Ethereum Network", "Polygon Mumbai"); await accountsPage.clickHome(); - await accountsPage.verifyNftIsPresent("final_touch"); + await accountsPage.verifyNftIsPresent("SampleERC721"); }); test(`Verify user is able to view the sent transaction activity`, async () => { const accountsPage = new WalletServicesPage(page); - await page.goto(`${walletServiceLoginURL}/wallet/home`); await accountsPage.navigateToSettingsWithOption("General"); - await accountsPage.selectNetwork("Main Ethereum Network", "Sepolia Test Network"); + await accountsPage.selectNetwork("Main Ethereum Network", "Polygon Amoy"); await accountsPage.clickHome(); await accountsPage.clickLink(" Activity"); await page.waitForURL(`${walletServiceLoginURL}/wallet/activity`, { waitUntil: "load", }); - await accountsPage.verifyTransactionActivity("Sent ETH|cfa5|10:11:30 | 8 May 2024"); - await accountsPage.verifyTransactionActivity("Received ETH|e49f|20:22:18 | 1 May 2024"); + await accountsPage.verifyTransactionActivity("Sent MATIC|to 0x9904bf11c69233454162b72d7289ccbb295ade6a|20:12:44 | 19 Sept 2024"); + await accountsPage.verifyTransactionActivity("Received MATIC|to 0xed2130dd79960a00be8abe75962c75678af4c0a7|19:57:52 | 19 Sept 2024"); }); 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.selectNetwork("Main Ethereum Network", "Polygon Amoy"); await accountsPage.selectCurrency("SGD"); await accountsPage.clickHome(); - await accountsPage.verifyBalanceAndAddress("0x0dBa...4e49F", "0.21"); - }); - - 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"); - await accountsPage.inputPrivateKey("18a6aa7e43a8f7f57c4cfb8d322cc9c12cd4cc573ea137c9bcd6d2b5d060a90a"); - await accountsPage.clickLink(" Home"); - await accountsPage.verifyBalanceAndAddress("0x2b7f47e9bb...B99a8a33151c", "0.00013"); + await accountsPage.verifyBalanceAndAddress("0xed21...4C0a7", "0.08"); }); test(`Verify user is able to connect via wallet connect`, async () => { const accountsPage = new WalletServicesPage(page); - await page.goto(`${walletServiceLoginURL}/wallet/home`); + await accountsPage.navigateToSettingsWithOption("General"); + await accountsPage.selectNetwork("Main Ethereum Network", "Ethereum"); + await accountsPage.clickHome(); await accountsPage.clickButton(" Wallet connect"); await page.waitForSelector('[aria-placeholder="Paste QR link here"]'); expect(await page.locator('[aria-placeholder="Paste QR link here"]').first().isVisible()).toBeTruthy(); @@ -127,14 +116,12 @@ test.describe.serial("Core Wallet Services Scenarios @smoke", () => { test(`Verify user is able to buy tokens`, async () => { const accountsPage = new WalletServicesPage(page); - await accountsPage.navigateToSettingsWithOption("General"); - await accountsPage.selectNetwork("Main Ethereum Network", "Ethereum"); - await page.goto(`${walletServiceLoginURL}/wallet/home`); + await accountsPage.clickHome(); await accountsPage.clickOption("Buy"); await page.waitForURL(`${walletServiceLoginURL}/wallet/checkout`, { waitUntil: "load", }); - await delay(10000); + await delay(5000); await accountsPage.verifyBuyOption(); }); });