Skip to content

Commit

Permalink
Revert "test: refactoring"
Browse files Browse the repository at this point in the history
This reverts commit 4214880.
  • Loading branch information
pcheremu committed Aug 2, 2023
1 parent 352dba0 commit 4176256
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 0 additions & 4 deletions tests/e2e/src/pages/main.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ export class MainPage extends BasePage {
return `${this.byTestId}network-switcher`;
}

get confirmFeeChange() {
return "//*[@class='alert-body']//*[contains(string(), 'Confirm')]";
}

async selectTransaction(transactionType: string) {
try {
let route: string;
Expand Down
9 changes: 5 additions & 4 deletions tests/e2e/src/pages/metamask.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { setTimeout } from "timers/promises";

import { BasePage } from "./base.page";
import { MainPage } from "./main.page";
import { Extension } from "../data/data";
import { depositTag, Helper } from "../helpers/helper";
import { config, wallet } from "../support/config";
Expand Down Expand Up @@ -40,6 +39,9 @@ export class MetamaskPage extends BasePage {
return "//*[@class='alert-body']//*[contains(text(), 'Fee has changed')]";
}

get confirmFeeChange() {
return "//*[@class='alert-body']//*[contains(., 'Confirm')]";
}
get saveFeeBtn() {
return "//*[@class='popover-container']//button";
}
Expand Down Expand Up @@ -212,11 +214,10 @@ export class MetamaskPage extends BasePage {
}

async isFeeAlert(helper: Helper, element: string) {
const mainPage = await new MainPage(this.world);
const feeAlert = await helper.checkElementVisible(this.feeChangerAlert);
if (feeAlert) {
await helper.checkElementVisible(mainPage.confirmFeeChange);
await this.world.page?.locator(mainPage.confirmFeeChange).first().click();
await helper.checkElementVisible(this.confirmFeeChange);
await this.world.page?.locator(this.confirmFeeChange).first().click();
await this.catchPopUpByClick(element);
return true;
}
Expand Down

0 comments on commit 4176256

Please sign in to comment.