diff --git a/packages/web/e2e/pages/transactions-page.ts b/packages/web/e2e/pages/transactions-page.ts index d3ff0d68be..df0154a146 100644 --- a/packages/web/e2e/pages/transactions-page.ts +++ b/packages/web/e2e/pages/transactions-page.ts @@ -8,6 +8,7 @@ export class TransactionsPage extends BasePage { readonly viewExplorerLink: Locator; readonly closeTransactionBtn: Locator; readonly page: Page; + readonly claimAndClose: Locator; constructor(page: Page) { super(page); @@ -15,6 +16,10 @@ export class TransactionsPage extends BasePage { this.transactionRow = page.locator('//div/p[.="Swapped"]'); this.viewExplorerLink = page.locator('//a/span["View on explorer"]/..'); this.closeTransactionBtn = page.getByLabel("Close").nth(1); + this.claimAndClose = page.getByRole("button", { + name: "Claim and close", + exact: true, + }); } async open() { @@ -101,4 +106,25 @@ export class TransactionsPage extends BasePage { visible: true, }); } + + async claimAndCloseAny(context: BrowserContext) { + await this.claimAndClose.first().click(); + const pageApprove = context.waitForEvent("page"); + const approvePage = await pageApprove; + await approvePage.waitForLoadState(); + const approvePageTitle = approvePage.url(); + console.log("Approve page is opened at: " + approvePageTitle); + const approveBtn = approvePage.getByRole("button", { + name: "Approve", + }); + await expect(approveBtn).toBeEnabled(); + const msgContentAmount = await approvePage + .getByText("Execute contract") + .textContent(); + console.log("Wallet is approving this msg: \n" + msgContentAmount); + // Approve trx + await approveBtn.click(); + // wait for trx confirmation + await this.page.waitForTimeout(2000); + } } diff --git a/packages/web/e2e/tests/monitoring.wallet.spec.ts b/packages/web/e2e/tests/monitoring.wallet.spec.ts index 06484f3605..2b4d24d9fe 100644 --- a/packages/web/e2e/tests/monitoring.wallet.spec.ts +++ b/packages/web/e2e/tests/monitoring.wallet.spec.ts @@ -107,7 +107,7 @@ test.describe("Test Filled Order feature", () => { await tradePage.goto(); await tradePage.openSellTab(); await tradePage.selectAsset(name); - await tradePage.clickMaxAmountButton(); + await tradePage.enterAmount("0.49"); const { msgContentAmount } = await tradePage.sellAndGetWalletMsg(context); expect(msgContentAmount).toBeTruthy(); expect(msgContentAmount).toContain("type: osmosis/poolmanager/");