@nice-digital/wdio-cucumber-steps
Version:
Shared step definitions for Cucumber JS BDD tests in WebdriverIO
19 lines • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.login = void 0;
/**
* Log in to nice accounts
* @param {string} usernameEnvVar The name of the environment variables with the email address used to sign in to NICE Accounts
* @param {string} passwordEnvVar The name of the environment variables with the password used to sign in to NICE Accounts
*/
async function login(usernameEnvVar, passwordEnvVar) {
const username = process.env[usernameEnvVar], password = process.env[passwordEnvVar], emailInputElement = await $("body #Email"), passwordInputElement = await $("body #Password"), signInButton = await $("button[type='submit']");
if (!username || !password)
throw "Username and password environments variables for NICE accounts were empty";
await emailInputElement.waitForDisplayed({ timeout: 4000 });
await emailInputElement.setValue(username);
await passwordInputElement.setValue(password);
await signInButton.click();
}
exports.login = login;
//# sourceMappingURL=login.js.map