Comments (7)
I have the same issue. Could you please suggest.
from protractor-flake.
Could I get either of you to create a small repository that reproduces the issue? I personally don't use angular-cli so that would make the problem/use case easier to understand.
Thanks!
from protractor-flake.
Hi Nick,
To run the e2e tests as part of the build, We need to configure it in angular.json file.
Below is a sample build configuration to launch protractor.
"testapp-e2e": { "root": "e2e/testapp", "sourceRoot": "e2e/testapp", "projectType": "application", "architect": { "e2e": { "builder": "**@angular-devkit/build-angular:protractor**", "options": { "protractorConfig": "**./protractor.conf.js**", "devServerTarget": "testapp:serve" } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "e2e/tsconfig.e2e.json" ], "exclude": [ "**/node_modules/**" ] } } } },
As per the above code, There is a builder for protractor which takes protractor conf file as input.
Could you please create a custom builder to launch protractor-flake as part of the build process.
Thanks
from protractor-flake.
Unfortunately I still don't understand the use case and I don't have time right now to create a custom builder. I'd welcome a pull request for one though since it sounds like it would be helpful for others in the community. Thanks!
from protractor-flake.
"[11:03:12] E/configParser - Error code: 105
[11:03:13] E/configParser - Error message: failed loading configuration file C:\Users\ilia.danilov\WebStormProjects\dashboard_frontend\protractor-flake --parser standard --max-attempts=3 -- .\protractor.conf.js
[11:03:13] E/configParser - Error: Cannot find module 'C:\Users\ilia.danilov\WebStormProjects\dashboard_frontend\protractor-flake --parser standard --max-attempts=3 -- .\protractor.conf.js'"
Is your protractor.conf.js
really in dashboard_frontend\protractor.conf.js
? By default it should be in dashboard_frontend\e2e\protractor.conf.js
. If that is the case you want:
protractor-flake --parser standard --max-attempts=3 -- e2e\protractor.conf.js
Just a small thought on that.
As far as getting the build configuration to work with Angular, I too have been searching of a way to achieve this. Having found nothing online about this I have opted to bypass Angular since this is mainly protractor's domain anyway.
Note: this is something of a workaround, I am surprised that Angular/Protractor do not provide some simple way of doing this.
My solution is to run an npm script that uses protractor-flake to run the e2e test suite. Because of the way I have my deployment pipeline setup I cannot simply run protractor-flake, I must first use ng serve
(or similar e.g. build -> http-server), because I want to test on localhost. The issue is ng serve && protractor-flake <args>
will not work because ng serve
does not complete and will block the second command. To get around this I can daemonise (run in the background) ng serve
. I used foreverjs to do this (other packages could be used).
My current working script (in package.json
"scripts") is as follows:
"e2e-retry": "forever start node_modules/@angular/cli/bin/ng serve && webdriver-manager update && protractor-flake --parser standard --max-attempts=3 -- e2e/protractor.conf.js && forever stopall"
This can be run using npm run e2e-retry
.
You may run into a scenario where your tests fail because ng serve
takes a while to build, this can be solved by using the onPrepare()
method in protractor.conf.js
, similarly to how you might deal with a login page (see protractor docs)
from protractor-flake.
"[11:03:12] E/configParser - Error code: 105
[11:03:13] E/configParser - Error message: failed loading configuration file C:\Users\ilia.danilov\WebStormProjects\dashboard_frontend\protractor-flake --parser standard --max-attempts=3 -- .\protractor.conf.js
[11:03:13] E/configParser - Error: Cannot find module 'C:\Users\ilia.danilov\WebStormProjects\dashboard_frontend\protractor-flake --parser standard --max-attempts=3 -- .\protractor.conf.js'"Is your
protractor.conf.js
really indashboard_frontend\protractor.conf.js
? By default it should be indashboard_frontend\e2e\protractor.conf.js
. If that is the case you want:
protractor-flake --parser standard --max-attempts=3 -- e2e\protractor.conf.js
Just a small thought on that.As far as getting the build configuration to work with Angular, I too have been searching of a way to achieve this. Having found nothing online about this I have opted to bypass Angular since this is mainly protractor's domain anyway.
Note: this is something of a workaround, I am surprised that Angular/Protractor do not provide some simple way of doing this.
My solution is to run an npm script that uses protractor-flake to run the e2e test suite. Because of the way I have my deployment pipeline setup I cannot simply run protractor-flake, I must first use
ng serve
(or similar e.g. build -> http-server), because I want to test on localhost. The issue isng serve && protractor-flake <args>
will not work becauseng serve
does not complete and will block the second command. To get around this I can daemonise (run in the background)ng serve
. I used foreverjs to do this (other packages could be used).My current working script (in
package.json
"scripts") is as follows:
"e2e-retry": "forever start node_modules/@angular/cli/bin/ng serve && webdriver-manager update && protractor-flake --parser standard --max-attempts=3 -- e2e/protractor.conf.js && forever stopall"
This can be run usingnpm run e2e-retry
.You may run into a scenario where your tests fail because
ng serve
takes a while to build, this can be solved by using theonPrepare()
method inprotractor.conf.js
, similarly to how you might deal with a login page (see protractor docs)
I use your command "forever start node_modules/@angular/cli/bin/ng serve && webdriver-manager update && protractor-flake --parser standard --max-attempts=3 -- e2e/protractor.conf.js && forever stopall" ro run test.But always hit error "This site can't be reached"when open localhost. Do you have any suggestion?
from protractor-flake.
I can't say I have had this problem myself. Would be good to see your console output when this is happening, is everything working successfully? It may be that ng serve is failing but because it is being run by forever you can't see the error being thrown. You might want to check that you can just get your app to be served from a forever process before also attempting to test. i.e. just check that forever start node_modules/@angular/cli/bin/ng serve
works and you can access localhost.
from protractor-flake.
Related Issues (20)
- The automated release is failing 🚨 HOT 1
- Protractor-flake no show outputs in console HOT 18
- Reruning all the tests not just the failed ones with cucumber. HOT 1
- protractor-flake doesn't run tests if suite is not specified HOT 3
- protractor-flake doesn't run the remaining tests after retrying the failed test HOT 5
- protractor-flake finds the typescript file (not the compiled file) on retry HOT 5
- protractor flake executing all suites mentioned instead of specific suite HOT 2
- Feature Request: Option to mark failing and pending specs as failure to be picked up for rerun in flake
- Same failed spec being marked to run twice with cucumber HOT 3
- Failing Cucumber Scenarios causing entire feature files to re-run HOT 4
- Protractor Flake is not working with cucumber? HOT 2
- Feature Request: Expose attemptNo or allow code to be specified in beforeAttempts/afterAttempts HOT 6
- Easier way to specify path of custom parser HOT 5
- screenshots of retries overwrite the original run HOT 4
- Running serve as part of Flake HOT 4
- retryconfig doesn't work HOT 3
- running node ./protractor-flake-retry.js works putting than command inside npm run test fails HOT 3
- seleniumAddress HOT 2
- how to use protractor arguments with yarn 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 protractor-flake.