Skip to content

Commit

Permalink
Add swapping
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexChetverov committed Nov 15, 2023
1 parent 3428538 commit c7f9258
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions test/microapps-ui-xcm/microapps-ui-main.accounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ describe.each`
await swap.waitForSwapButtonEnabled();
const isSwapEnabled = await swap.isSwapButtonEnabled();
expect(isSwapEnabled).toBeTruthy();
await swap.clickSwapButton();
await waitForMicroappsActionNotification(
driver,
mangata,
kusama,
TransactionType.Swap,
2,
);
});

test("Add MGX-KSM pool liquidity by account type " + accType, async () => {
Expand Down
7 changes: 6 additions & 1 deletion utils/frontend/microapps-pages/Swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class Swap {
await clickElement(this.driver, switchButton);
}

async isFirsttokenSelectorDisplayed() {
async isFirstTokenSelectorDisplayed() {
const firstTokenSelector = buildDataTestIdXpath(
DIV_FIRST_TOKEN_SELECTOR_CONTENT,
);
Expand Down Expand Up @@ -144,6 +144,11 @@ export class Swap {
).isEnabled();
}

async clickSwapButton() {
const firstTokenSelector = buildDataTestIdXpath(BTN_SUBMIT_SWAP);
await (await this.driver.findElement(By.xpath(firstTokenSelector))).click();
}

async pickGetToken(tokenName: string) {
const selectSecondToken = buildDataTestIdXpath(BTN_SELECT_SECOND_TOKEN);
await clickElement(this.driver, selectSecondToken);
Expand Down

0 comments on commit c7f9258

Please sign in to comment.