-
Notifications
You must be signed in to change notification settings - Fork 51
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
How to build with ng e2e and run config file via protractor-flake? #100
Comments
I have the same issue. Could you please suggest. |
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! |
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.
As per the above code, There is a builder for protractor which takes protractor conf file as input. Thanks |
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! |
Is your 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 My current working script (in You may run into a scenario where your tests fail because |
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? |
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 |
Hi there!
We are trying to make protractor-flake work with building our code before running the tests.
Right now all I got working is a command like this "protractor-flake --parser standard --max-attempts=3 -- protractor.conf.js" which is good to run protractor-flake tests on an already built enviroment.
However, every time I try something like "protractor-flake --parser standard --max-attempts=3 -- ng e2e" or similar, I get different errors and nothing works.
What I tried:
Adding
flake
configuration withoutprotractorConfig
to angular.json, and then running npm run flake ("protractor-flake --parser standard --max-attempts=3 -- ng flake./protractor.conf.js") results in three idle and instant re-tries with the message "Error: Error: more than one config file specified"Executing "protractor-flake --parser standard --max-attempts=3 -- ng e2e" with ./protractor.conf.js defined in e2e/protractorConfig property in angular.json results in the same message and behavior.
Adding the whole "protractor-flake --parser standard --max-attempts=3 -- ./protractor.conf.js" line to e2e/protractorConfig in angular.json and running it via "npm run e2e" command results in code actually being built, but after build is done it all fail with the message:
"[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'"
Please, advise what can be done. I searched all internet and never found a single example of using protractor-flake with abgular-cli.
"protractor-flake": "version": "3.3.0",
"protractor": "version": "5.4.1",
"@types/node": "^6.0.117",
"@angular/cli": "^6.2.3".
The text was updated successfully, but these errors were encountered: