Skip to content

Commit

Permalink
test: fix test with self option on mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
pcheremu committed Dec 7, 2023
1 parent 9fc5a8b commit f80f48d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions packages/app/tests/e2e/src/pages/base.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']`;
Expand Down
7 changes: 7 additions & 0 deletions packages/app/tests/e2e/src/steps/blockexplorer.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check warning on line 138 in packages/app/tests/e2e/src/steps/blockexplorer.steps.ts

View workflow job for this annotation

GitHub Actions / Build and Test App

Replace `"I·click·by·element·with·class·***string***·and·text·***string***",` with `⏎··"I·click·by·element·with·class·***string***·and·text·***string***",⏎·`
basePage = new BasePage(this);

Check warning on line 139 in packages/app/tests/e2e/src/steps/blockexplorer.steps.ts

View workflow job for this annotation

GitHub Actions / Build and Test App

Insert `··`
element = await basePage.getElementByClassAndText(className, text);

Check warning on line 140 in packages/app/tests/e2e/src/steps/blockexplorer.steps.ts

View workflow job for this annotation

GitHub Actions / Build and Test App

Insert `··`

await element.click();

Check warning on line 142 in packages/app/tests/e2e/src/steps/blockexplorer.steps.ts

View workflow job for this annotation

GitHub Actions / Build and Test App

Insert `··`
});

Check warning on line 143 in packages/app/tests/e2e/src/steps/blockexplorer.steps.ts

View workflow job for this annotation

GitHub Actions / Build and Test App

Replace `***` with `··***⏎`

When(
"I click by element with partial href {string} and text {string}",
async function (this: ICustomWorld, partialHref: string, text: string) {
Expand Down

0 comments on commit f80f48d

Please sign in to comment.