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

82 lines (66 loc) 2.8 kB
"use strict"; const { BASE_URL } = require("../../../../src/reuse/constants.ts"); const { validateChecked } = require("./helper"); const tableSelector = { elementProperties: { viewName: "mycompany.myapp.MyWorklistApp.view.Worklist", metadata: "sap.m.Table", id: "container-MyWorklistApp---worklist--table" } }; const checkBoxSelector = (product) => { return { elementProperties: { viewName: "mycompany.myapp.MyWorklistApp.view.Worklist", metadata: "sap.m.CheckBox", bindingContextPath: product } }; }; describe("table - selectRowByIndex - demo kit - index", function () { it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/test-resources/sap/m/demokit/tutorial/worklist/07/webapp/test/mockServer.html?sap-ui-theme=sap_horizon_dark`); }); it("Execution (Index 0)", async function () { const rowIndex = 0; await ui5.table.selectRowByIndex(tableSelector, rowIndex); }); it("Verification (Index 0)", async function () { const isSelected = await ui5.element.getPropertyValue(checkBoxSelector("/Products*15)"), "selected"); await common.assertion.expectEqual(isSelected, true); }); it("Execution (Index 4)", async function () { const rowIndex = 4; await ui5.table.selectRowByIndex(tableSelector, rowIndex); }); it("Verification (Index 4)", async function () { const isSelected = await ui5.element.getPropertyValue(checkBoxSelector("/Products*2)"), "selected"); await common.assertion.expectEqual(isSelected, true); }); }); describe("table - selectRowByIndex - demo kit - already selected row remains selected", function () { const rowIndex = 0; it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/test-resources/sap/m/demokit/tutorial/worklist/07/webapp/test/mockServer.html?sap-ui-theme=sap_horizon_dark`); await ui5.table.selectRowByIndex(tableSelector, rowIndex); await validateChecked(checkBoxSelector("/Products*15)")); }); it("Execution", async function () { await ui5.table.selectRowByIndex(tableSelector, rowIndex); }); it("Verification", async function () { await validateChecked(checkBoxSelector("/Products*15)")); }); }); describe("table - selectRowByIndex - demo kit - passing id", function () { const rowIndex = 0; it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/test-resources/sap/m/demokit/tutorial/worklist/07/webapp/test/mockServer.html?sap-ui-theme=sap_horizon_dark`); }); it("Execution", async function () { await ui5.table.selectRowByIndex(tableSelector.elementProperties.id, rowIndex); }); it("Verification", async function () { await validateChecked(checkBoxSelector("/Products*15)")); }); });