Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

baseUrl fails with AngularJS/NodeWebkit #1266

Closed
mikemilano opened this issue Aug 29, 2014 · 2 comments
Closed

baseUrl fails with AngularJS/NodeWebkit #1266

mikemilano opened this issue Aug 29, 2014 · 2 comments

Comments

@mikemilano
Copy link
Contributor

I'm using AngularJS in a NodeWebkit app.

Per #508, url.resolve() is used to join baseUrl and the argument to browser.get().

NodeWebkit uses file:// paths, so baseUrl gets stripped down to file:/// regardless of the path you define.

Is there a work-around for this? I would really like to avoid concatenating them directly in my tests.

@juliemr
Copy link
Member

juliemr commented Aug 29, 2014

No workaround that I know of - it's really just a simple call to url.resolve.

mikemilano added a commit to mikemilano/protractor that referenced this issue Aug 29, 2014
…tion on baseUrl and destination when the baseUrl begins with file://
@mikemilano
Copy link
Contributor Author

This resolves the issue for me. It would be nice to have this for nodewebkit testing. path.resolve() does the same thing so I just concatenated them when the baseUrl begins with file:///.

Protractor.prototype.get = function(destination, opt_timeout) {
  ...
  destination = this.baseUrl.indexOf('file://') === 0 ?
    this.baseUrl + destination : url.resolve(this.baseUrl, destination);

Oops, the diff looks more complex because my IDE stripped trailing spaces.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants