Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
straker committed Nov 25, 2020
1 parent 404710f commit d6b2365
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 25 deletions.
230 changes: 230 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"test": "npm run test:tsc && npm run test:unit",
"test:tsc": "tsc",
"test:unit": "karma start test/karma.conf.js",
"test:integration": "node test/integration/full/test-webdriver.js",
"test:integration": "start-server-and-test 'npm run start -- --silent' 9876 'node test/integration/full/test-webdriver.js'",
"test:examples": "node ./doc/examples/test-examples",
"test:locales": "mocha test/test-locales.js",
"test:rule-help-version": "mocha test/test-rule-help-version.js",
Expand Down Expand Up @@ -131,6 +131,7 @@
"sinon": "^7.5.0",
"sri-toolbox": "^0.2.0",
"standard-version": "^9.0.0",
"start-server-and-test": "^1.11.6",
"typedarray": "^0.0.6",
"typescript": "^3.5.3",
"uglify-js": "^3.4.4",
Expand Down
25 changes: 1 addition & 24 deletions test/integration/full/test-webdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@ var WebDriver = require('selenium-webdriver');
var chrome = require('selenium-webdriver/chrome');
var chromedriver = require('chromedriver');
var isCI = require('is-ci');
var execa = require('execa');

var args = process.argv.slice(2);

// start local server in the background
var startServer = execa('npm', ['run', 'start']);
startServer.stdout.pipe(process.stdout);

// allow running certain browsers through command line args
// (only one browser supported, run multiple times for more browsers)
var browser = 'chrome';
Expand Down Expand Up @@ -163,9 +158,6 @@ function buildWebDriver(browser) {
};
}

/**
* Start the integration tests
*/
function start(options) {
var driver;
var isMobile = false;
Expand Down Expand Up @@ -241,19 +233,4 @@ function start(options) {
});
}

// start the test once the sever is started
startServer.stdout.on('data', function(chunk) {
var str = chunk.toString();

// NOTE: this is specific from http-server. if we change the
// local server we will need to update this to match the
// server start output
if (str.includes('Starting up')) {
// give enough time to finish the startup before starting
// test
setTimeout(function() {
console.log('\nStarting integration test\n');
start({ browser: browser });
}, 500);
}
});
start({ browser: browser });

0 comments on commit d6b2365

Please sign in to comment.