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

43 lines (38 loc) 1.74 kB
"use strict"; const { handleCookiesConsent } = require("../../../helper/utils"); describe("assertion - expectMessageToastTextToBe - no message toast (unhappy case)", function () { it("Preparation", async function () { await browser.navigateTo("https://sapui5.hana.ondemand.com/1.96.27/#/entity/sap.m.MessageToast/sample/sap.m.sample.MessageToast"); await handleCookiesConsent(); }); it("Execution & Verification", async function () { const text = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy\r\n eirmod."; await browser.keys("Escape"); // To skip Cookie Consent await expect(ui5.assertion.expectMessageToastTextToBe(text, 3000)) .rejects.toThrow(/Element with XPath/); }); }); describe("assertion - expectMessageToastTextToBe", function () { it("Preparation", async function () { await browser.navigateTo("https://sapui5.hana.ondemand.com/1.96.27/#/entity/sap.m.MessageToast/sample/sap.m.sample.MessageToast"); await handleCookiesConsent(); }); it("Execution", async function () { const selector = { "elementProperties": { "viewName": "sap.m.sample.MessageToast.view.MessageToast", "metadata": "sap.m.Button" } }; await browser.keys("Escape"); // To skip Cookie Consent await ui5.userInteraction.click(selector); }); it("Verification", async function () { await ui5.assertion.expectMessageToastTextToBe("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy\r\n eirmod.", 3000); await ui5.assertion.expectMessageToastTextToBe("Lorem ipsum", 3000); await expect(ui5.assertion.expectMessageToastTextToBe("Wrong text", 3000)) .rejects.toThrow(/Element with XPath/); }); });