mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Integration tests sign in by sending enter key
This commit is contained in:
parent
6520a5f434
commit
ec60e53be2
1 changed files with 8 additions and 10 deletions
|
@ -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"]');
|
||||
|
|
Loading…
Reference in a new issue