Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New FE promo popup adjustments #484

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/microapps-prod/microapps-prod-main.swap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from "../../utils/frontend/microapps-utils/Handlers";
import { Swap } from "../../utils/frontend/microapps-pages/Swap";

jest.retryTimes(1);
jest.setTimeout(FIVE_MIN);
jest.spyOn(console, "log").mockImplementation(jest.fn());
let driver: WebDriver;
Expand Down
19 changes: 19 additions & 0 deletions utils/frontend/rollup-pages/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
clickElement,
elementExists,
isDisplayed,
waitForElementVisible,
} from "../utils/Helper";

const DIV_MAIN_APP = "app-layout";
Expand Down Expand Up @@ -47,4 +48,22 @@ export class Main {
//Button not found - no action performed.
}
}

async skipMailerIframe() {
const iframeXpath = "//Iframe";
try {
await waitForElementVisible(this.driver, iframeXpath, 10000);
} catch (error) {
//no popup
}
const isIframeDisplayed = await isDisplayed(this.driver, iframeXpath);
if (isIframeDisplayed) {
this.driver.switchTo().frame(0);
await clickElement(this.driver, "//button[@aria-label='Close']");
const handle = await this.driver.getAllWindowHandles();
const iterator = handle.entries();
const value = iterator.next().value;
await this.driver.switchTo().window(value[1]);
}
}
}
1 change: 1 addition & 0 deletions utils/frontend/rollup-utils/Handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export async function setupPage(driver: WebDriver) {
const appLoaded = await mainPage.isAppLoaded();
expect(appLoaded).toBeTruthy();
await mainPage.skipWelcomeMessage();
await mainPage.skipMailerIframe();
}

export async function setupPageWithState(driver: WebDriver, acc_name: string) {
Expand Down
Loading