@sap_oss/wdio-qmate-service
Version:
[](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[](http
32 lines (24 loc) • 1.04 kB
JavaScript
;
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);
});
});