@sap_oss/wdio-qmate-service
Version:
[](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[](http
40 lines (33 loc) • 1.75 kB
JavaScript
;
const { BASE_URL } = require("../../../../src/reuse/constants.ts");
// describe("element - isPresent - list item element", function () {
// it("Preparation", async function () {
// await common.navigation.navigateToUrl(`${BASE_URL}/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories`);
// });
// it("Execution & Verification", async function () {
// const itemElement = await nonUi5.element.getByCss(".sapMSLITitleOnly=Computer System Accessories");
// const isPresent = await nonUi5.element.isPresent(itemElement);
// await common.assertion.expectTrue(isPresent);
// });
// });
describe("element - isPresent - hidden element", function () {
it("Preparation", async function () {
await common.navigation.navigateToUrl(`${BASE_URL}/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories`);
});
it("Execution & Verification", async function () {
const hiddenElements = await nonUi5.element.getAll(".sapUiInvisibleText");
common.assertion.expectDefined(hiddenElements);
common.assertion.expectDefined(hiddenElements.length);
const isPresent = await nonUi5.element.isPresent(hiddenElements[0]);
await common.assertion.expectTrue(isPresent);
});
});
// describe("element - isPresent - wrong element", function () {
// it("Preparation", async function () {
// await common.navigation.navigateToUrl(`${BASE_URL}/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories`);
// });
// it("Execution & Verification", async function () {
// await expect(nonUi5.element.isPresent(".sapUiInvisibleText"))
// .rejects.toThrow(/not a function/);
// });
// });