protractor icon indicating copy to clipboard operation
protractor copied to clipboard

baseUrl full path of the resource support

Open psech opened this issue 12 years ago • 3 comments

Thanks for fixing baseUrl in 0.17.0. Now it works fine with ignoreSynchronization = true.

It works fine for URLs like http://domain but does not work for http://domain/resource_path. The resource path is being ignored.

My AUT lies under http://domain_name/demo which is static for all tests.

Would it be possible to support extended paths?

psech avatar Jan 31 '14 20:01 psech

The baseUrl uses node's url module and it's resolve function. Check out the docs here: http://nodejs.org/api/url.html#url_url_resolve_from_to

You probably want an extra / at the end of your baseUrl.

Please open a new issue if that does not solve your problem.

juliemr avatar Jan 31 '14 21:01 juliemr

Thank you for the tip with url.resolve() it works fine now.

As one of my urls is http://localhost/demo/#/static, I have got:

  • in config: baseUrl: 'http://localhost/demo/',
  • in spec: ptor.get('#/static'); for subpage
  • in spec: ptor.get(''); for 'http://localhost/demo/',`

I was using ptor.get('/#/static'); with slash at very beginning, which truncated demo/ part

psech avatar Feb 04 '14 11:02 psech

Why we can't put the '#' in baseUrl? Like this: baseUrl: 'http://localhost/#' Url in spec: '/login' For example. Because if I do that it doesn't work, but if i put the hashtag in url in spec and not in baseUrl it works, why is that?

Pablodotnet avatar Aug 08 '16 18:08 Pablodotnet