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

128 lines (115 loc) 3.81 kB
"use strict"; const { BASE_URL } = require("../../../../src/reuse/constants.ts"); const { handleCookiesConsent } = require("../../../helper/utils"); describe("element - getByChild - simple case", function () { let elem; it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable`); await handleCookiesConsent(); await util.browser.switchToIframe("[id='sampleFrame']"); }); it("Execution", async function () { const elementSelector = { elementProperties: { viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable", metadata: "sap.m.ColumnListItem" } }; const childSelector = { elementProperties: { viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable", metadata: "sap.m.Text", bindingContextPath: "/LineItemsSet*'5')", text: [ { path: "Dmbtr" }, { path: "Hwaer" }, { path: "/##@@requestCurrencyCodes" } ] } }; elem = await ui5.element.getByChild(elementSelector, childSelector); }); it("Verification", async function () { await nonUi5.assertion.expectAttributeToContain(elem, "clone4", "id"); }); }); describe("element - getByChild - with ignored nested selectors", function () { let elem; it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable`); await handleCookiesConsent(); await util.browser.switchToIframe("[id='sampleFrame']"); }); it("Execution", async function () { const elementSelector = { elementProperties: { viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable", metadata: "sap.m.ColumnListItem", bindingContextPath: "/LineItemsSet*'5')" }, descendantProperties: { viewName: "ABC", metadata: "DEF" } }; const childSelector = { elementProperties: { viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable", metadata: "sap.m.Text", bindingContextPath: "/LineItemsSet*'5')", text: [ { path: "Dmbtr" }, { path: "Hwaer" }, { path: "/##@@requestCurrencyCodes" } ] }, ancestorProperties: { viewName: "ABC", metadata: "DEF" } }; elem = await ui5.element.getByChild(elementSelector, childSelector); }); it("Verification", async function () { await nonUi5.assertion.expectAttributeToContain(elem, "clone", "id"); }); }); describe("element - getByChild - with inner nested selectors and index", function () { let elem; it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable`); await handleCookiesConsent(); await util.browser.switchToIframe("[id='sampleFrame']"); }); it("Execution", async function () { const elementSelector = { elementProperties: { viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable", metadata: "sap.m.ColumnListItem" } }; const childSelector = { elementProperties: { viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable", metadata: "sap.m.Text", text: "Yes" } }; elem = await ui5.element.getByChild(elementSelector, childSelector, 3); }); it("Verification", async function () { await nonUi5.assertion.expectAttributeToContain(elem, "clone4", "id"); }); });