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

41 lines 1.71 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Navigation = void 0; const verboseLogger_1 = require("../../helper/verboseLogger"); const errorHandler_1 = __importDefault(require("../../helper/errorHandler")); /** * @class navigation * @memberof nonUi5 */ class Navigation { vlf = new verboseLogger_1.VerboseLoggerFactory("nonUi5", "navigation"); ErrorHandler = new errorHandler_1.default(); /** * @function navigateToApplication * @memberOf nonUi5.navigation * @description Navigates to the application via the passed relative reference. The path will be added to the baseUrl maintained in the config. * @param {String} relativeReference - Relative reference of an application (path, query and fragment) * @param {Boolean} [refresh=true] - Refresh the page after navigation. * @example await nonUi5.navigation.navigateToApplication("categories"); */ async navigateToApplication(relativeReference, refresh = true) { const vl = this.vlf.initLog(this.navigateToApplication); try { await browser.navigateTo(`${browser.config.baseUrl}/${relativeReference}`); await util.browser.logCurrentUrl(); if (refresh) { vl.log("Refreshing the page"); await util.browser.refresh(); } } catch (error) { this.ErrorHandler.logException(error); } } } exports.Navigation = Navigation; exports.default = new Navigation(); //# sourceMappingURL=navigation.js.map