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

16 lines (12 loc) 838 B
import {PageConfigTypes} from "../../../custom-types/pageConfig-types"; import {CustomExpect} from "../../common-helpers/custom-expect"; import {browser, $, $$, expect} from '@wdio/globals' export default async function (pageConfig1: PageConfigTypes, falseCase: boolean, pageConfig2: PageConfigTypes) { const text1 = await $(pageConfig1.selector).getText(); const text2 = await $(pageConfig2.selector).getText(); if (falseCase) { CustomExpect.expectNotToEqual(text1, text2, `Text of element "${pageConfig1.pageId}.${pageConfig1.elementKey}" and "${pageConfig2.pageId}.${pageConfig2.elementKey}" are equal`) } else { CustomExpect.expectToEqual(text1, text2, `Text of element "${pageConfig1.pageId}.${pageConfig1.elementKey}" and "${pageConfig2.pageId}.${pageConfig2.elementKey}" are not equal`) } };