Skip to content

Commit

Permalink
sell amount
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-dubinin committed Aug 28, 2024
1 parent fe13158 commit b7fd04f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions packages/web/e2e/pages/transactions-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ export class TransactionsPage extends BasePage {
readonly viewExplorerLink: Locator;
readonly closeTransactionBtn: Locator;
readonly page: Page;
readonly claimAndClose: Locator;

constructor(page: Page) {
super(page);
this.page = page;
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() {
Expand Down Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion packages/web/e2e/tests/monitoring.wallet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/");
Expand Down

0 comments on commit b7fd04f

Please sign in to comment.