Unverified Commit d3719d07 authored by Ray Schamp's avatar Ray Schamp Committed by GitHub

Merge pull request #1624 from jwzimmer/issue/fix-failing-footer-links

Updated selenium & chromedriver versions, which fixed test failures i…
parents 9b55a403 8b61ce72
{ {
"testDependencies": { "devDependencies": {
"selenium-webdriver": "2.44.0", "selenium-webdriver": "2.45.0",
"chromedriver": "2.27.0" "chromedriver": "2.33.0"
} }
} }
...@@ -4,20 +4,20 @@ ...@@ -4,20 +4,20 @@
* Test cases: https://github.com/LLK/scratch-www/wiki/Most-Important-Workflows * Test cases: https://github.com/LLK/scratch-www/wiki/Most-Important-Workflows
*/ */
require('chromedriver');
var tap = require('tap'); var tap = require('tap');
var seleniumWebdriver = require('selenium-webdriver');
// Selenium's promise driver will be deprecated, so we should not rely on it const {
seleniumWebdriver.SELENIUM_PROMISE_MANAGER=0; driver,
webdriver
} = require('../../helpers/selenium-helpers.js');
//chrome driver // Selenium's promise driver will be deprecated, so we should not rely on it
var driver = new seleniumWebdriver.Builder().withCapabilities(seleniumWebdriver.Capabilities.chrome()).build(); webdriver.SELENIUM_PROMISE_MANAGER=0;
var rootUrl = process.env.ROOT_URL || 'https://scratch.ly'; var rootUrl = process.env.ROOT_URL || 'https://scratch.ly';
//timeout for each test; timeout for suite set at command line level //timeout for each test; timeout for suite set at command line level
var options = { timeout: 20000 }; var options = { timeout: 30000 };
//number of tests in the plan //number of tests in the plan
tap.plan(25); tap.plan(25);
...@@ -33,20 +33,16 @@ tap.beforeEach(function () { ...@@ -33,20 +33,16 @@ tap.beforeEach(function () {
}); });
// Function clicks the link and returns the url of the resulting page // Function clicks the link and returns the url of the resulting page
function clickFooterLinks ( linkText ) {
// Not sure if I need this first wait - maybe it solved intermittent initial failure problem? function clickFooterLinks (linkText) {
return driver.wait(seleniumWebdriver.until.elementLocated(seleniumWebdriver.By.id('view'))) return driver.wait(webdriver.until.elementLocated(webdriver.By.id('footer')))
.then( function () { .then( function (element) {
return driver.wait(seleniumWebdriver.until.elementLocated(seleniumWebdriver.By return element.findElement(webdriver.By.linkText(linkText)); })
.id('footer'))) .then( function (element) {
.then( function () { return element.click(); })
return driver.findElement(seleniumWebdriver.By.linkText(linkText)); }) .then(function () {
.then( function (element) { return driver.getCurrentUrl();
return element.click(); }) });
.then(function () {
return driver.getCurrentUrl();
});
});
} }
// ==== ABOUT SCRATCH column ==== // ==== ABOUT SCRATCH column ====
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment