@sap_oss/wdio-qmate-service
Version:
[](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[](http
33 lines (25 loc) • 1.05 kB
JavaScript
;
const { BASE_URL } = require("../../../../src/reuse/constants.ts");
const { handleCookiesConsent } = require("../../../helper/utils");
describe("element - isPresentByXPath", function () {
let linkBtn;
it("Preparation", async function () {
await common.navigation.navigateToUrl(`${BASE_URL}/`);
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(`${BASE_URL}/`);
await handleCookiesConsent();
});
it("Execution & Verification", async function () {
const isPresented = await nonUi5.element.isPresentByXPath("//span[contains(text(),'Wrong Text')]", 0, 1000);
common.assertion.expectFalse(isPresented);
});
});