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

31 lines (25 loc) 1.26 kB
"use strict"; const { BASE_URL } = require("../../../../src/reuse/constants.ts"); const { handleCookiesConsent } = require("../../../helper/utils"); describe("browser - switchToIframe", function () { let elem; it("Preparation", async function () { //keep latest demo kit version due to iframes here await common.navigation.navigateToUrl(`${BASE_URL}/#/entity/sap.m.Dialog/sample/sap.m.sample.Dialog`); await handleCookiesConsent(); }); it("Execution & Verification", async function () { elem = await $("iframe[id='sampleFrame']"); await nonUi5.userInteraction.scrollToElement(elem); await util.browser.switchToIframe("iframe[id='sampleFrame']"); }); }); describe("browser - switchToIframe - error case", function () { it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/#/entity/sap.suite.ui.commons.imageeditor/sample/sap.suite.ui.commons.sample.ImageEditorContainer`); await handleCookiesConsent(); }); it("Execution & Verification", async function () { await expect(util.browser.switchToIframe("iframe[id*='__uploader']")).rejects.toThrow(`Function 'switchToIframe' failed with: element ("iframe[id*='__uploader']") still not displayed after 30000ms`); }); });