Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng e2e breaks when webdriver-manager out of date #4640

Closed
Blasz opened this issue Feb 12, 2017 · 16 comments
Closed

ng e2e breaks when webdriver-manager out of date #4640

Blasz opened this issue Feb 12, 2017 · 16 comments
Labels
needs: repro steps We cannot reproduce the issue with the information given

Comments

@Blasz
Copy link

Blasz commented Feb 12, 2017

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Ubuntu

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

@angular/cli: 1.0.0-beta.31

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Run ng e2e with an out of date webdriver-manager.

The log given by the failure.

Normally this include a stack trace and some more information.

$ DISPLAY=:10 ng e2e --prod --env=ci
****************************************************************************************
This is a simple server for use in testing or debugging Angular applications locally.
It hasn't been reviewed for security issues.

DON'T USE IT FOR PRODUCTION USE!
****************************************************************************************
** NG Live Development Server is running on http://localhost:4200. **
 21% building modules 99/103 modules 4 active ...gets/src/app/table/table.component.tsmagicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead
Hash: ea1b24c233ed492d09cc
Time: 42423ms
chunk    {0} polyfills.f87c4a6686e3d9676fed.bundle.js (polyfills) 268 kB {5} [initial] [rendered]
chunk    {1} main.6e640f136426e5f8fc3b.bundle.js (main) 1.46 MB {4} [initial] [rendered]
chunk    {2} scripts.dd0fa2903fcecac43f2b.bundle.js (scripts) 1.3 kB {5} [initial] [rendered]
chunk    {3} styles.876b719d1c595c01c80b.bundle.css (styles) 69 bytes {5} [initial] [rendered]
chunk    {4} vendor.43bccd6adc65df20f10a.bundle.js (vendor) 2.76 MB [initial] [rendered]
chunk    {5} inline.c6b5057f43e1c851480a.bundle.js (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
[09:30:51] I/downloader - chromedriver: downloading version 2.26
[09:30:51] I/downloader - curl -o /home/vagrant/ng2-widgets/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26linux64.zip https://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip
[09:30:51] I/direct - Using ChromeDriver directly...
[09:30:51] I/launcher - Running 1 instances of WebDriver
[09:30:51] E/direct - Error code: 135
[09:30:51] E/direct - Error message: Could not find chromedriver at /home/vagrant/ng2-widgets/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26. Run 'webdriver-manager update' to download binaries.
[09:30:51] E/direct - Error: Could not find chromedriver at /home/vagrant/ng2-widgets/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26. Run 'webdriver-manager update' to download binaries.
    at BrowserError.Error (native)
    at BrowserError.IError [as constructor] (/home/vagrant/ng2-widgets/node_modules/protractor/built/exitCodes.js:13:23)
    at BrowserError.ProtractorError [as constructor] (/home/vagrant/ng2-widgets/node_modules/protractor/built/exitCodes.js:21:28)
    at new BrowserError (/home/vagrant/ng2-widgets/node_modules/protractor/built/exitCodes.js:67:23)
    at Direct.getNewDriver (/home/vagrant/ng2-widgets/node_modules/protractor/built/driverProviders/direct.js:66:27)
    at Runner.createBrowser (/home/vagrant/ng2-widgets/node_modules/protractor/built/runner.js:198:43)
    at /home/vagrant/ng2-widgets/node_modules/protractor/built/runner.js:277:30
    at _fulfilled (/home/vagrant/ng2-widgets/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/home/vagrant/ng2-widgets/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/home/vagrant/ng2-widgets/node_modules/q/q.js:796:13)
    at /home/vagrant/ng2-widgets/node_modules/q/q.js:556:49
    at runSingle (/home/vagrant/ng2-widgets/node_modules/q/q.js:137:13)
    at flush (/home/vagrant/ng2-widgets/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
[09:30:51] E/launcher - Process exited with error code 135

The log says to update webdriver-manager (which used to happen as a part of the pree2e npm script in package.json).

Running that pre script manually fixes the problem:

$ npm run pree2e

> [email protected] pree2e /home/vagrant/ng2-widgets
> webdriver-manager update --standalone false --gecko false

[09:35:19] I/downloader - chromedriver: downloading version 2.26
[09:35:19] I/downloader - curl -o /home/vagrant/ng2-widgets/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26linux64.zip https://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip
[09:35:19] I/update - chromedriver: unzipping /home/vagrant/ng2-widgets/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26linux64.zip
[09:35:19] I/update - chromedriver: setting permissions to 0755 for /home/vagrant/ng2-widgets/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26

Successful run

$ DISPLAY=:10 ng e2e --prod --env=ci
****************************************************************************************
This is a simple server for use in testing or debugging Angular applications locally.
It hasn't been reviewed for security issues.

DON'T USE IT FOR PRODUCTION USE!
****************************************************************************************
** NG Live Development Server is running on http://localhost:4200. **
 21% building modules 99/103 modules 4 active ...gets/src/app/table/table.component.tsmagicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead
Hash: dc835bf7904c1631debc
Time: 40454ms
chunk    {0} polyfills.f87c4a6686e3d9676fed.bundle.js (polyfills) 268 kB {5} [initial] [rendered]
chunk    {1} main.6e640f136426e5f8fc3b.bundle.js (main) 1.46 MB {4} [initial] [rendered]
chunk    {2} scripts.dd0fa2903fcecac43f2b.bundle.js (scripts) 1.3 kB {5} [initial] [rendered]
chunk    {3} styles.876b719d1c595c01c80b.bundle.css (styles) 69 bytes {5} [initial] [rendered]
chunk    {4} vendor.43bccd6adc65df20f10a.bundle.js (vendor) 2.76 MB [initial] [rendered]
chunk    {5} inline.c6b5057f43e1c851480a.bundle.js (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
[09:36:15] I/direct - Using ChromeDriver directly...
[09:36:15] I/launcher - Running 1 instances of WebDriver
[09:36:15] I/update - chromedriver: file exists /home/vagrant/ng2-widgets/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26linux64.zip
[09:36:15] I/update - chromedriver: unzipping chromedriver_2.26linux64.zip
[09:36:15] I/update - chromedriver: setting permissions to 0755 for /home/vagrant/ng2-widgets/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26
[09:36:15] I/update - chromedriver: v2.26 up to date
Spec started
@Headcult
Copy link

Yes, even I'm facing the same issue. 'ng e2e' may not be calling the 'pree2e' script while running. The workaround provided above of running 'pree2e' works though.

@Nikki1993
Copy link

I have the same issue but when running ng serve --aot --live-reload and it comes from my service component where the only thing I do is call http.get method :P

@filipesilva
Copy link
Contributor

We do run webdriver update, but now it's run directly without using npm scripts: https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/tasks/e2e.ts#L38

I'm not sure why that didn't work in your case. It might be related with the fact that now we use protractor@5, and yo had some old drivers? Not sure. If you can find a way to consistently repro with a new app I can investigate.

@filipesilva filipesilva added the needs: repro steps We cannot reproduce the issue with the information given label Feb 13, 2017
@rkrisztian
Copy link

For me the suggested workaround did not work on a newly generated project.

@rkrisztian
Copy link

Downgrading to [email protected] worked for me.

@kambbado
Copy link

The issue seems to be with magic-string,

`insertLeft(index, content) {
if (!warned.insertLeft) {
console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console
warned.insertLeft = true;
}

return this.appendLeft(index, content);

}`

It's being called from

./node_modules/@ngtools/webpack/src/refactor.js

I can be ignored

@johnpapa
Copy link
Contributor

I had this happen with beta 31, too

@Blasz
Copy link
Author

Blasz commented Feb 15, 2017

@filipesilva I can confirm that I have protractor installed at 4.0.13 as per my package.json:

"protractor": "~4.0.13",

I take it that this would have been updated with an ng update but #4584 dictates that no longer works and won't be supported in the future.
Additionally, this package.json change wasn't included under any manual steps in CHANGELOG.md which has been said to be the replacement for ng update.

I will need to perform further investigation to see if the version change is related to this bug.

I'm concerned with the fact that my project's package.json is now out of date with the latest cli's package.json blueprint and has no way of being updated as part of a CLI upgrade.
Especially when hard to reproduce bugs may be introduced when new/altered CLI functionality relies on the latest package.json versions as per the blueprint.

@b-barry
Copy link

b-barry commented Feb 21, 2017

@johnpapa @Blasz Running the e2e command without the webdriver update and adding pree2e below fixed this issue ( I use yarn btw) see #4597

"pree2e": "webdriver-manager update --standalone false --gecko false",
 "e2e": "ng e2e --no-webdriver-update",

@Blasz Also, to be able to migrate, you should copy-paste and merged all cli config files

@filipesilva
Copy link
Contributor

We've added a step-by-step update doc for RCs, which we'll keep updated up to 1.0 (including).

If this is something we can fix from the CLI side I'd like to, but my understanding is that it's some kind of unsupported behaviour from protractor/webdriver-manager.

Does anyone have a better explanation?

@rkrisztian
Copy link

@b-barry's trick did not work for me on a newly generated project, still the same error. I'm using Angular CLI 1.0.0.

@filipesilva
Copy link
Contributor

@rkrisztian on a new project? That's really odd. Can you give me a full log please?

@rkrisztian
Copy link

rkrisztian commented Mar 27, 2017

Attached e2e-log.txt.

Edit: Okay, that's Firefox, true. Chrome works however.

@filipesilva
Copy link
Contributor

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

@shibamo
Copy link

shibamo commented Jun 12, 2017

To record, I tried "npm install --save-dev protractor@latest", the protractor version turned into:
"protractor": "^5.1.2", from "~4.0.13"
and the "ng e2e" worked.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

No branches or pull requests

9 participants