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

39 lines (35 loc) 1.19 kB
"use strict"; describe("assertion - expectTextToBe", function () { it("Preparation", async function () { await browser.url("#/categories"); }); it("Execution & Verification", async function () { const selector = { "elementProperties": { "viewName": "sap.ui.demo.cart.view.Welcome", "metadata": "sap.m.Title", "text": [{ "path": "i18n>promotedTitle" }] } }; await ui5.assertion.expectTextToBe(selector, "Promoted Items"); }); }); describe("assertion - expectTextToBe with wrong selector", function () { it("Preparation", async function () { await browser.url("#/categories"); }); it("Execution & Verification", async function () { let wrongSelector = { "elementProperties": { "wrongData": "123" } }; await expect(ui5.assertion.expectTextToBe(wrongSelector, "Watch")) .rejects.toThrow(/uiControlExecuteLocator\(\): No visible elements found/); wrongSelector = 123; await expect(ui5.assertion.expectTextToBe(wrongSelector, "Watch")) .rejects.toThrow("Function 'expectTextToBe' failed with: Please provide a valid selector as argument."); }); });