diff --git a/appveyor.yml b/appveyor.yml index a6e41fb..f8e8861 100755 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,9 +27,8 @@ artifacts: clone_depth: 1 test_script: - dotnet restore - - npm install -g selenium-standalone - - selenium-standalone install - - ps: Start-Process selenium-standalone 'start','-Djna.nosys=true' + - npm install selenium-standalone + - ps: Start-Process node './start-selenium.js' - ps: Push-Location - cd test - npm install diff --git a/test/start-selenium.js b/test/start-selenium.js new file mode 100644 index 0000000..093b33d --- /dev/null +++ b/test/start-selenium.js @@ -0,0 +1,30 @@ +var seleniumStandalone = require('selenium-standalone'); + +var installOptions = { + progressCb: function(totalLength, progressLength, chunkLength) { + var percent = 100 * progressLength / totalLength; + console.log('Installing selenium-standalone: ' + percent.toFixed(0) + '%'); + } +}; + +console.log('Installing selenium-standalone...'); +seleniumStandalone.install(installOptions, function(err) { + if (err) { + throw err; + } + + var startOptions = { + javaArgs: ['-Djna.nosys=true'], + spawnOptions: { stdio: 'inherit' } + }; + + console.log('Starting selenium-standalone...'); + seleniumStandalone.start(startOptions, function(err, seleniumProcess) { + if (err) { + throw err; + } + + console.log('Started Selenium server'); + + }); +}); \ No newline at end of file