UNPKG

tlc-core-automation-framework-v3-wdio-v9

Version:

Background: - We are following multi-layer automation framework architecture using webdriver.io + cucumber + typescript This core framework has been implemented with generic utility functions and cucumber steps, which can be easily consumed by another fra

24 lines (21 loc) 864 B
/** * Check if a modal was opened * @param {String} modalType The type of modal that is expected (alertbox, * confirmbox or prompt) * @param {String} falseCase Whether to check if the modal was opened or not */ import {CustomExpect} from "../../common-helpers/custom-expect"; import {browser, $, $$, expect} from '@wdio/globals' // export default async function (modalType: 'alertbox' | 'confirmbox' | 'prompt', falseCase: boolean) { export default async function (falseCase: boolean) { // /** // * The text of the prompt // * @type {String} // */ let promptText = await browser.getAlertText(); if (falseCase) { CustomExpect.expectToEqual(promptText, null, `Modal text is not NULL`); } else { CustomExpect.expectNotToEqual(promptText, null, `Modal text is NULL`); } };