Skip to content

Commit

Permalink
Merge pull request #1885 from BryceLTaylor/Selenium-Tests
Browse files Browse the repository at this point in the history
Remove Selenium smoke tests that sign in with no username
  • Loading branch information
BryceLTaylor committed May 15, 2018
2 parents fe1ef5a + 4e017d3 commit c6e4b2e
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions test/integration/smoke-testing/test-login-failures.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const test = tap.test;
var rootUrl = process.env.ROOT_URL || 'https://scratch.ly';
var url = rootUrl + '/users/' + username;

tap.plan(5);
tap.plan(3);

tap.tearDown(function () {
driver.quit();
Expand All @@ -27,50 +27,6 @@ tap.beforeEach(function () {
return driver.get(url);
});

/*
* This test fails sometimes because blank username eventually
* triggers the captcha page, which is a bug:
* https://github.com/LLK/scratchr2/issues/4762
*/
test('Trying to sign in with no username and no password using scratchr2 navbar', t => {
clickText('Sign in')
.then(() => clickButton('Sign in'))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/button[@type="submit"]')))
)
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/div[@class="error"]')))
)
.then(() => findByXpath('//form/div[@class="error"]'))
.then(element => element.getText())
.then(text => t.match(text, 'This field is required.',
'"This field is required" error should be displayed'))
.then(() => t.end());
});

/*
* This test fails sometimes because blank username eventually
* triggers the captcha page, which is a bug:
* https://github.com/LLK/scratchr2/issues/4762
*/
test('Trying to sign in with no username using scratchr2 navbar', t => {
clickText('Sign in')
.then(() => findByXpath('//input[@name="password"]'))
.then((element) => element.sendKeys(password))
.then(() => clickButton('Sign in'))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/button[@type="submit"]')))
)
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/div[@class="error"]')))
)
.then(() => findByXpath('//form/div[@class="error"]'))
.then((element) => element.getText())
.then((text) => t.match(text, 'This field is required.',
'"This field is required" error should be displayed'))
.then(() => t.end());
});

test('Trying to sign in with no password using scratchr2 navbar', t => {
var nonsenseusername = Math.random().toString(36)
.replace(/[^a-z]+/g, '')
Expand Down

0 comments on commit c6e4b2e

Please sign in to comment.