UNPKG

@nice-digital/wdio-cucumber-steps

Version:

Shared step definitions for Cucumber JS BDD tests in WebdriverIO

24 lines 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.accountsLogin = void 0; const login_1 = require("./login"); const nice_accounts_1 = require("../lib/nice-accounts"); /** * Log in to particular version of nice accounts indepentendly of TopHat * @param environment The domain of accounts to use to sign to nice accounts (beta, live or test) * @param usernameEnvVar The name of the environment variable with the email address used to sign in to Nice Accounts * @param passwordEnvVar The name of the environment variable with the password used to sign in to Nice Accounts */ async function accountsLogin(environment, usernameEnvVar, passwordEnvVar) { if (await (0, nice_accounts_1.isLoggedIn)()) return; const accountsUrl = (0, nice_accounts_1.getNICEAccountsUrl)(environment); if (accountsUrl) { await browser.url(accountsUrl); (0, login_1.login)(usernameEnvVar, passwordEnvVar); } else throw "Invalid NICE Accounts URL/environment"; } exports.accountsLogin = accountsLogin; //# sourceMappingURL=accountsLogin.js.map