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

53 lines (41 loc) 1.45 kB
"use strict"; const { BASE_URL } = require("../../../../src/reuse/constants.ts"); const { handleCookiesConsent } = require("../../../helper/utils"); describe("element - getById + expectToBeVisible", function () { let downloadBtn; it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/`); await handleCookiesConsent(); }); it("Execution", async function () { downloadBtn = await nonUi5.element.getById("sdk---app--apiMasterTab-text"); }); it("Verification", async function () { await nonUi5.assertion.expectToBeVisible(downloadBtn, 10000); }); }); describe("element - getById and catch error", function () { it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/`); await handleCookiesConsent(); }); it("Execution & Verification", async function () { await expect(nonUi5.element.getById("sdk---app--apiTab-text")) .rejects.toThrow("Function 'getById' failed"); }); }); describe("element - getById - error case, verify error stack", function () { it("Preparation", async function () { await common.navigation.navigateToUrl(`${BASE_URL}/`); await handleCookiesConsent(); }); it("Execution & Verification", async function () { try { await nonUi5.element.getById("sdk---app--apiTab-text"); } catch (error) { await expect(error.stack).toMatch(/at.*getById\.spec\.js/); } }); });