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

67 lines (55 loc) 2.06 kB
const { handleCookiesConsent } = require("../../../helper/utils"); describe("userInteraction - check - checkbox (unchecked)", function () { const selector = { elementProperties: { viewName: "sap.m.sample.CheckBox.CheckBoxGroup", metadata: "sap.m.CheckBox", text: "Option" } }; it("Preparation", async function () { await browser.navigateTo("https://sapui5.hana.ondemand.com/1.96.27/#/entity/sap.m.CheckBox/sample/sap.m.sample.CheckBox"); await handleCookiesConsent(); }); it("Execution", async function () { await ui5.userInteraction.check(selector, 0, 60000); }); it("Verification", async function () { await ui5.assertion.expectAttributeToBe(selector, "selected", true); }); }); describe("userInteraction - check - checkbox (checked)", function () { const selector = { elementProperties: { viewName: "sap.m.sample.CheckBox.CheckBoxGroup", metadata: "sap.m.CheckBox", text: "Option a" } }; it("Preparation", async function () { await browser.navigateTo("https://sapui5.hana.ondemand.com/1.96.27/#/entity/sap.m.CheckBox/sample/sap.m.sample.CheckBox"); await handleCookiesConsent(); }); it("Execution", async function () { await ui5.userInteraction.check(selector, 0, 60000); }); it("Verification", async function () { await ui5.assertion.expectAttributeToBe(selector, "selected", true); }); }); describe("userInteraction - check - checkbox (error)", function () { const selector = { elementProperties: { viewName: "sap.m.sample.CheckBox.CheckBoxGroup", metadata: "sap.m.CheckBox", text: "_______INVALID_______" } }; it("Preparation", async function () { await browser.navigateTo("https://sapui5.hana.ondemand.com/1.96.27/#/entity/sap.m.CheckBox/sample/sap.m.sample.CheckBox"); await handleCookiesConsent(); }); it("Execution & Verification", async function () { await expect(ui5.userInteraction.check(selector, 0, 60000)).rejects.toThrow(/Function 'check' failed with:/); }); });