From c7f925861c78e24086e635d1d86d763a33524178 Mon Sep 17 00:00:00 2001 From: AlexChetverov Date: Wed, 15 Nov 2023 12:43:44 +0400 Subject: [PATCH] Add swapping --- test/microapps-ui-xcm/microapps-ui-main.accounts.test.ts | 8 ++++++++ utils/frontend/microapps-pages/Swap.ts | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test/microapps-ui-xcm/microapps-ui-main.accounts.test.ts b/test/microapps-ui-xcm/microapps-ui-main.accounts.test.ts index 5ffcfa39d..905a2da25 100644 --- a/test/microapps-ui-xcm/microapps-ui-main.accounts.test.ts +++ b/test/microapps-ui-xcm/microapps-ui-main.accounts.test.ts @@ -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 () => { diff --git a/utils/frontend/microapps-pages/Swap.ts b/utils/frontend/microapps-pages/Swap.ts index 49138cacb..0d9be7542 100644 --- a/utils/frontend/microapps-pages/Swap.ts +++ b/utils/frontend/microapps-pages/Swap.ts @@ -62,7 +62,7 @@ export class Swap { await clickElement(this.driver, switchButton); } - async isFirsttokenSelectorDisplayed() { + async isFirstTokenSelectorDisplayed() { const firstTokenSelector = buildDataTestIdXpath( DIV_FIRST_TOKEN_SELECTOR_CONTENT, ); @@ -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);