@sap_oss/wdio-qmate-service
Version:
[](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[](http
34 lines • 1.65 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const addLocatorCommands_1 = __importDefault(require("./utils/addLocatorCommands"));
const authHandler_1 = __importDefault(require("../../reuse/authenticator/authHandler"));
const Ui5ExtensionMocker_1 = require("./utils/Ui5ExtensionMocker");
/**
* Gets executed before test execution begins. At this point you can access to all global
* variables like `browser`. It is the perfect place to define custom commands.
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that are to be run
* @param {Object} browser instance of created browser/device session
*/
async function default_1(capabilities, specs, browser) {
// Add ui control selector & properties
await addLocatorCommands_1.default.addControlCommands();
await addLocatorCommands_1.default.addGetControlProperties();
await addLocatorCommands_1.default.addInBrowserHandling();
// Add ui control binding information
await addLocatorCommands_1.default.addGetBindingInfos();
//Add authenticators
await authHandler_1.default.attachAuthHandling();
if (shouldMockUi5Extension(browser)) {
await Ui5ExtensionMocker_1.Ui5ExtensionMocker.mockRequests();
}
}
;
function shouldMockUi5Extension(browser) {
return browser.config.qmate?.enableUi5ExtensionMocking !== false;
}
//# sourceMappingURL=before.js.map