webdriverio-boneyard / gulp-webdriver Goto Github PK
View Code? Open in Web Editor NEWgulp-webdriver is a gulp plugin to run selenium tests with the WebdriverIO testrunner
Home Page: http://webdriver.io
License: MIT License
gulp-webdriver is a gulp plugin to run selenium tests with the WebdriverIO testrunner
Home Page: http://webdriver.io
License: MIT License
The title says gulp-webdriver but the README file says it needs to install Grunt ?
as of wdio v.4.0.7, you can write code like this:
it('A user searches for "qa testing" and submits', function () {
Home.searchBar.click();
Home.searchBar.keys('qa testing');
Home.searchButton.click();
});
i've updated the gulp-webdriver package to install v.4.0.7 for itself, rather than 4.0.5, yet i still get the same error as wdio < 4.0.5
selector needs to be typeof `string`
i would think this is a very easy fix, let me know if there is anything i can do or if you think i've missed something.
thanks!
I don't know if I'm just missing something but I couldn't see anywhere that tells you that the browser
object is available inside the mocha tests. Found it in an external blog post instead!
The readme mentions a 'output' options for piping reporter output.
Doesn't look like it works and there's no reference to options.output in the source.
(looks like the text for 'output' was copied straight from grunt-webdriver too)
Errors in gulp-webdriver should be handled more gracefully and report what those errors are instead of throwing an error into console:
[15:15:53] Error in plugin 'gulp-webdriver'
Message:
wdio exited with code 1
So, currently extensions are injected into Webdriver as base64 strings from browser capabilities.
1.0.0 had been rewritten as a simple wdio
process spawning, and this causes E2BIG error - there is no way such long args (200Kb+) can be passed to child process.
Maybe it's better just to create a temporary config file for wdio, with all extensions as base64 strings in it, instead of passing opts as command line args ?
Every time I run my tests the first half run correctly while the second half all fail with the same error:
Uncaught RuntimeError
(UnknownError:13) An unknown server-side error occurred while processing the command.
Problem: POST /session//url
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:16:47'
System info: host: 'eruditorum.att.net', ip: '192.168.1.222', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.4', java.version: '1.8.0_51'
Driver info: driver.version: unknown
Looking around online I found a few people having similar issues but no fixes for running the tests through gulp. Any advice here or am I fucking something up?
From @demshin on February 14, 2017 11:27
I'm runing tests with wdio (also cucumber) with key --suite nameOfSuite, but all tests run.
gulp test:remote --maxinstances 10 --suite nameOfSuite
there is part of my wdio.conf.js:
`exports.config = {
host: argv.seleniumhost || '10.241.5.140',
port: 4444,
path: '/wd/hub',
specs: [
'./features/**/*.feature'
],
suites: {
regression: [
'./features/nsi/kpgz-spgz/*.feature',
'./features/bktz/libcontract/*.feature',
'./features/nsi/participant/*.feature',
'./features/nsi/reference/*.feature',
'./features/normalization/*.feature',
'./features/comission/*.feature'
],
scrum: [
'./features/scrum/**/*.feature'
],
nsi: [
'./features/nsi/kpgz-spgz/*.feature',
'./features/nsi/participant/*.feature',
'./features/nsi/reference/*.feature'
],
bktz: [
'./features/bktz/libcontract/*.feature',
'./features/bktz/criteria/*.feature'
],
normalization: [
'./features/normalization/*.feature'
],
comission: [
'./features/comission/*.feature'
]
}`
If you need more information I will provide.
Copied from original issue: webdriverio/webdriverio#1872
Just tried to use gulp-webdriver
following these reproduction steps (in an empty folder):
npm install gulp gulp-webdriver webdriver --save-dev
node_modules\.bin\wdio config
I confirmed all wdio
questions with default values:
=========================
WDIO Configuration Helper
=========================
? Where do you want to execute your tests? On my local machine
? Which framework do you want to use? mocha
? Where are your test specs located? ./test/specs/**/*.js
? Which reporter do you want to use? (see http://webdriver.io/guide/testrunner/reporters.html) dot
? Level of logging verbosity: silent
? In which directory should screenshots gets saved if a command fails? ./errorShots/
? What is the base url? http://localhost
Configuration file was created successfully!
To run your tests, execute:
$ wdio wdio.conf.js
Then I create the gulpfile.js
as simple as possible:
var gulp = require('gulp'),
webdriver = require('gulp-webdriver');
gulp.task('test:e2e', function() {
return gulp.src('wdio.conf.js').pipe(webdriver());
});
This is what I finally got when trying to run it:
c:\Temp\e2e>gulp test:e2e
[14:45:18] Using gulpfile c:\Temp\e2e\gulpfile.js
[14:45:18] Starting 'test:e2e'...
[14:45:18] spawn wdio with these attributes:
c:\Temp\e2e\wdio.conf.js
--logLevel=verbose
--waitforTimeout=10000
--reporter=spec
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn c:\Temp\e2e\node_modules\webdriverio\bin\wdio ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
Environment: Win7x64, NodeJs v0.12.7
homepageFeature.js
var expect = require('chai').expect;
describe('Feature: Homepage', function() {
before(function(done) {
browser
.url('http://localhost:3000')
.call(done)
});
it('has a title', function(done) {
browser
.getTitle(function(err, title) {
expect(err).to.not.be.true
expect(title).to.eql('Welcome to the Homepage');
})
.call(done)
});
});
gulpfile.js
var gulp = require('gulp');
var webdriver = require('gulp-webdriver');
var server = gls.new('./app/server.js');
gulp.task('test-features', function() {
return gulp.src('test/features/*.js')
.pipe(webdriver({
framework: 'mocha',
desiredCapabilities: {
browserName: 'chrome'
}
}))
.once('end', function() {
server.stop();
});
});
Works in v0.1.1 but not in v1.0.1.
ReferenceError: describe is not defined
I installed the plugin using npm install gulp-webdriver --save-dev
, and then when I try to use it in my code, I get:
module.js:338
throw err;
^
Error: Cannot find module 'gulp-webdriver'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Projects\test\selenium\testBrowser.js:4:17)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
Looking in node_modules\gulp-webdriver
folder, apparently index.js
is not present.
Looking at package.json
, the property "main": "Gruntfile.js"
apparently is incorrect.
Shouldn't it be index.js
?
gulp.task('test:e2e', function() {
return gulp.src('wdio.conf.js').pipe(webdriver({
capabilities: [{
browserName: 'firefox'
}],
logLevel: 'verbose',
waitforTimeout: 10000,
reporter: 'spec'
}));
});
When running the task "capabilities" is not applied instead config in wdio.conf.js is used.
I am trying to use the gulp-webdriver in a path that sits under C:\program files\ I am getting an error saying that 'C:\Program' is not recognized as an internal or external command. When I move it to a location that has no spaces in the path it runs ok.
Unfortunately where I want to run it on the server has to have spaces in so is there a way of running this in a path with spaces?
Running gulp e2e
task does not successfully end task once finished running my test suite.
I'm assuming that it's me, and not you, but I've stripped out everything that I can and it's still not completing the task. I have to manually kill Gulp in the command line.
I've created a temporary stripped-down repository that can run a basic tests:
https://github.com/shamrt/wdio-issue
Thanks so much for your help!
some requirements:
Like wdio has.
The task doesn't finish when tests fail, so gulp just waits forever.
import webdriver from 'gulp-webdriver';
gulp.src('webdriver', () => {
return gulp.src('wdio.conf.js')
.pipe(webdriver());
});
tl;dr gulp task is stuck on "start selenium standalone server" step, I'm asking for help. I blame the corporate proxy settings but am not sure about anything.
I use pretty much the code from the README example in my gulpfile:
// gulpfile.js
var gulp = require('gulp')
, webdriver = require('gulp-webdriver');
gulp.task('test', function() {
return gulp.src('*/*.spec.js', { read: false })
.pipe(webdriver({
desiredCapabilities: { browserName: 'chrome' },
proxy: {
httpProxy: // my companies proxy here
sslProxy: // same here
}
});
});
As dependencies i have installed
// package.json, devDependencies section
"gulp": "^3.9.0",
"gulp-webdriver": "^0.1.1",
"mocha": "^2.2.5",
"webdriverio": "^3.1.0"
When I run gulp test
, it gets stuck on the start selenium standalone server
step:
[08:57:00] {{ my workspace here }}\gulpfile.js
[08:57:00] Starting 'test'...
[08:57:00] run webdriverio with following capabilities: {"desiredCapabilities":{"browserName":"chrome"},"proxy":{"httpPr
oxy":"{{ my companies proxy here }}","sslProxy":"{{ and here }}"}}
[08:57:00] checking if selenium is running
[08:57:01] selenium is not running
[08:57:01] installing driver if needed
[08:57:02] driver installed
[08:57:02] start selenium standalone server
I'm on a windows (:disappointed:) 8.1. 64bit machine with node -v
v0.12.7 and npm -v
2.11.3.
I'd expect the task to start the selenium server and run my specs. What am I missing?
Hello @christian-bromann ,
Sorry for the trouble but I was just looking for starting and stopping appium as a child process and came across this example.
Here selenium server is started before the test as a child process and once the test is done, the child process is killed.
Could you please help me to do the same for appium.cmd
where I can utilize the wdio.conf.js file and mocha?
I was trying to create a gulp task using gulp-run and was able to start the appium server using appium.cmd
.
gulp.task('startApp', function() {
return run(path.join('node_modules', '.bin', 'appium.cmd')).exec()
.pipe(gulp.dest('appiumo.log')) ;
})
But wanted to start it as child process which can be killed later and it should be async(may be).
When assertion fails an error appears in command line
events.js:141
throw er; // Unhandled 'error' event
^
Error: wdio exited with code 1
Plumber says that error is in gulp-webdriver plugin
Plumber found unhandled error:
Error in plugin 'gulp-webdriver'
Message:
wdio exited with code 1
My gulpfile
gulp.task('webio', function() {
gulp.src('wdio.conf.js')
//.pipe(plumber())
.pipe(webdriver());
});
Test script
var chai = require('chai'),
assert = chai.assert;
describe('tests', function () {
it('fail', function () {
assert.equal(1, 0);
});
it('success', function () {
assert.equal(1,1);
});
});
Everything seems to be working except the error at the end.
This error appears since version 2.0.1.
Is it a normal behaviour or I am doing something wrong?
I am using [email protected] and [email protected]
Thanks!
I can't get gulp-webdriver to use my wdio.conf.js, as described in the README of this repository. I've been debugging this for a while, but I'm pretty stumped...
My task:
gulp.src('wdio.conf.js').pipe(webdriver({}))
It ignores my entire wdio.conf.js, which includes the paths to run, and says to run the tests in chrome. Here are the options selenium runs with from the gulp task:
{"desiredCapabilities":{"browserName":"firefox","version":"","javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"platform":"ANY","requestOrigins":{"url":"http://webdriver.io","version":"2.4.5","name":"webdriverio"}}}
Since it doesn't have the paths defined in wdio.conf.js, it thinks there are 0 tests, and exits immediately.
I can run the tests from the cli with plain wdio just fine:
$ wdio wdio.conf.js
From @artur-michalak on January 4, 2017 12:5
When i setup webdriver.io with gulp watch and interrupt process with ctrl+c it's not closing.
WebdriverIO version: v4.5.2
Node.js version: v4.4.5 (v6 too)
Standalone mode or wdio testrunner: jasmine testrunner
if wdio testrunner, running synchronous or asynchronous tests: asynchronous
Additional wdio packages used (if applicable):
"wdio-dot-reporter": "0.0.6",
"wdio-jasmine-framework": "^0.2.19",
"wdio-selenium-standalone-service": "0.0.7",
"gulp-webdriver": "^2.0.3",
[12:56:45] Finished 'e2e:run' after 16 s
[12:56:45] Finished 'e2e:dev' after 17 s
then on cmd + c click:
End selenium sessions properly ...
(press crtl+c again to hard kill the runner)
Killing process, bye! (on cmd + c click)
Killing process, bye! (on cmd + c click)
Killing process, bye! (on cmd + c click)
Killing process, bye! (on cmd + c click)
// production release of player
gulp.task('e2e:dev', function() {
gulp.watch(config.e2e.specs, ['e2e:run']);
});
I would guess something is wrong with logic here
https://github.com/webdriverio/webdriverio/blob/68974ac33aa13fa099b1870d5a81ce5c6d8341db/lib/launcher.js#L418
Perhaps process.exit is not being called.
Copied from original issue: webdriverio/webdriverio#1798
It seems the the code on npm does not match the code on github for v2.0.2.
The stream end event is not in the npm version.
process.nextTick(() => stream.emit('end'))
I am not sure that it is a problem of gulp-webdriver.
I have the following task in my gulpfile.babel.js:
gulp.task('watch', () => gulp.watch('specs/**/*.test.js', (event) => {
if (event.type === 'added' || event.type === 'changed') {
gulp.src('wdio.conf.js')
.pipe(webdriver({ specs: [event.path] }));
}
}));
When I run gulp watch
and touch specs/a.test.js
it works OK and very simply test passed.
But when I run touch specs/a.test.js
again webdriver always hangs on the following:
[15:06:07] COMMAND POST "/wd/hub/session"
[15:06:07] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"chrome","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.0.5","name":"webdriverio"}}}
I've got this error, when i tried to start a test session in the local chrome browser.
[10:04:37] Starting 'test-e2e:local'...
ERROR: session not created exception from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"6208.1","isDefault":true},"id":1,"name":"","origin":"://"}
chrome
Error: session not created exception from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"6208.1","isDefault":true},"id":1,"name":"","origin":"://"}
[10:04:47] 'test-e2e:local' errored after 9.56 s
[10:04:47] Error in plugin 'gulp-webdriver'
Message: wdio exited with code 1
The gulp task:
gulp.task('test-e2e:local', function() { return gulp.src('./wdio.local.conf.js').pipe(webdriver()); });
Capabilities in the wdio.local.conf.js are only:
capabilities: [{ browserName: 'chrome' }]
I used the latest gulp-webdriver version 2.0.2. Testing on Windows 10.
The same when i tried to start a session in Firefox.
Has anyone a solution?
Is there anything that would cause this not to be able to support Jasmine at some point down the road?
I run something like this:
gulp.task('test', function (cb) {
return gulp.src('wdio.conf.js').pipe(webdriver({
onComplete: function () {
console.log('`onComplete` call')
},
before: function () {
console.log('`before` hook');
},
after: function (){
console.log('`after` hook')
}
}));
})
but "before" and "after" hooks not calling. If it was defined in wdio.conf.js
, then hooks call successfully.
I am using [email protected] and [email protected]
I have issue installing gulp-webdriver.
After some debugging, it seems that this occurs during the installation of dargs
dependencies.
Could the developers please take a look? Thanks.
Command:
npm install gulp-webdriver --save-dev
Error:
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:213:12)
npm WARN addRemoteGit at emitTwo (events.js:87:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:172:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:818:16)
npm WARN addRemoteGit at Socket.<anonymous> (internal/child_process.js:319:11)
npm WARN addRemoteGit at emitOne (events.js:77:13)
npm WARN addRemoteGit at Socket.emit (events.js:169:7)
npm WARN addRemoteGit at Pipe._onclose (net.js:469:12)
npm WARN addRemoteGit christian-bromann/dargs resetting remote C:\...\AppData\Roaming\npm-cache\_git-remotes\
git-github-com-christian-bromann-dargs-git-d1658d6c because of error: { [Error: Command failed: git -c core.longpaths=true co
nfig --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
The line:
wdioBin = require.resolve(path.join('webdriverio', 'bin', isWin ? 'wdio.cmd' : 'wdio'))
Fails because I'm missing node_modules\webdriverio\bin\wdio.cmd
after doing a fresh install. The only file in bin
is wdio
but this won't run on Windows.
I suspect the issue is due to the change in d7aca92 because node_modules/.bin/wdio.cmd
does actually exist.
The weird thing is version 1.0.1
doesn't seem to work either now, I get the error message Haven't found the WebdriverIO test runner
even though node_modules/.bin/wdio.cmd
does actually exist.
Windows 10, npm 3.3.12, node v5.3.0, webdriverio 3.4.0, gulp-webdriver 1.0.2
Update: I got it working by changing the line to:
wdioBin = path.join(__dirname, '..', '.bin', isWin ? 'wdio.cmd' : 'wdio')
I'm guessing this is a problem due to the new npm flat dependency system?
Not sure if this is related to #41 but if I do the following, the gulp task hangs as if waiting on something async:
gulp.task('default', ['selenium'], function(done) {
return gulp.src('wdio.conf.js').pipe(webdriver());
});
If I try doing the following, it errors with Error: task completion callback called too many times
gulp.task('default', ['selenium'], function(done) {
return gulp.src('wdio.conf.js').pipe(webdriver())
.on('end', function() {
done();
});
});
In v1.0.3 I use the gulp 'end' event to shutdown my selenium server:
return gulp.src('./wdio.conf.js'))
.pipe(webdriver({
wdioBin: path.join(__dirname, 'node_modules', '.bin', wdioCommand)
})).once('end', () => {
selenium.child.kill();
});`
however in 2.0.0 the 'end' event never fires. Is this intentional?
When installing with npm, we get the warning:
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
According to this article and the gulp-util repo we can see that gulp-util is deprecated.
There are instructions in those links on how to replace gulp-util with specific, smaller modules.
I think the only thing that's used from gulp-util is PluginError
, so this module could be used instead: https://www.npmjs.com/package/plugin-error
Using v1.0.1, when the top level project is dependent on both gulp-webdriver
and webdriverio
, the webdriverio module is installed in the top-level node_modules
dir. Running gulp with piping to gulp-webdriver, gulp fails with the aforementioned message.
The problem is reproduced here:
https://github.com/electricmonk/goos-nodejs/tree/e6c3a0453a211fb072f7777e04c7e9491e556ba5
The code that causes this failure is this (index.js):
if (!fs.existsSync(opts.wdioBin)) {
return this.emit('error', new gutil.PluginError('gulp-webdriver', 'Haven\'t found the WebdriverIO test runner', {
showStack: false
}));
}
which is caused by this line:
wdioBin = path.join(__dirname, 'node_modules', '.bin', isWin ? 'wdio.cmd' : 'wdio');
I managed to work around it by overriding the wdioBin option in my Gulpfile thus:
gulp.task('e2e', ['test', 'selenium'], function () {
return gulp.src('wdio.conf.js', {read: false})
.pipe(webdriver({
wdioBin: path.join(__dirname, 'node_modules', '.bin', 'wdio'),
desiredCapabilities: {
browserName: 'phantomjs'
}
}))
.once('end', function () {
selenium.child.kill();
});
});
But I think that gulp-webdriver should be able to handle this case on its own.
When I update gulp-webdriver to the latest version, I have problems with my differents tests.
The ones starting by creating a newbrowser like this :
var newbrowser = webdriverio.remote(browser.options).init();
return newbrowser
.url(browser.options.baseUrl + variables.url.home)
...
Error 1 : the test is passed instantly (but it isn't in reality)
I have an other test beggining like this who fails after a few clicks :
it('Search Manhattan with some criteria', function() {
return browser
.url(browser.options.baseUrl + variables.url.home)
...
Error 2 : browser.url(...).click(...).click(...).click(...).waitForVisible(...).click is not a function
For an other test I have this issue :
Error 3 : done is not a function
I can give you more details on my different test or my configuration files and nodesmodules versions if you need.
gulp-webdriver is currently dependent on webdriverIO version 4. Please can this be updated so that this works with webdriverIO 5? Many thanks
I'm trying to start gulp-webdriver with following options:
{
"desiredCapabilities": [{
"browserName": "chrome",
"chromeOptions": {
"args": ["start-maximized", "show-fps-counter=true"],
"prefs": {}
},
"javascriptEnabled": true,
"databaseEnabled": true,
"locationContextEnabled": true,
"applicationCacheEnabled": true,
"webStorageEnabled": true,
"acceptSslCerts": true,
"nativeEvents": true
}],
"host": "localhost",
"port": "4444",
"path": "/wd/hub",
"logLevel": "verbose",
"coloredLogs": true,
"screenshotPath": "./reports/shots",
"waitforTimeout": 2000,
"slow": 75,
"framework": "mocha",
"ui": "bdd",
"nospawn": false,
"seleniumOptions": {},
"seleniumInstallOptions": {
"chrome": {
"version": "2.18",
"arch": "x64",
"baseURL": "http://chromedriver.storage.googleapis.com"
}
},
"reporter": "dot"
}
Which of course is failing
TypeError: Cannot read property 'chromeOptions' of undefined
at /project/node_modules/gulp-webdriver/node_modules/deepmerge/index.js:40:28
at Array.forEach (native)
at deepmerge (/project/node_modules/gulp-webdriver/node_modules/deepmerge/index.js:35:26)
at /project/node_modules/gulp-webdriver/node_modules/deepmerge/index.js:22:26
at Array.forEach (native)
at deepmerge (/project/node_modules/gulp-webdriver/node_modules/deepmerge/index.js:18:13)
at new WebdriverIO (/project/node_modules/gulp-webdriver/node_modules/webdriverio/lib/webdriverio.js:42:32)
at WebdriverIO.Chain (/project/node_modules/gulp-webdriver/node_modules/webdriverio/node_modules/chainit/index.js:6:17)
at Object.remote (/project/node_modules/gulp-webdriver/node_modules/webdriverio/index.js:63:16)
at Object.GulpWebdriverIO (/project/node_modules/gulp-webdriver/index.js:46:34)
If I'm trying to run it with desiredCapabilities
as an object, not as an array - it works fine.
If I'm trying to pass capabilities as capabilities
property array - it launches, but does not recognizes 'em at all, and fallbacks to firefox instead.
I don't want to start a bunch of webdriver gulp tasks simultaneously, 'cause I'll get really messy output.
I hope there is a way to make this work as intended.
I think there should be some array check for deepcopy
in case someone passes an array instead of an object to capabilities
/ desiredCapabilities
.
I have this task:
gulp.task('e2e',['start-rest','start-server','selenium'], function (done) {
gulp.src('wdio.conf.js')
.pipe(webdriver())
.on('end', function(err){
console.log(">>2>>"+err);
done(err);
})
.on('error', function(err){
console.log(">>>>"+err);
done(err);
});
});
It works fine when the tests pass, but hangs on failure:
0 passing (17.70s)
1 failing
1) Basic Test Should be able to login ..:
Failed: element (nsa-content) still not existing after 10000ms
running chrome
Error: element (nsa-content) still not existing after 10000ms
at Page.value (test/e2e/spec/common/MainAssurancePage.js:27:18)
at Object.<anonymous> (test/e2e/spec/testSpec.js:27:27)
at elements("nsa-content") - isExisting.js:46:17
at isExisting("nsa-content") - waitForExist.js:37:22
Wrote xunit report to [./target/test-res].
>>>>Error in plugin 'gulp-webdriver'
Message:
wdio exited with code 1
[11:42:50] 'e2e' errored after 18 s
[11:42:50] Error in plugin 'gulp-webdriver'
Message:
wdio exited with code 1
The versions of the plugins etc are:
[email protected]
[email protected]
Any suggestions?
I was trying to setup my integration tests and I keep getting this error :
wdio.conf.js
exports.config = {
specs: [
'src/**/*.int.js'
],
// Patterns to exclude.
exclude: [
// 'path/to/excluded/files'
],
maxInstances: 10,
capabilities: [{
maxInstances: 5,
browserName: 'firefox'
}],
sync: true,
logLevel: 'error',
coloredLogs: true,
bail: 0,
screenshotPath: './errorShots/',
baseUrl: 'http://localhost:8099/Authentication.php',
waitforTimeout: 120000,
connectionRetryTimeout: 120000,
connectionRetryCount: 10,
services: ['selenium-standalone','phantomjs'],
framework: 'mocha',
mochaOpts: {
ui: 'bdd'
},
}
gulpfile.js
import yargs from 'yargs';
import gulp from 'gulp';
import del from 'del';
import {Server} from 'karma';
import webdriver from 'gulp-webdriver';
import selenium from 'selenium-standalone'
import restructureTree from './plugins/gulp-restructure-tree';
import { paths, pathMoveRules } from './config';
/* =Command-line arguments and config
*------------------------------------------------------------*/
// some unrelated commands
/* =Tasks
*------------------------------------------------------------*/
// other tasks goes here
export function wd_test() {
return gulp.src('wdio.conf.js').pipe(webdriver({
logLevel: 'verbose',
waitforTimeout: 120000,
reporter: 'spec'
}));
}
export const build_app = gulp.series(clean, gulp.parallel(styles_app, scripts_app, others_app));
export const build = build_app;
export default build;
test.int.js
var chai = require('chai');
var expect = chai.expect;
var assert = chai.assert;
var should = chai.should();
describe('my awesome website', function() {
it('should do some chai assertions', function() {
browser.url('/');
browser.getTitle().should.be.equal('Authentification');
});
after(function(){
browser.end();
})
});
Also not sure how but when I use before()
, beforeEach()
, after()
and afterEach()
in the test I either get the test failing or I get "after all", "after each" hook failing.
I also get an error in the test from time to time about the timeout (exceeded 10000ms) whereas the timeout limit was set to 120000ms.
Any help appreciated.
Is there any way to embed a plugin before run webdriverio init() method through gulp?
I want to init this plugin (https://github.com/chmanie/webdriverajax) before start browser
The problem with the wdio
binary not being nested inside the local node_modules
folder has been fixed but not released.
I spent a bit of time working on a fix and a PR before realizing the code I was going to check in had a merge conflict with master, and that the bug had already been fixed.
I've created a wdio.conf.js file to use for my testing, but it seems like this plugin doesn't make use of it. It'd be nice if I didn't have to duplicate my settings in the gulp task.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.