UNPKG

@nice-digital/wdio-cucumber-steps

Version:

Shared step definitions for Cucumber JS BDD tests in WebdriverIO

22 lines 943 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.tophatLogin = void 0; const login_1 = require("./login"); const nice_accounts_1 = require("../lib/nice-accounts"); /** * Log in to nice accounts by clicking on TopHat * @param {string} usernameEnvVar The email address used to sign in to Nice Accounts * @param {string} passwordEnvVar The password used to sign in to Nice Accounts */ async function tophatLogin(usernameEnvVar, passwordEnvVar) { if (await (0, nice_accounts_1.isLoggedIn)()) return; const topHatElement = await $(".nice-tophat"); // TopHat load via JS so won't always exist on page load await topHatElement.waitForExist(); const signInElement = await $("body #signin"); await signInElement.click(); (0, login_1.login)(usernameEnvVar, passwordEnvVar); } exports.tophatLogin = tophatLogin; //# sourceMappingURL=tophatLogIn.js.map