Integration tests sign in by sending enter key

This commit is contained in:
BryceLTaylor 2021-11-19 09:43:02 -05:00
parent 6520a5f434
commit ec60e53be2

View file

@ -3,11 +3,12 @@
const SeleniumHelper = require('./selenium-helpers.js');
const {
clickText,
findByXpath,
clickXpath,
clickButton,
buildDriver,
clickButton,
clickText,
clickXpath,
findByXpath,
getKey,
signIn,
waitUntilVisible
} = new SeleniumHelper();
@ -108,8 +109,7 @@ describe('www-integration sign-in-and-out', () => {
await driver.get(scratchr2url);
await clickXpath('//li[@class="sign-in dropdown"]/span');
let name = await findByXpath('//input[@id="login_dropdown_username"]');
await name.sendKeys(nonsenseUsername);
await clickButton('Sign in');
await name.sendKeys(nonsenseUsername + getKey('ENTER'));
// find error
let error = await findByXpath('//form[@id="login"]//div[@class="error"]');
@ -126,8 +126,7 @@ describe('www-integration sign-in-and-out', () => {
let name = await findByXpath('//input[@id="login_dropdown_username"]');
await name.sendKeys(nonsenseUsername);
let word = await findByXpath('//input[@name="password"]');
await word.sendKeys(password);
await clickButton('Sign in');
await word.sendKeys(password + getKey('ENTER'));
// find error
let error = await findByXpath('//form[@id="login"]//div[@class="error"]');
@ -145,8 +144,7 @@ describe('www-integration sign-in-and-out', () => {
let name = await findByXpath('//input[@id="login_dropdown_username"]');
await name.sendKeys(username);
let word = await findByXpath('//input[@name="password"]');
await word.sendKeys(nonsensePassword);
await clickButton('Sign in');
await word.sendKeys(nonsensePassword + getKey('ENTER'));
// find error
let error = await findByXpath('//form[@id="login"]//div[@class="error"]');