Protractor Tests
Is there any guidance on setting up and running Angular protractor tests on Appveyor?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 10 Sep, 2015 10:51 PM
Nope. Are there any specific requirements?
- Feodor
2 Posted by Dave on 10 Sep, 2015 11:11 PM
We need the ability to run protractor tests during our build and fail the build if the tests do not pass.
Here is how one would setup protractor: https://angular.github.io/protractor/#/.
It uses the Chrome web driver.
3 Posted by Dave on 11 Sep, 2015 06:31 PM
Is it possible? Or should we try to found another solution?
Support Staff 4 Posted by Feodor Fitsner on 11 Sep, 2015 06:35 PM
You could give it a try. I don't see any reasons why it's not possible. People run Jasmine tests, Selenium tests against both Chrome and FF without any problems.
5 Posted by Dave on 11 Sep, 2015 06:42 PM
Do they set it up via the test scripts? Also, how would one start up the asp.net web app before the test run? The app needs to be running for protractor test runs.
Thanks.
Support Staff 6 Posted by Feodor Fitsner on 11 Sep, 2015 06:44 PM
Right, you should provide your own script for deploying app and running tests.
There is IIS available on build workers - you can deploy your app to there before running tests. XCopy or Web Deploy or PS can be used. Some people use IIS Express.
7 Posted by Dave on 11 Sep, 2015 06:50 PM
Great. Thanks. A couple of more questions:
1) So the deployment would something like the following provider: http://www.appveyor.com/docs/deployment/local?
2) How do you report back test failures so we can properly fail the build if the tests don't pass?
Thanks.
Support Staff 8 Posted by Feodor Fitsner on 11 Sep, 2015 11:34 PM
1) Yes, you can use Local deployment provider. This case you could run your tests on "after_deploy" section.
2) If test runner process exits with non-zero code then build will fail automatically. Also, to pass test details to build results you can use build worker API: http://www.appveyor.com/docs/build-worker-api#add-tests
9 Posted by Bjørn Sørensen on 09 Nov, 2015 09:50 AM
Hi Feodor,
I'm using the Local provider for deploying my ASP.NET MVC project before running some Protractor tests.
I do have some problems accessing the running IIS in my tests. Can you clarify hos I set this up?
My appveyor.yml has this configuration:
And I expected to access the IIS with http://localhost:44300/.
Here is my build log at the deployment step: https://ci.appveyor.com/project/Crevil/kitos/build/1.0.148#L2595
Am I missing something or expecting the wrong things?
Regards
Bjørn
Support Staff 10 Posted by Feodor Fitsner on 10 Nov, 2015 12:33 AM
Everything looks good to me. Before running tests you may try querying that site with something like
Invoke-WebRequest
cmdlet to see if it responds and check the response.Support Staff 11 Posted by Feodor Fitsner on 10 Nov, 2015 12:33 AM
And you can look into build worker via RDP to further troubleshoot the issue: http://www.appveyor.com/docs/how-to/rdp-to-build-worker
12 Posted by Bjørn Sørensen on 10 Nov, 2015 07:45 AM
I'll look in to this. How have I missed the RDP option. This is brilliant! Thanks again.
13 Posted by Bjørn Sørensen on 10 Nov, 2015 12:23 PM
I now have it running. I missed the fact that I needed the self signing certificate to run this right.
Further more I had not created a specific build configuration, which proved necessary when getting to the configurations with the database etc.
The ability to use RDP was really necessary to find these issues, so thanks for this!
Support Staff 14 Posted by Feodor Fitsner on 10 Nov, 2015 05:33 PM
Great, thanks for the update!
15 Posted by Bjørn Sørensen on 13 Nov, 2015 07:41 AM
Hi again,
I have a problem when running the protractor tests. It's a long shot, but maybe you have a suggestion?
I get this error:
My search of help has only put me in the direction of Java things, but the only difference I have noticed is AppVeyor running Java 1.8.0_66 and my local machine runs 1.8.0_65. Can this be the reason? The error happens when the selenium-webdriver is shutting down.For more information see this SO
Support Staff 16 Posted by Feodor Fitsner on 13 Nov, 2015 05:38 PM
Hi Bjorn,
Have you tried submitting an issue on Protractor repo: https://github.com/angular/protractor/issues ? You may get answers faster if contact Protractor developers there.
Imho, bringing up Selenium Java server is not the "lightest" solution. There are "shorter" ways like WebdriverIO or WebDriverJs that works with web drivers directly.
17 Posted by Bjørn Sørensen on 16 Nov, 2015 07:29 AM
Hi Feodor,
Thank you for the reply. I have not. But I will. :)
I will also look into the lighter ways. I've read this approach on the protractor documentation pages, so I thought this was the way.
18 Posted by Bjørn Sørensen on 23 Nov, 2015 10:20 AM
Hi Feodor,
Protractor team expect it to be an issue with the build worker and the Java configuration.
See the response on github.
I've decided to run things on BrowserStack instead of locally. This "fixes" the issue to me.
Support Staff 19 Posted by Feodor Fitsner on 23 Nov, 2015 06:41 PM
Thanks for the update.
Support Staff 20 Posted by Feodor Fitsner on 09 Feb, 2016 07:15 PM
There was a similar issue with using Selemium server from node.js which was fixed by passing
-Djna.nosys=true
to selenium Java process command-line: http://help.appveyor.com/discussions/questions/2093-using-selenium#...If there is a way to pass this argument to
java.exe
call in Protractor I think the issue will be resolved too.Support Staff 21 Posted by Feodor Fitsner on 10 Feb, 2016 02:11 AM
Here you are! This is how to fix the issue with JNA for Protractor: https://github.com/FeodorFitsner/AppVeyor-Protractor-test-app/blob/...
Build results: https://ci.appveyor.com/project/FeodorFitsner/appveyor-protractor-t...
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:04 AM.