Comments (26)
Hi
Could check if you have not a similar issue link this: #33 (comment)
Because the plugin stop the selenium server, not your application server
Regards
from gulp-angular-protractor.
Yes I saw issue #33, but I don't have another task dependency. The server needs to run for the tests and the tests are executed standalone with gulp test
(e.g. from a terminal).
BTW thanks for the fast repsonse :)
from gulp-angular-protractor.
The application server is always running ? Or is launched with gulp ?
What is your process to run your functional tests ?
Because if you saw "[10:13:39] gulp-angular-protractor - Webdriver standalone server is stopped", that means we have killed the selenium server
And if you saw:
{ [Error: protractor exited with code 1]
message: 'protractor exited with code 1',
showStack: false,
showProperties: true,
plugin: 'gulp-angular-protractor',
__safety: { toString: [Function: bound ] } }
This is the error output from seleninum to explain the error (basically, it said "error code 1", so this is no really helpfull, but it means the tests are failed)
Could you give me a sample of your configuration to reproduce your issue ? And to check your gulp version, plugin version, node / npm version, etc ...
Many thanks
from gulp-angular-protractor.
Currently I am integrating the tests in our build chain, but at the moment the server is started from the IDE and I run the tests manually from commandline when the application is already running (in the future this should be integrated with a gradle task which starts the server first and then the tests via npm test
which in turn runs gulp test
).
Versions:
- node : v8.2.1
- npm: 5.3.0
- gulp: 3.9.1
- gulp-angular-protractor: 1.0.0
And this is my protractor conf:
let os = require('os');
let path = require('path');
let Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
multiCapabilities: [{
browserName: 'chrome',
chromeOptions: {
args: [
'--disable-blink-features=BlockCredentialedSubresources', // needed for authentication
'--headless', '--disable-gpu', '--window-size=1920x1040'
]
}
}],
suites: {
client: 'client/*.spec.js',
widgets: 'widgets/*.spec.js',
full: '**/*.spec.js'
},
params: {
auth: {
user: 'user',
password: 'password'
}
},
onPrepare: function () {
// load page here to authenticate user
browser.get(`http://${browser.params.auth.user}:${browser.params.auth.password}@localhost:8080/#/`);
return browser.getCapabilities().then(capability => {
let date = (new Date()).toISOString().replace(':', '.').slice(0, 16);
let browserName = capability.get('browserName');
jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
savePath: path.resolve(os.tmpdir(), 'htmlReports', `${browserName}_${date}`)
}));
});
}
};
Many thanks!
from gulp-angular-protractor.
Hummm have you tried to run the examples from the plugin ? You can find the examples here: https://github.com/rochejul/gulp-angular-protractor/tree/master/examples
If it works on your side, could you create a sample project to illustrate your issue ? With similar package.json, protractor configuration and some similar tests ?
Many thanks
from gulp-angular-protractor.
So after intensive testing I can tell you, that the problem is the protractor version: if protractor 4.x is used the gulp task terminates normally, with protractor 5.x it hangs.
from gulp-angular-protractor.
Interesting
What kind of action can I bring ? To restrict the protractor dependency ?
Have you notice a specific event with protractor 5 ?
I think I have to investiguate to find why on protractor 5, it cannot terminate.
I will rename your issue name to specify that issue
Regards
from gulp-angular-protractor.
Hm good question. Protractor is not even a dependency of this plugin. At the moment I am fine with restricting the protractor dep in my own project, but maybe a hint in the Readme with a link to this issue would be a good idea.
What do you mean with specific event?
from gulp-angular-protractor.
I've been trying to work out what's causing this, but all I have to add so far is that selenium isn't terminated – I put in a process.exit()
like so:
return gulp
.src(…)
.pipe(protractor({ … }))
.on('end', function () {
setTimeout(() => process.exit(), 2500);
});
After the node process ends, the selenium server is still there, listening on its port and blocking further runs.
from gulp-angular-protractor.
Hmm, further to that, if I manually kill the selenium process in another tab, the gulp process exits cleanly.
[14:06:58] Finished 'test-e2e' after 6.04 s
# I run `killall -9 java` in another terminal here
[14:07:01] gulp-angular-protractor - Webdriver standalone server will be closed
from gulp-angular-protractor.
Hi @Drarok
I think there is a new step onto the protractor selenium server to hang the end of the execution (I remember a similar issue for older versions).
I hope to find some time on the next week to look on it.
Regards
from gulp-angular-protractor.
Thanks, waiting for some good news. I have been manually killing the process since we decoupled the Protractor and Webdriver from the framework.
from gulp-angular-protractor.
Ok, it seems we are faced to an issue around the selenium server: angular/webdriver-manager#199
So protractor added this new issue: https://github.com/angular/webdriver-manager/blob/master/lib/cmds/shutdown.ts#L35 because their associated "webdriver shutdow" command is inefficient now
I try to find a workaround
Regards
from gulp-angular-protractor.
Okkkkkkkkkkkkkkkkkkkkkayyyyyyy
So, it seems this is not clear for the Selenium team since 3.X if we really could stop the server or not (arguments for security issues).
Maybe I should use instead something like that (to stop the webdriver-manager instance):
child.kill(); // because it was raised with spawn
I have to check this
Regards
from gulp-angular-protractor.
Was fixed in version 1.1.0.
There is an example folder "examples/example-06" to illustrate
Regards
from gulp-angular-protractor.
For me issue is still reproducible. I am using gulp-angular-protractor 1.1.1 ( tried 1.1.0, 0.4.0, 0.3.0, 1.0.0 also) and protractor 5.2.2.
When test finished it write
2 specs, 0 failures
Finished in 5.393 seconds
[11:18:11] I/launcher - 0 instance(s) of WebDriver still running
[11:18:11] I/launcher - chrome #1 passed
[11:18:11] gulp-angular-protractor - We will stop the Protractor engine
[11:18:11] Finished 'run:protractor' after 25 s
and then nothing. Process is not finished( this mean that jasmine html report is also not created).
my gulp task is
gulp.task('run:protractor', [], function (callback) {
var configFile = "qaprotractor.conf.js";
gulp
.src(qaconfigFile.config.specs)
.pipe(gulpProtractorAngular ({
configFile: configFile,
debug: false,
args: ['--baseUrl', 'http://localhost:8000'],
autoStartStopServer: true
}))
.on('error', function (e) {
console.log(e);
})
.on('end', function () {
callback();
});
});
Could you please help me with this?
from gulp-angular-protractor.
@stasyasin Hi, have you check the example folder "examples/example-06" on your machine ?
And compare the difference between your project and the example ?
Many thanks
from gulp-angular-protractor.
Hi @rochejul Yes, sure, I did it before. I have a little bit different gulp-task, but I made it like your in example-06. I have different protractor.conf.js ( you don't use arguments of chrome). But even when I deactivate them -> it didn't help.
Looks like selenium standalone is not killed. I need to kill java.exe each time between running tests, otherwise it saying that port 4444 (default one) is already in use.
from gulp-angular-protractor.
Could you provide an attachment with your configuration and your tests please ?
Many thanks
from gulp-angular-protractor.
I have attached conf file screenshots. For test it will be complicated, because I have complex page object module. But it is normal test like
describe('Test - ' + testName, () => {
this.pageSetup();
it('Perform Login actions', (done) => {
this.performLogin();
done();
});
});
from gulp-angular-protractor.
@stasyasin not very usefulle to copy / paste the configuration ...
Please try to create a tiny project to illustrate your issue. Otherwise, it will be very hard for me to try to reproduce it on my side
Thanks
from gulp-angular-protractor.
@rochejul Hi, I have added my conf file here
for a specs
describe('Test - ', () => {
browser.get('https://google.com'); //not sure if google is angular =)
it('Perform Login actions', (done) => {
//do nothing();
done();
});
});
from gulp-angular-protractor.
Ok, so I know how to finish the process,
.on('end', function () {
setTimeout(function() {
process.exit();
}, 2500);
});
this will exit the process after 2.5 sec. But issue that something( I think selenium-standalone) is still running and using port 4444... each time it is different PID(processID) , and each time I need to kill it manually. Even if I will write some function to kill process -> I don't want to kill the process because this is java.exe . I want that listening for 4444 stopped.
Otherwise I can't run the test again, because it says that port is busy
BTW: I am on jdk 1.8
from gulp-angular-protractor.
@rochejul Looks like I have found good workaround. But I hate you and all gulp-angular-protractor team =) I have tried to run my tests trough npm commands -> it was difficult to start webdriver and run tests in the same command. I wrote sh script that looking for process ID by port and killing it. But it was also ugly.
Best decision is to use process-finder module and kill process on the end of your task.
https://www.npmjs.com/package/process-finder
example of code:
var finder = require('process-finder');
gulp.task('run:protractor', function (callback) {
var configFile = "qaprotractor.conf.js";
var port = 4444;
gulp
.src(qaconfigFile.config.specs)
.pipe(gulpProtractorAngular ({
configFile: configFile,
debug: false,
args: ['--baseUrl', 'http://localhost:8000'],
autoStartStopServer: true
}))
.on('error', function (e) {
console.log(e);
finder.find(port, function(err, pids){
process.kill(pids[0]);
});
})
.on('end', function () {
finder.find(port, function(err, pids){
process.kill(pids[0]);
});
});
});
from gulp-angular-protractor.
@stasyasin There is no team : I am alone, with a job, a wifecand child.
I try to take some time for all my opensouce project and this is hard.
When I saw your comment, I think I will create now only private tools.
Regards
from gulp-angular-protractor.
@rochejul To be honest it was a joke =) I am very enjoying to use your tool(Adding it to each my framework, because of autoStartStopServer ). It's really good, no worries! Just spent a lot of time to understand how to kill the process correctly inside gulp task, anyway it was fun. Hope my comment help you to improve it
from gulp-angular-protractor.
Related Issues (20)
- If the scenario get fails, the whole test suite execution get stopped HOT 5
- Update dependencies
- How to pass multiCapabilities from gulp-angular-protractor HOT 4
- Query : Is it possible to use gulp-angular-protractor with wdio and mocha HOT 3
- Gulp task hangs (never completes) with last output "gulp-angular-protractor - Webdriver standalone server will be closed" HOT 13
- Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:48107 for gulp protractor HOT 15
- Arguments to webdriver are not being pass to the selenium server HOT 5
- Updating protractor version HOT 1
- Update engine requirement ?
- webDriver.webDriverUpdateAndStart is not a function HOT 3
- ChromeDriver unable to maximize to defined values. HOT 4
- Fails with Chrome 57 HOT 28
- Confusion about global Protractor and node_modules Protractor HOT 2
- Configure for Page Object pattern project HOT 12
- What the problem is "code 199"? HOT 1
- webdriver update fail on clean environment with autoStartStopServer set to false HOT 3
- teapot error on vinyl@406 HOT 8
- Update lodash version to avoid vulnerability
- Update the dependency to protractor to its latest version 6.0.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-angular-protractor.