From ee8151312b8c05f01800316b363bfc557049948f Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Mon, 28 Aug 2023 16:43:41 +0300 Subject: [PATCH 01/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Added autotests fot the next cases TC1677 Deposit - Bridge - [Artifacts] "Insufficient balance" warning message (Zero token balance) TC1618 Bridge - Deposit - Empty wallet - Atrifacts TC1605 Bridge - Redirection - "View on Explorer" links TC1412 Deposit - Transactions - Artifacts - "Transaction submitted" pop up --- .../assetsPage/artifacts-emptyWallet.feature | 25 ++++++++++++++ .../artifacts/bridgePage/artifacts.feature | 34 +++++++++++++++++++ .../depositPage/artifacts-deposits.feature | 28 +++++++++++++++ tests/e2e/src/pages/main.page.ts | 9 +++++ tests/e2e/src/steps/portal.steps.ts | 9 +++++ 5 files changed, 105 insertions(+) diff --git a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature index 0350e32f..59e028bd 100644 --- a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature +++ b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature @@ -46,3 +46,28 @@ Feature: Artifacts - UI #Error state Then Element with "partial class" "has-error" should be "visible" Then Element with "partial class" "amount-input-error" should be "visible" + + @id1618 + Scenario: Check the Empty wallet Artifacts on the Bridge Deposit Page + Given I go to page "/bridge?network=era-goerli" + When I click by text "Deposit" + When I choose "ETH" as token and insert "0" as amount + When Element with "text" " Insufficient " should be "visible" + Then Message "ETH" should be visible + Then Message " balance on Ethereum Goerli Testnet to cover the fee. We recommend having at least " should be visible + Then Message " on Goerli Testnet for deposit. " should be visible + Then Element with "text" "Fee:" should be "invisible" + #Fee component + Then Element with "data-testid" "fee-amount" should be "invisible" + + @id1677 + Scenario: Check "Insufficient balance" warning message (Zero token balance) (Bridge) + Given A wallet should be "empty" + When I go to page "/bridge?network=era-goerli" + When I click by text "Deposit" + When I choose "ETH" as token and insert "1000" as amount + Then Message " Insufficient balance " should be visible + #Error state + Then Element with "partial class" "has-error" should be "visible" + Then Element with "partial class" "amount-input-error" should be "visible" + \ No newline at end of file diff --git a/tests/e2e/features/artifacts/bridgePage/artifacts.feature b/tests/e2e/features/artifacts/bridgePage/artifacts.feature index f6e06570..acfd1a34 100644 --- a/tests/e2e/features/artifacts/bridgePage/artifacts.feature +++ b/tests/e2e/features/artifacts/bridgePage/artifacts.feature @@ -234,3 +234,37 @@ Feature: Withdraw When I click by text "0x52B6...f46" Then Element with "text" "zkSync Era Testnet address" should be "visible" Then Element with "text" "0x52B6...f46" should be "visible" + + @id1605:I + Scenario Outline: Check redirection for the Bridge "View on Explorer" links (Testnet) + Given I go to page "/bridge?network=era-goerli" + When I click by partial text "..." + Then Element with "text" "View on Explorer" should be "visible" + When I click by text "View on Explorer" + Then Modal card element with the "//*[text()='View on explorer']" xpath should be "visible" + When I click by the "" text on the Explorer Modal + Then New page has "" address + + Examples: + | Explorer item | url | + | zkSync Era Testnet | https://goerli.explorer.zksync.io/address/0x2CF4F78917A16C9584AeB5d4c5bD2713d724C75d | + | Ethereum Goerli Testnet | https://goerli.etherscan.io/address/0x2CF4F78917A16C9584AeB5d4c5bD2713d724C75d | + | zkSync Lite Goerli | https://goerli.zkscan.io/explorer/accounts/0x2cf4f78917a16c9584aeb5d4c5bd2713d724c75d | + + + @id1605:II + Scenario Outline: Check redirection for the Bridge "View on Explorer" links (Mainnet) + Given I go to page "/bridge?network=era-mainnet" + When I click by partial text "..." + Then Element with "text" "View on Explorer" should be "visible" + When I click by text "View on Explorer" + Then Modal card element with the "//*[text()='View on explorer']" xpath should be "visible" + When I click by the "" text on the Explorer Modal + Then New page has "" address + + Examples: + | Explorer item | url | + | zkSync Era Mainnet | https://explorer.zksync.io/address/0x2CF4F78917A16C9584AeB5d4c5bD2713d724C75d | + | Ethereum Mainnet | https://etherscan.io/address/0x2CF4F78917A16C9584AeB5d4c5bD2713d724C75d | + | zkSync Lite Mainnet| https://zkscan.io/explorer/accounts/0x2cf4f78917a16c9584aeb5d4c5bd2713d724c75d | + \ No newline at end of file diff --git a/tests/e2e/features/artifacts/depositPage/artifacts-deposits.feature b/tests/e2e/features/artifacts/depositPage/artifacts-deposits.feature index dad212cd..4efedc57 100644 --- a/tests/e2e/features/artifacts/depositPage/artifacts-deposits.feature +++ b/tests/e2e/features/artifacts/depositPage/artifacts-deposits.feature @@ -237,3 +237,31 @@ Feature: Artifacts - UI Then Element with "text" "0x1ab721...184" should be "visible" Then Element with "partial src" "zz.png" should be "visible" + @id1412 + Scenario: Check artifacts for "Transaction submitted" pop up (Deposit) + Given I am on the Main page + When I go to page "/transaction/zksync/era/deposit/?network=era-goerli" + When I click by "text" with "Your account" value + When I choose "ETH" as token and insert "0.0000000001" as amount + When I "confirm" transaction after clicking "Add funds to zkSync Era Testnet" button + Then Message "Transaction submitted" should be visible + Then Element with "partial class" "progress-plane-animation" should be "visible" + Then Element with "class" "button-line-body-info-underline" should be "visible" + #Token icon + Then Element with "text" "Deposit" should be "visible" + Then Element with "partial text" "0.0000000001" should be "visible" + Then Modal card element with the "//*[contains(@src, 'eth.svg')]" xpath should be "visible" + Then Modal card element with the "//*[text()='ETH']" xpath should be "visible" + Then Modal card element with the "//*[text()='<$0.01']" xpath should be "visible" + Then Arrow element for "Deposit" external link should be "visible" + Then Arrow element for "Deposit" external link should be "clickable" + Then Element with "text" " Your funds will be available on " should be "visible" + Then Element with "text" "zkSync Era Testnet" should be "visible" + Then Element with "text" " after the transaction is committed on " should be "visible" + Then Element with "text" "Ethereum Goerli Testnet" should be "visible" + Then Element with "text" " and then processed on " should be "visible" + Then Element with "text" "zkSync Era Testnet" should be "visible" + Then Element with "text" ". You are free to close this page. " should be "clickable" + Then Element with "text" " Track status " should be "clickable" + Then Element with "text" " Go to Assets page " should be "visible" + \ No newline at end of file diff --git a/tests/e2e/src/pages/main.page.ts b/tests/e2e/src/pages/main.page.ts index 4dbfff5a..37671696 100644 --- a/tests/e2e/src/pages/main.page.ts +++ b/tests/e2e/src/pages/main.page.ts @@ -50,6 +50,10 @@ export class MainPage extends BasePage { return "//*[@class='menu-options']"; } + get bridgeExplorerElement() { + return '//*[contains(@class, "destination-item")]'; + } + get avatarModalCard() { return '//*[contains(@class, "address-card-avatar")]'; } @@ -265,6 +269,11 @@ export class MainPage extends BasePage { await this.click(this.menuElement + selector); } + async clickExplorerElement(text: string) { + const selector = `//*[text()='${text}']`; + await this.click(this.bridgeExplorerElement + selector); + } + async selectNetwork(networkName: string) { await this.click(this.networkSwitcher); diff --git a/tests/e2e/src/steps/portal.steps.ts b/tests/e2e/src/steps/portal.steps.ts index 299471fc..67bd031c 100644 --- a/tests/e2e/src/steps/portal.steps.ts +++ b/tests/e2e/src/steps/portal.steps.ts @@ -338,6 +338,15 @@ When("I click by the {string} text on the Menu", config.stepTimeout, async funct await mainPage.clickMenuElement(text); }); +When( + "I click by the {string} text on the Explorer Modal", + config.stepTimeout, + async function (this: ICustomWorld, text: string) { + mainPage = new MainPage(this); + await mainPage.clickExplorerElement(text); + } +); + Then("I close modal card", config.stepTimeout, async function (this: ICustomWorld) { const basePage = new BasePage(this); const mainPage = new MainPage(this); From 70fd8fb9f57e3bd659f8b7135dc956f9ebe53488 Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Tue, 29 Aug 2023 17:30:59 +0300 Subject: [PATCH 02/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Added testnet and mainnet tags (tc1605) Added check for disabled "Continue" button (tc1678) --- .../assetsPage/artifacts-emptyWallet.feature | 14 +++++++++++++- .../artifacts/bridgePage/artifacts.feature | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature index 59e028bd..3a4b1200 100644 --- a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature +++ b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature @@ -70,4 +70,16 @@ Feature: Artifacts - UI #Error state Then Element with "partial class" "has-error" should be "visible" Then Element with "partial class" "amount-input-error" should be "visible" - \ No newline at end of file + + @id1678 + Scenario: Check "Insufficient balance" warning message (Zero token balance) (Bridge) + Then A wallet should be "empty" + When I go to page "/bridge?network=era-goerli" + When I click by text "Withdraw" + When I choose "ETH" as token and insert "1000" as amount + Then Message " Insufficient balance " should be visible + #Error state + Then Element with "partial class" "has-error" should be "visible" + Then Element with "partial class" "amount-input-error" should be "visible" + When I confirm the network switching + Then Element with "text" " Continue " should be "disabled" diff --git a/tests/e2e/features/artifacts/bridgePage/artifacts.feature b/tests/e2e/features/artifacts/bridgePage/artifacts.feature index acfd1a34..0760d08e 100644 --- a/tests/e2e/features/artifacts/bridgePage/artifacts.feature +++ b/tests/e2e/features/artifacts/bridgePage/artifacts.feature @@ -235,7 +235,7 @@ Feature: Withdraw Then Element with "text" "zkSync Era Testnet address" should be "visible" Then Element with "text" "0x52B6...f46" should be "visible" - @id1605:I + @id1605:I @testnet Scenario Outline: Check redirection for the Bridge "View on Explorer" links (Testnet) Given I go to page "/bridge?network=era-goerli" When I click by partial text "..." @@ -252,7 +252,7 @@ Feature: Withdraw | zkSync Lite Goerli | https://goerli.zkscan.io/explorer/accounts/0x2cf4f78917a16c9584aeb5d4c5bd2713d724c75d | - @id1605:II + @id1605:II @mainnet Scenario Outline: Check redirection for the Bridge "View on Explorer" links (Mainnet) Given I go to page "/bridge?network=era-mainnet" When I click by partial text "..." From 2efa4054a63437c601d43474af86e7004d06431f Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Tue, 29 Aug 2023 19:17:01 +0300 Subject: [PATCH 03/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Added check for disabled Continue button (tc1677) --- .../features/artifacts/assetsPage/artifacts-emptyWallet.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature index 3a4b1200..74d6500c 100644 --- a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature +++ b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature @@ -70,6 +70,8 @@ Feature: Artifacts - UI #Error state Then Element with "partial class" "has-error" should be "visible" Then Element with "partial class" "amount-input-error" should be "visible" + When I confirm the network switching + Then Element with "text" " Continue " should be "disabled" @id1678 Scenario: Check "Insufficient balance" warning message (Zero token balance) (Bridge) From 3434f5446ad73753c7ba531ad6398363263d7900 Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Wed, 30 Aug 2023 22:28:10 +0300 Subject: [PATCH 04/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Changed data-testid to testId Fixed getElementByTestId to work correctly with checkElementVisible - 'try-catch' --- .../artifacts/assetsPage/artifacts-emptyWallet.feature | 2 +- tests/e2e/src/pages/base.page.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature index 74d6500c..913ddbd4 100644 --- a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature +++ b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature @@ -58,7 +58,7 @@ Feature: Artifacts - UI Then Message " on Goerli Testnet for deposit. " should be visible Then Element with "text" "Fee:" should be "invisible" #Fee component - Then Element with "data-testid" "fee-amount" should be "invisible" + Then Element with "testId" "fee-amount" should be "invisible" @id1677 Scenario: Check "Insufficient balance" warning message (Zero token balance) (Bridge) diff --git a/tests/e2e/src/pages/base.page.ts b/tests/e2e/src/pages/base.page.ts index a82d9f8a..9652347f 100644 --- a/tests/e2e/src/pages/base.page.ts +++ b/tests/e2e/src/pages/base.page.ts @@ -206,7 +206,11 @@ export class BasePage { async getElementByTestId(testid: string) { element = await this.world.page?.locator(`${this.byTestId}${testid}`).first(); - await element.scrollIntoViewIfNeeded(); + try { + await element.scrollIntoViewIfNeeded(config.minimalTimeout); + } catch (error) { + // ignore + } return await element; } @@ -235,6 +239,7 @@ export class BasePage { } async returnElementByType(elementType: string, value: string) { + element = undefined; if (elementType === "alt") { element = await this.getElementByAlt(value); } else if (elementType === "class") { From de8e74b2f682a8ff4714a333b2ff315d496f6d52 Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Thu, 31 Aug 2023 10:27:26 +0300 Subject: [PATCH 05/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Changed "data-testid" selector to "testId" Fixes failing tests --- .../artifacts/withdrawPage/artifacts-withdraw.feature | 4 ++-- tests/e2e/src/pages/base.page.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/features/artifacts/withdrawPage/artifacts-withdraw.feature b/tests/e2e/features/artifacts/withdrawPage/artifacts-withdraw.feature index b869d7d6..9bfa1ffb 100644 --- a/tests/e2e/features/artifacts/withdrawPage/artifacts-withdraw.feature +++ b/tests/e2e/features/artifacts/withdrawPage/artifacts-withdraw.feature @@ -17,8 +17,8 @@ Feature: Withdraw Then Element with "partial src" "eth.svg" should be "visible" Then Element with "placeholder" "0" should be "visible" Then Element with "class" "break-all" should be "visible" - Then Element with "data-testid" "token-dropDown" should be "visible" - Then Element with "data-testid" "token-dropDown" should be "clickable" + Then Element with "testid" "token-dropDown" should be "visible" + Then Element with "testid" "token-dropDown" should be "clickable" Then Element with "class" "amount-input-max-button" should be "visible" Then Element with "class" "amount-input-max-button" should be "clickable" # Fee block tc1432 diff --git a/tests/e2e/src/pages/base.page.ts b/tests/e2e/src/pages/base.page.ts index 9652347f..480751b8 100644 --- a/tests/e2e/src/pages/base.page.ts +++ b/tests/e2e/src/pages/base.page.ts @@ -239,7 +239,7 @@ export class BasePage { } async returnElementByType(elementType: string, value: string) { - element = undefined; + //element = undefined; if (elementType === "alt") { element = await this.getElementByAlt(value); } else if (elementType === "class") { From 171396e74a0b59947bcac3c7353456b76038c80b Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Fri, 1 Sep 2023 11:01:31 +0300 Subject: [PATCH 06/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Removed scrollIntoViewIfNeeded for getElementByTestId method Removed obsolete comment --- tests/e2e/src/pages/base.page.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/e2e/src/pages/base.page.ts b/tests/e2e/src/pages/base.page.ts index 480751b8..256a3603 100644 --- a/tests/e2e/src/pages/base.page.ts +++ b/tests/e2e/src/pages/base.page.ts @@ -206,11 +206,6 @@ export class BasePage { async getElementByTestId(testid: string) { element = await this.world.page?.locator(`${this.byTestId}${testid}`).first(); - try { - await element.scrollIntoViewIfNeeded(config.minimalTimeout); - } catch (error) { - // ignore - } return await element; } @@ -239,7 +234,6 @@ export class BasePage { } async returnElementByType(elementType: string, value: string) { - //element = undefined; if (elementType === "alt") { element = await this.getElementByAlt(value); } else if (elementType === "class") { From 1095b3bb9f343f4520582a6950f6881e8bcbf089 Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Fri, 1 Sep 2023 12:13:35 +0300 Subject: [PATCH 07/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 --- tests/e2e/src/pages/base.page.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/src/pages/base.page.ts b/tests/e2e/src/pages/base.page.ts index 256a3603..937ae948 100644 --- a/tests/e2e/src/pages/base.page.ts +++ b/tests/e2e/src/pages/base.page.ts @@ -234,6 +234,7 @@ export class BasePage { } async returnElementByType(elementType: string, value: string) { + element = undefined; if (elementType === "alt") { element = await this.getElementByAlt(value); } else if (elementType === "class") { From 868fb8d2560a76d3eae40ab135efa4207edf7b52 Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Fri, 1 Sep 2023 12:43:11 +0300 Subject: [PATCH 08/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Fixed incorrect testId selector name --- .../artifacts/withdrawPage/artifacts-withdraw.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/features/artifacts/withdrawPage/artifacts-withdraw.feature b/tests/e2e/features/artifacts/withdrawPage/artifacts-withdraw.feature index 9bfa1ffb..5869f1e0 100644 --- a/tests/e2e/features/artifacts/withdrawPage/artifacts-withdraw.feature +++ b/tests/e2e/features/artifacts/withdrawPage/artifacts-withdraw.feature @@ -17,8 +17,8 @@ Feature: Withdraw Then Element with "partial src" "eth.svg" should be "visible" Then Element with "placeholder" "0" should be "visible" Then Element with "class" "break-all" should be "visible" - Then Element with "testid" "token-dropDown" should be "visible" - Then Element with "testid" "token-dropDown" should be "clickable" + Then Element with "testId" "token-dropDown" should be "visible" + Then Element with "testId" "token-dropDown" should be "clickable" Then Element with "class" "amount-input-max-button" should be "visible" Then Element with "class" "amount-input-max-button" should be "clickable" # Fee block tc1432 From cd9f0c7a0e12010a2c108f686759383c3422862e Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Fri, 1 Sep 2023 14:47:56 +0300 Subject: [PATCH 09/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Moved id1609 id1607 tcs to id785 (because they need deposit tag for correct work) Renamed feature to Bridge (previously it was incorrect Withdraw) --- .../artifacts/bridgePage/artifacts.feature | 34 +------------------ .../bridge-deposit-with-blockchain.feature | 26 +++++++++++++- 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/tests/e2e/features/artifacts/bridgePage/artifacts.feature b/tests/e2e/features/artifacts/bridgePage/artifacts.feature index 0760d08e..280a8759 100644 --- a/tests/e2e/features/artifacts/bridgePage/artifacts.feature +++ b/tests/e2e/features/artifacts/bridgePage/artifacts.feature @@ -1,41 +1,9 @@ @bridge @bridgePage @regression @smoke @artifacts @richWallet -Feature: Withdraw +Feature: Bridge Background: Given Connect Metamask extension with login action - @id1609 @id1607 - Scenario: Check Explore ecosystem button on Bridge Deposit - Given I go to page "/bridge?network=era-goerli" - When I click by text "Deposit" - When I choose "ETH" as token and insert "0.0000000001" as amount - When I "confirm" transaction after clicking "Add funds to zkSync Era Testnet" button - Then Message "Transaction submitted" should be visible - #id1607 Check other elements on window - Then Element with "partial class" "progress-plane-animation" should be "visible" - Then Element with "class" "button-line-body-info-underline" should be "visible" - #Token icon - Then Element with "text" "Deposit" should be "visible" - Then Element with "partial text" "0.0000000001" should be "visible" - Then Modal card element with the "//*[contains(@src, 'eth.svg')]" xpath should be "visible" - Then Modal card element with the "//*[text()='ETH']" xpath should be "visible" - Then Modal card element with the "//*[text()='<$0.01']" xpath should be "visible" - Then Arrow element for "Deposit" external link should be "visible" - Then Arrow element for "Deposit" external link should be "clickable" - Then Element with "text" " Your funds will be available on " should be "visible" - Then Element with "text" "zkSync Era Testnet" should be "visible" - Then Element with "text" " after the transaction is committed on " should be "visible" - Then Element with "text" "Ethereum Goerli Testnet" should be "visible" - Then Element with "text" " and then processed on " should be "visible" - Then Element with "text" "zkSync Era Testnet" should be "visible" - Then Element with "text" ". You are free to close this page. " should be "clickable" - Then Element with "text" " Track status " should be "clickable" - Then Element with "text" " Make another transaction " should be "visible" - Then Element with "text" " Explore ecosystem " should be "visible" - #Check redirection id1609 - Then I click by "text" with " Explore ecosystem " value - Then New page has "https://ecosystem.zksync.io/" address - @id1602 Scenario: Check the Account Dropdown Artifacts on the Bridge Page Given I go to page "/bridge?network=era-goerli" diff --git a/tests/e2e/features/transactions/deposit/bridge-deposit-with-blockchain.feature b/tests/e2e/features/transactions/deposit/bridge-deposit-with-blockchain.feature index abc58e6e..93333e18 100644 --- a/tests/e2e/features/transactions/deposit/bridge-deposit-with-blockchain.feature +++ b/tests/e2e/features/transactions/deposit/bridge-deposit-with-blockchain.feature @@ -4,7 +4,7 @@ Feature: Deposit Background: Given Connect Metamask extension with login action - @id785 + @id785 @id1609 @id1607 Scenario: Make a deposit on Bridge (Deposit) Given I go to page "/bridge?network=era-goerli" When I click by text "Deposit" @@ -16,3 +16,27 @@ Feature: Deposit When I "confirm" transaction after clicking "Add funds to zkSync Era Testnet" button Then Message "Transaction submitted" should be visible Then Element with "partial href" "https://goerli.etherscan.io/tx/" should be "clickable" + #id1607 Check "Transaction submitted" pop up Artifacts + Then Element with "partial class" "progress-plane-animation" should be "visible" + Then Element with "class" "button-line-body-info-underline" should be "visible" + #Token icon + Then Element with "text" "Deposit" should be "visible" + Then Element with "partial text" "0.0000000001" should be "visible" + Then Modal card element with the "//*[contains(@src, 'eth.svg')]" xpath should be "visible" + Then Modal card element with the "//*[text()='ETH']" xpath should be "visible" + Then Modal card element with the "//*[text()='<$0.01']" xpath should be "visible" + Then Arrow element for "Deposit" external link should be "visible" + Then Arrow element for "Deposit" external link should be "clickable" + Then Element with "text" " Your funds will be available on " should be "visible" + Then Element with "text" "zkSync Era Testnet" should be "visible" + Then Element with "text" " after the transaction is committed on " should be "visible" + Then Element with "text" "Ethereum Goerli Testnet" should be "visible" + Then Element with "text" " and then processed on " should be "visible" + Then Element with "text" "zkSync Era Testnet" should be "visible" + Then Element with "text" ". You are free to close this page. " should be "clickable" + Then Element with "text" " Track status " should be "clickable" + Then Element with "text" " Make another transaction " should be "visible" + Then Element with "text" " Explore ecosystem " should be "visible" + #id1609 Check "Explore ecosystem" button + Then I click by "text" with " Explore ecosystem " value + Then New page has "https://ecosystem.zksync.io/" address From 76ad62cafb709d1d6b9ebc628612288a09d602b4 Mon Sep 17 00:00:00 2001 From: amelnytskyi Date: Fri, 1 Sep 2023 16:22:12 +0300 Subject: [PATCH 10/10] test: automated cases for smoke tcs tc1618 tc1677 tc1605 tc1412 Fixing selectors 2 bridgePage artifacts feature files since deposit has different logic for switch network --- .../bridgePage/artifacts-deposit.feature | 68 +++++++++++++++++++ ...cts.feature => artifacts-withdraw.feature} | 63 +---------------- .../depositPage/artifacts-deposits.feature | 2 +- 3 files changed, 70 insertions(+), 63 deletions(-) create mode 100644 tests/e2e/features/artifacts/bridgePage/artifacts-deposit.feature rename tests/e2e/features/artifacts/bridgePage/{artifacts.feature => artifacts-withdraw.feature} (72%) diff --git a/tests/e2e/features/artifacts/bridgePage/artifacts-deposit.feature b/tests/e2e/features/artifacts/bridgePage/artifacts-deposit.feature new file mode 100644 index 00000000..6f521cac --- /dev/null +++ b/tests/e2e/features/artifacts/bridgePage/artifacts-deposit.feature @@ -0,0 +1,68 @@ +@bridge @bridgePage @regression @smoke @artifacts @richWallet @deposit +Feature: Bridge + + Background: + Given Connect Metamask extension with login action + + @id756 + Scenario: Check the Bridge artifacts on Deposit (Testnet) + Given I go to page "/bridge?network=era-goerli" + Then Element with "text" "Bridge" should be "visible" + Then Element with "text" "Deposit" should be "visible" + Then Element with "text" "Withdraw" should be "visible" + Then Element with "text" "From" should be "visible" + Then Element with "text" "Ethereum Goerli Testnet" should be "visible" + Then Element with "class" "account-button" should be "visible" + Then Element with "class" "account-button" should be "clickable" + Then Element with "testId" "token-dropDown" should be "visible" + Then Element with "testId" "token-dropDown" should be "clickable" + Then Element with "partial string" "Balance:" should be "visible" + Then Element with "id" "amount-input" should be "visible" + Then Element with "id" "amount-input" should be "clickable" + Then Element with "text" " Max " should be "visible" + Then Element with "text" " Max " should be "clickable" + #Block + Then Element with "text" "Your zkSync Era Testnet account" should be "visible" + Then Element with "text" "Your zkSync Era Testnet account" should be "clickable" + Then Element with "text" "0x2CF4...75d" should be "visible" + Then Element with "text" "0x2CF4...75d" should be "clickable" + Then Element with "class" "address-avatar address-card-avatar" should be "visible" + Then Element with "partial src" "eth.svg" should be "visible" + #Fee block + Then Element with "testId" "fee-amount" should be "visible" + Then Element with "partial string" "$" should be "visible" + Then Element with "class" "circle" should be "enabled" + Then Element with "text" "ETH" should be "visible" + Then Element with "type" "submit" should be "visible" + # Bottom block part + When I confirm the network switching + Then Element with "partial string" "Arriving in ~15 minutes" should be "visible" + Then Element with "type" "submit" should be "visible" + Then Element with "partial string" " Continue " should be "visible" + + @id1611 + Scenario: Check the editing recipient address in Bridge (Deposit) + Given I go to page "/bridge?network=era-goerli" + When I click by text "Deposit" + When I click by "text" with "Your zkSync Era Testnet account" value + Then Element with "text" "Bridge to" should be "visible" + When I fill the input field contains "placeholder" type "Address or ENS or contact name" value with "0x52B6d10d7d865B3d4103f8809AA3521288568f46" text + When I click by text "0x52B6...f46" + Then Element with "text" "zkSync Era Testnet address" should be "visible" + Then Element with "text" "0x52B6...f46" should be "visible" + + @id1598 + Scenario: Check the Bridge artifacts on Deposit: a wallet is not connected + Given I'm logged out + Given I go to page "/bridge?network=era-goerli" + Then Element with "text" "Bridge" should be "visible" + When I click by text "Deposit" + Then Element with "text" " Connect wallet " should be "visible" + Then Element with "text" " Connect wallet " should be "clickable" + Then Element with "testId" "token-dropDown" should be "visible" + Then Element with "testId" "token-dropDown" should be "clickable" + Then Element with "text" "Connect wallet to see balance" should be "visible" + Then Element with "placeholder" "0" should be "visible" + Then Element with "xpath" "//*[contains(@class,'solid') and text()=' Connect wallet ']" should be "visible" + Then Element with "xpath" "//*[contains(@class,'solid') and text()=' Connect wallet ']" should be "clickable" + \ No newline at end of file diff --git a/tests/e2e/features/artifacts/bridgePage/artifacts.feature b/tests/e2e/features/artifacts/bridgePage/artifacts-withdraw.feature similarity index 72% rename from tests/e2e/features/artifacts/bridgePage/artifacts.feature rename to tests/e2e/features/artifacts/bridgePage/artifacts-withdraw.feature index 280a8759..a827bf70 100644 --- a/tests/e2e/features/artifacts/bridgePage/artifacts.feature +++ b/tests/e2e/features/artifacts/bridgePage/artifacts-withdraw.feature @@ -126,7 +126,6 @@ Feature: Bridge Then Element with "testId" "token-dropDown" should be "clickable" Then Element with "text" "Connect wallet to see balance" should be "visible" Then Element with "placeholder" "0" should be "visible" - Then Element with "partial class and text" "0" should be "visible" Then Element with "xpath" "//*[contains(@class,'solid') and text()=' Connect wallet ']" should be "visible" Then Element with "xpath" "//*[contains(@class,'solid') and text()=' Connect wallet ']" should be "clickable" @@ -141,67 +140,7 @@ Feature: Bridge Then Element with "text" "Ethereum Goerli Testnet address" should be "visible" Then Element with "text" "0x9CC8...eB8" should be "visible" - @id756 - Scenario: Check the Bridge artifacts on Deposit (Testnet) - Given I go to page "/bridge?network=era-goerli" - Then Element with "text" "Bridge" should be "visible" - Then Element with "text" "Deposit" should be "visible" - Then Element with "text" "Withdraw" should be "visible" - Then Element with "text" "From" should be "visible" - Then Element with "text" "Ethereum Goerli Testnet" should be "visible" - Then Element with "class" "account-button" should be "visible" - Then Element with "class" "account-button" should be "clickable" - Then Element with "testId" "token-dropDown" should be "visible" - Then Element with "testId" "token-dropDown" should be "clickable" - Then Element with "partial string" "Balance:" should be "visible" - Then Element with "id" "amount-input" should be "visible" - Then Element with "id" "amount-input" should be "clickable" - Then Element with "text" " Max " should be "visible" - Then Element with "text" " Max " should be "clickable" - #Block - Then Element with "text" "Your zkSync Era Testnet account" should be "visible" - Then Element with "text" "Your zkSync Era Testnet account" should be "clickable" - Then Element with "text" "0x2CF4...75d" should be "visible" - Then Element with "text" "0x2CF4...75d" should be "clickable" - Then Element with "class" "address-avatar address-card-avatar" should be "visible" - Then Element with "partial src" "eth.svg" should be "visible" - #Fee block - Then Element with "testId" "fee-amount" should be "visible" - Then Element with "partial string" "$" should be "visible" - Then Element with "class" "circle" should be "enabled" - Then Element with "text" "ETH" should be "visible" - Then Element with "type" "submit" should be "visible" - # Bottom block part - Then Element with "string" "Arriving in ~15 minutes" should be "visible" - Then Element with "type" "submit" should be "visible" - Then Element with "string" "Continue" should be "visible" - - @id1598 - Scenario: Check the Bridge artifacts on Deposit: a wallet is not connected - Given I'm logged out - Given I go to page "/bridge?network=era-goerli" - Then Element with "text" "Bridge" should be "visible" - When I click by text "Deposit" - Then Element with "text" " Connect wallet " should be "visible" - Then Element with "text" " Connect wallet " should be "clickable" - Then Element with "testId" "token-dropDown" should be "visible" - Then Element with "testId" "token-dropDown" should be "clickable" - Then Element with "text" "Connect wallet to see balance" should be "visible" - Then Element with "placeholder" "0" should be "visible" - Then Element with "partial class and text" "0" should be "visible" - Then Element with "xpath" "//*[contains(@class,'solid') and text()=' Connect wallet ']" should be "visible" - Then Element with "xpath" "//*[contains(@class,'solid') and text()=' Connect wallet ']" should be "clickable" - - @id1611 - Scenario: Check the editing recipient address in Bridge (Deposit) - Given I go to page "/bridge?network=era-goerli" - When I click by text "Deposit" - When I click by "text" with "Your zkSync Era Testnet account" value - Then Element with "text" "Bridge to" should be "visible" - When I fill the input field contains "placeholder" type "Address or ENS or contact name" value with "0x52B6d10d7d865B3d4103f8809AA3521288568f46" text - When I click by text "0x52B6...f46" - Then Element with "text" "zkSync Era Testnet address" should be "visible" - Then Element with "text" "0x52B6...f46" should be "visible" + @id1605:I @testnet Scenario Outline: Check redirection for the Bridge "View on Explorer" links (Testnet) diff --git a/tests/e2e/features/artifacts/depositPage/artifacts-deposits.feature b/tests/e2e/features/artifacts/depositPage/artifacts-deposits.feature index cbb109f1..a3990a1c 100644 --- a/tests/e2e/features/artifacts/depositPage/artifacts-deposits.feature +++ b/tests/e2e/features/artifacts/depositPage/artifacts-deposits.feature @@ -275,7 +275,7 @@ Feature: Artifacts - UI Then Element with "partial text" "Max" should be "visible" Then Element with "partial text" "Max" should be "clickable" # Check hover tooltip - Then Element with "partial title" "Your max amount is" should be "visible" + Then Element with "class" "amount-input-max-button" should be "visible" #Get the Max input value (Step to receive max value for comparison) When I choose "ETH" as token and insert "100000000" as amount When I save Max Balance Error Value