This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
Protractor tests and configuration should be updated #478
Milestone
Comments
From my point of view, there's absolutely no reason not to do that. Small unobtrusive change. I'll get right on it unless you'd rather like to create a PR @lordgreg? |
A couple of months ago I tried to have the default protractor tests run in our travis setup but didn't succeed. Maybe this is worth looking into again. Since that way we could ensure that the default protractor tests work with every build, without having to manually run them (this is what I am mostly doing right now). |
@gruppjo I don't care :) If you have time you do it, otherwise I'll push things in next week 🙊 |
@lordgreg. Implementing this now. |
gruppjo
added a commit
that referenced
this issue
Feb 15, 2017
👍 |
gruppjo
added a commit
that referenced
this issue
Feb 17, 2017
#478 reporters update for karma and protractor conf
PR: protractor and karma conf update for better reporting: #489 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi..
I was recently told to dive deeper into the whole e2e testing process. One of the big things I was told to do, or to make it work is to run the e2e tests on devices. I succeeded but with issues because of which, I think we should change some parts of configuration and generating of protractor files.
1. Before explaining the issue
Looking at
protractor.conf.js
, we find out thebaseUrl
is set tohttp://localhost:3000
. and within the tests, switching states we are usingbrowser.get('/#/someRoute')
. Merging this two things together, we gethttp://localhost:3000/#/someRoute
. It works.2. Now, we want to take a huge leap into the App Testing on Device/Simulator/Emulator. There, we find out few things:
file:///
baseThat being said, lets assume we first update the baseUrl, which is now:
file:///android_asset/www/index.html
(Android in this example). We can get the path usinglocation.origin + location.pathname
.When now using existing calls using
browser.get('/#/someRoute')
, we are getting url which looks like this:file:///android_asset/www/index.html/#/someRoute
, which results in network error (or simply said, file not found).3. So, what should we do?
To make protractor tests universal, meaning independent of platform on which we are running tests, we have to change two things,
first, update
protractor.conf.js
baseUrl
fromhttp://localhost:3000
tohttp://localhost:3000/
,second, change all occurrences of
browser.get()
in protractor tests which start with/#/someRoute
into#/someRoute
.This way, we avoid the collision of paths for different platforms. There's many other things but this one is the single one found to be working properly. This does not concern changing any other part of app, only protractor and, in case of device testing, protractor+appium.
I'd love to hear your comment about this @gruppjo & @MathiasTim
The text was updated successfully, but these errors were encountered: