UNPKG

@sap_oss/wdio-qmate-service

Version:

[![REUSE status](https://api.reuse.software/badge/github.com/SAP/wdio-qmate-service)](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[![Node.js CI](https://github.com/SAP/wdio-qmate-service/actions/workflows/node.js.yml/badge.svg)](http

32 lines (24 loc) 1.04 kB
"use strict"; const { handleCookiesConsent } = require("../../../helper/utils"); describe("element - isPresentByXPath", function () { let linkBtn; it("Preparation", async function () { await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/1.96.27/"); await handleCookiesConsent(); }); it("Execution & Verification", async function () { linkBtn = "//span[contains(text(),'API Reference')]"; const isPresented = await nonUi5.element.isPresentByXPath(linkBtn); common.assertion.expectTrue(isPresented); }); }); describe("element - isPresentByXPath with wrong selector and catch error", function () { it("Preparation", async function () { await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/1.96.27/"); await handleCookiesConsent(); }); it("Execution & Verification", async function () { const isPresented = await nonUi5.element.isPresentByXPath("//span[contains(text(),'Wrong Text')]", 0, 1000); common.assertion.expectFalse(isPresented); }); });