You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem with ejecting from the Angular CLI and running E2E on my build server. It works on my dev machine (and the build server prior to ejecting) but when I run it in Visual Studio online's automated build process it fails because it can't find localhost:4200 server.
Failed: Angular could not be found on the page http://localhost:4200/.If this is not an Angular application, you may need to turn off waiting for Angular.
My build step within visual studio online is npm with custom as the Command Type and: run-script e2e which worked previously and generated artifacts from the test results which it then published ( Screenshot of my build steps showing the e2e call)
The full code is a variation on the ng seed project and is on GitHub complete with a number of pre-configured test settings and headless chrome support https://github.com/zebslc/angular5mat to make it work in a CI/CT using visual studio online/Azure environment. I have had to temporarily revert my ejected cli branch because of this change.
"scripts": {
"ng": "ng",
"start": "webpack-dev-server --port=4200 --config webpack.dev.config",
"watch": "webpack --watch --config webpack.dev.config",
"build": "webpack --config webpack.dev.config",
"build:prod": "webpack --config webpack.prod.config",
"test": "karma start ./karma.conf.js",
"ct": "karma start ./karma.conf.js --single-run --browsers ChromeHeadless --sourcemaps=false",
"lint": "ng lint",
"e2e": "protractor ./protractor.conf.js",
"cover": "karma start ./karma.conf.js --code-coverage",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet"
},
My protractor config has the following default setting but it also contains puppeteer/headless chrome.
baseUrl: "http://localhost:4200/",
Observed behavior
As mentioned this was working perfectly prior to ejecting but I need to add more advanced features such as progressive web app/css profiling so it needs to be ejected. Am I now missing something obvious with my e2e script call and if so what?
The problem seems to be that the CLI creates an instance and runs the tests in the same thread whereas when it is ejected the web service tested against is creating a separate web service.
Discussions in a closed answer suggest you should be able to script it to work the same but then don't give any examples - it also shows the issue has been around a while looking at the comments. They also suggest it is just inconvenient but it is actually a breaking change for me not to be able to do CI E2E tests
Desired behavior
Ejecting should continue with all the same features as currently setup by the cli - i.e. the marshalling scripts for tests exactly all run as before so that it can be run in a CI environment.
If I have to mess around setting up scripts to try and make the process run in the same thread on a server I don't control then that's broken IMHO.
I would also appreciate a workaround if anyone has one till this is fixed or the webpack part can be hooked into without ejecting.
Other Info
I did submit this to stack overflow first in the hope of getting an answer/workaround but since that hasn't happened I am now submitting it as a bug as this completely breaks my build My stack overflow question
The text was updated successfully, but these errors were encountered:
eject functionality is no longer available in the latest version (6.x+). For custom webpack configurations the following unofficial add-on is a suggested solution: https://github.com/manfredsteyer/ngx-build-plus
Versions
Angular CLI: 1.7.3 Node: 9.11.1 OS: win32 x64 Angular: 5.2.8 @angular/cli: 1.7.3 @angular-devkit/build-optimizer: 0.3.2 @angular-devkit/core: 0.3.2 @angular-devkit/schematics: 0.3.2 @ngtools/json-schema: 1.2.0 @ngtools/webpack: 1.10.2 @schematics/angular: 0.3.2 @schematics/package-update: 0.3.2 typescript: 2.5.3 webpack: 3.11.0
Repro steps
I have a problem with ejecting from the Angular CLI and running E2E on my build server. It works on my dev machine (and the build server prior to ejecting) but when I run it in Visual Studio online's automated build process it fails because it can't find localhost:4200 server.
Failed: Angular could not be found on the page http://localhost:4200/.If this is not an Angular application, you may need to turn off waiting for Angular.
My build step within visual studio online is
npm
withcustom
as the Command Type and:run-script e2e
which worked previously and generated artifacts from the test results which it then published ( Screenshot of my build steps showing the e2e call)The full code is a variation on the ng seed project and is on GitHub complete with a number of pre-configured test settings and headless chrome support https://github.com/zebslc/angular5mat to make it work in a CI/CT using visual studio online/Azure environment. I have had to temporarily revert my ejected cli branch because of this change.
"scripts": {
"ng": "ng",
"start": "webpack-dev-server --port=4200 --config webpack.dev.config",
"watch": "webpack --watch --config webpack.dev.config",
"build": "webpack --config webpack.dev.config",
"build:prod": "webpack --config webpack.prod.config",
"test": "karma start ./karma.conf.js",
"ct": "karma start ./karma.conf.js --single-run --browsers ChromeHeadless --sourcemaps=false",
"lint": "ng lint",
"e2e": "protractor ./protractor.conf.js",
"cover": "karma start ./karma.conf.js --code-coverage",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet"
},
My protractor config has the following default setting but it also contains puppeteer/headless chrome.
baseUrl: "http://localhost:4200/",
Observed behavior
As mentioned this was working perfectly prior to ejecting but I need to add more advanced features such as progressive web app/css profiling so it needs to be ejected. Am I now missing something obvious with my e2e script call and if so what?
The problem seems to be that the CLI creates an instance and runs the tests in the same thread whereas when it is ejected the web service tested against is creating a separate web service.
Discussions in a closed answer suggest you should be able to script it to work the same but then don't give any examples - it also shows the issue has been around a while looking at the comments. They also suggest it is just inconvenient but it is actually a breaking change for me not to be able to do CI E2E tests
Desired behavior
Ejecting should continue with all the same features as currently setup by the cli - i.e. the marshalling scripts for tests exactly all run as before so that it can be run in a CI environment.
If I have to mess around setting up scripts to try and make the process run in the same thread on a server I don't control then that's broken IMHO.
I would also appreciate a workaround if anyone has one till this is fixed or the webpack part can be hooked into without ejecting.
Other Info
I did submit this to stack overflow first in the hope of getting an answer/workaround but since that hasn't happened I am now submitting it as a bug as this completely breaks my build
My stack overflow question
The text was updated successfully, but these errors were encountered: