From f80f48db8336d6087397ff3cbf05293987eee049 Mon Sep 17 00:00:00 2001 From: pcheremu Date: Thu, 7 Dec 2023 14:45:47 +0300 Subject: [PATCH] test: fix test with self option on mainnet --- .../app/tests/e2e/features/artifacts/artifactsSet3.feature | 2 +- packages/app/tests/e2e/src/pages/base.page.ts | 5 +++++ packages/app/tests/e2e/src/steps/blockexplorer.steps.ts | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature b/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature index cbf932c8cf..756b434993 100644 --- a/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature +++ b/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature @@ -117,7 +117,7 @@ Feature: Main Page @id382 @mainnet Scenario: Verify label "self" for Account info on Account page Given I go to page "/address/0x94124252B5D343AB6E950A15982599ee1AADE660" - # When I click by text "Show more transactions ->" + When I click by element with class "sr-only" and text "Next" Then Element with "text" "self" should be "visible" @id580 @id578 @id619 @testnet diff --git a/packages/app/tests/e2e/src/pages/base.page.ts b/packages/app/tests/e2e/src/pages/base.page.ts index 2111d0ac2b..cd83edf724 100644 --- a/packages/app/tests/e2e/src/pages/base.page.ts +++ b/packages/app/tests/e2e/src/pages/base.page.ts @@ -120,6 +120,11 @@ export class BasePage { return await element; } + async getElementByClassAndText(className: string, text: string) { + element = await this.world.page?.locator(`//*[@class='${className}' and contains(text(), '${text}')]`); + return await element; + } + async getNetworkLayer(testid: string, selectorType: string) { helper = new Helper(this.world); const dataLinkId = `//*[@class='transactions-data-link-network']`; diff --git a/packages/app/tests/e2e/src/steps/blockexplorer.steps.ts b/packages/app/tests/e2e/src/steps/blockexplorer.steps.ts index 507e977eab..e4110fda57 100644 --- a/packages/app/tests/e2e/src/steps/blockexplorer.steps.ts +++ b/packages/app/tests/e2e/src/steps/blockexplorer.steps.ts @@ -135,6 +135,13 @@ When("I click by element with partial href {string}", async function (this: ICus await element.click(); }); +When("I click by element with class {string} and text {string}", async function (this: ICustomWorld, className: string, text: string) { + basePage = new BasePage(this); + element = await basePage.getElementByClassAndText(className, text); + + await element.click(); +}); + When( "I click by element with partial href {string} and text {string}", async function (this: ICustomWorld, partialHref: string, text: string) {