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