-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Protractor triggers selenium exception, exits immediately saying all tests passed #2790
Comments
Can you show your config file? |
Sure, here it is:
|
This problem seems like it has two parts. For the first, it seems like there's a Selenium issue. Second, if there is such a Selenium issue, Protractor should never report all green. |
I received the same error on my suite updating from 2.5.1 after all tests passed. Rolled back instead of investigating more. |
I am having the same issue. I have cornered the issue down to browser.wait no longer working as before. When it times out, it does not throw any catchable error, instead everything quits with no output. This is my browser.wait that executes soon after the first page loads:
This is the test output I get:
And that's it. No process exits message; no further output. Just put back on the command line ready for another command to be ran. Calling code does: |
I'm unable to reproduce this issue. Everything I try results in Protractor exiting with code 1. Here's an example of using wait that times out: // in config:
onPrepare: function() {
browser.wait(function() {
console.log('waiting...');
return false;
}, 1000);
} This results in I'm going to close this issue as unable to reproduce. However, if you are able to create a reproducible case we can run, please open up a new issue! Thanks. |
Seems like the issue for me was with calling I only see the error on Browserstack / Sauce Labs. |
We also had benchpress 2.0.0-beta.6 in our package.json. This setup forced npm to create: myapp/node_modules/protractor/node_modules/selenium_webdriver -> 2.48.2 (for protractor) And from what I can see, protractor is then resolving selenium-webdriver 2.52.0 and not working correctly. (I guess jasminewd2 searches up from myapp/node_modules/jasminewd2 and finds myapp/node_modules/selenium_webdriver?) It was crazy to see all the steps queued up in the webdriver control flow (getSchedule()), but then to have the test complete instantly... sort of hard to trace this one back to a root cause. I can help to create a simple project with the problem if it helps. This is my best lead so far on this one though. I should add: we run a couple of envs, but: |
An With the polluted version where 2.52.0 is in ./node_modules/selenium-webdriver and 2.48.2 is in ./node_modules/protractor/node_modules/selenium-webdriver I see webdriver loaded from both locations: first from ./node_modules/protractor/node_modules/selenium-webdriver (via protractor.js) and then later loaded again from./node_modules/selenium-webdriver via jasminewd2: Load 1:
Load 2:
Not sure if other folks were seeing this exact behaviour, but I hope it helps. |
fwiw I thought that the second load of the same module via a require('selenium-webdriver') should have resulted in a load from the cache, not the disk per https://nodejs.org/api/modules.html#modules_caching. Maybe it's a bug in node, or maybe I don't get it. (edit: I guess this applies: https://nodejs.org/api/modules.html#modules_module_caching_caveats) Reading https://github.com/nodejs/node/blob/master/lib/module.js#L285 didn't make my understanding much better. I don't think I would have used the filename as a cache key (the resolve before the cache lookup seems counter-intuitive), but maybe there is a good reason to want to allow multiple copies of things to run in node in certain cases... |
…actor. When the library versions differ at runtime you get strange test behaviour where the jasmine wrappers to not evaluate the control flow correctly. More details here: angular/protractor#2790
…actor. When the library versions differ at runtime you get strange test behaviour where the jasmine wrappers to not evaluate the control flow correctly. More details here: angular/protractor#2790
Fixes angular#3505 and angular#2790, which is caused by JasmineWd and Protractor using different controlflow instances
When I run protractor, selenium opens chrome browser window then immediately closes. It causes selenium to show the following exception backtrace.
Protractor immediately exits while showing every test passed. By this I mean that all output from the spec reporter is green. The entire process takes approximate 1.78 seconds. We have tested this same suite with the exact same versions on 2 additional macs and one windows machine with the test suite behaving as expected. We can see the browser step through the protractor tests normally. On these other computers the process takes about 40 seconds.
We have tried multiple things to fix the problem including blowing away protractor, node modules, and reinstalling everything. Try as we might we can not reproduce this problem elsewhere. However protractor is clearly exhibiting the incorrect behavior, because if the selenium error occurs and the test cannot be carried out then protractor should not signal all tests as passing.
I am writing this both to report a bug and to ask for any help that can be offered in fixing this issue.
Please find information about my environment below:
Mac OSX 10.10.5
Darwin hostname.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Google Chrome 47.0.2526.106 (Official Build) (64-bit)
Protractor version: 3.0.0.
Node version: 5.2.0
Grunt version: grunt-cli v0.1.13
grunt v0.4.5
Thanks very much for any help you can offer and please let me know if I can provide more information to help solve or diagnosis this problem.
The text was updated successfully, but these errors were encountered: