mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-21 10:18:13 -05:00
test: fix tests to not use chromedriver npm wrapper
This commit is contained in:
parent
84409fb569
commit
9e5ead4cc5
10 changed files with 3 additions and 25 deletions
|
@ -4,7 +4,9 @@
|
|||
* See this directory's package.json
|
||||
* TAP
|
||||
* In the scratch-www repo's package.json
|
||||
* A Chrome-compatible browser (Chrome, Chromium, etc.)
|
||||
* [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/)
|
||||
* Note: Chromedriver may come bundled with your browser, so you may not need to install it separately
|
||||
|
||||
# Running the tests
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const webdriver = require('selenium-webdriver');
|
||||
const bindAll = require('lodash.bindall');
|
||||
require('chromedriver');
|
||||
|
||||
const headless = process.env.SMOKE_HEADLESS || false;
|
||||
const remote = process.env.SMOKE_REMOTE || false;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* Test cases: https://github.com/LLK/scratch-www/wiki/Testing-Scratch-www#All_Test_Cases_Teacher_Join_Flow
|
||||
*/
|
||||
require('chromedriver');
|
||||
const seleniumWebdriver = require('selenium-webdriver');
|
||||
const tap = require('tap');
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* Test cases: https://github.com/LLK/scratch-www/wiki/Testing-Scratch-www#All_Test_Cases_Teacher_Join_Flow
|
||||
*/
|
||||
require('chromedriver');
|
||||
const seleniumWebdriver = require('selenium-webdriver');
|
||||
const tap = require('tap');
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* Test cases: https://github.com/LLK/scratch-www/wiki/Testing-Scratch-www#All_Test_Cases_Teacher_Join_Flow
|
||||
*/
|
||||
require('chromedriver');
|
||||
const seleniumWebdriver = require('selenium-webdriver');
|
||||
const tap = require('tap');
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* Test cases: https://github.com/LLK/scratch-www/wiki/Testing-Scratch-www#All_Test_Cases_Teacher_Join_Flow
|
||||
*/
|
||||
require('chromedriver');
|
||||
const seleniumWebdriver = require('selenium-webdriver');
|
||||
const tap = require('tap');
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* Test cases: https://github.com/LLK/scratch-www/wiki/Testing-Scratch-www#All_Test_Cases_Teacher_Join_Flow
|
||||
*/
|
||||
require('chromedriver');
|
||||
const seleniumWebdriver = require('selenium-webdriver');
|
||||
const tap = require('tap');
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* Test cases: https://github.com/LLK/scratch-www/wiki/Testing-Scratch-www#All_Test_Cases_Teacher_Join_Flow
|
||||
*/
|
||||
|
||||
require('chromedriver');
|
||||
const seleniumWebdriver = require('selenium-webdriver');
|
||||
const tap = require('tap');
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* Test cases: https://github.com/LLK/scratch-www/wiki/Testing-Scratch-www#All_Test_Cases_Teacher_Join_Flow
|
||||
*/
|
||||
require('chromedriver');
|
||||
const seleniumWebdriver = require('selenium-webdriver');
|
||||
const tap = require('tap');
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ jest.setTimeout(30000); // eslint-disable-line no-undef
|
|||
const webdriver = require('selenium-webdriver');
|
||||
const {PageLoadStrategy} = require('selenium-webdriver/lib/capabilities');
|
||||
const bindAll = require('lodash.bindall');
|
||||
require('chromedriver');
|
||||
const chromedriverVersion = require('chromedriver').version;
|
||||
|
||||
const headless = process.env.SMOKE_HEADLESS || false;
|
||||
const remote = process.env.SMOKE_REMOTE || false;
|
||||
|
@ -194,18 +192,6 @@ class SeleniumHelper {
|
|||
return driver;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string} The version of chromedriver being used.
|
||||
*/
|
||||
getChromeVersionNumber () {
|
||||
const versionFinder = /\d+\.\d+/;
|
||||
const versionArray = versionFinder.exec(chromedriverVersion);
|
||||
if (versionArray === null) {
|
||||
throw new Error('couldn\'t find version of chromedriver');
|
||||
}
|
||||
return versionArray[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a new webdriver instance using Sauce Labs.
|
||||
* You should probably use `buildDriver` instead.
|
||||
|
@ -215,13 +201,11 @@ class SeleniumHelper {
|
|||
* @returns {webdriver.ThenableWebDriver} The new webdriver instance.
|
||||
*/
|
||||
getSauceDriver (username, accessKey, name) {
|
||||
const chromeVersion = this.getChromeVersionNumber();
|
||||
// Driver configs can be generated with the Sauce Platform Configurator
|
||||
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
|
||||
const driverConfig = {
|
||||
browserName: 'chrome',
|
||||
platform: 'macOS 10.15',
|
||||
version: chromeVersion
|
||||
platform: 'macOS 10.15'
|
||||
};
|
||||
const driver = new webdriver.Builder()
|
||||
.withCapabilities({
|
||||
|
|
Loading…
Reference in a new issue