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

12 lines (10 loc) 604 B
import getCurrentUrl from "../action/getCurrentUrl"; import logger from "../../reporting-helpers/logger"; import {browser, $, $$, expect} from '@wdio/globals' export default async function (pageConfig: Record<string, string>, pageId: string): Promise<boolean> { const currentUrl = await getCurrentUrl(); logger.info(`The current URL : >>> ${currentUrl}`); const expectedUrl = (pageId.trim().toLowerCase() === "home") ? `${browser.options.baseUrl}/` : `${browser.options.baseUrl}/${pageId}`; logger.info(`The expected URL : >>> ${expectedUrl}`); return (currentUrl === expectedUrl) }