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

getLocationAbsUrl on a non-angular page expects angular to exist #3097

Open
cnishina opened this issue Apr 6, 2016 · 2 comments
Open

getLocationAbsUrl on a non-angular page expects angular to exist #3097

cnishina opened this issue Apr 6, 2016 · 2 comments

Comments

@cnishina
Copy link
Member

cnishina commented Apr 6, 2016

Clicking on my "doge meme" link and testing to see the abs url should work. Instead receive error message: "Failed: unknown error: angular is not defined".

website:

<ul class="pet" id="pet_id">
  <li class="dog" id="dog_id" name="dog_name">wow such <a href="https://en.wikipedia.org/wiki/Doge_(meme)">Doge meme</a></li>
  <li class="cat" id="cat_id" name="cat_name">Cat</li>
</ul>

spec.js:

it('should be clicked', function() {
    browser.ignoreSynchronization = true;
    browser.get('http://localhost:8000/web.html');
    element(by.partialLinkText('Doge')).click();
    expect(browser.getLocationAbsUrl()).toBe('https://en.wikipedia.org/wiki/Doge_(meme)');
  });

repo:
https://github.com/cnishina/protractor-examples/tree/master/webdriver

@juliemr
Copy link
Member

juliemr commented Apr 7, 2016

This is a documentation fail for us.

getLocationAbsUrl is meaningless without Angular. It's intended as a supplement to getCurrentUrl when that doesn't work. (some IE situations)

Maybe we should rename it to something more useful, or make it very clear in the documentation that it doesn't work for other pages.

@juliemr juliemr changed the title Navigation to a non angular page expects angular to exist getLocationAbsUrl on a non-angular page expects angular to exist Apr 7, 2016
@juliemr
Copy link
Member

juliemr commented Apr 26, 2016

We should fix this and the docs for #3007 at the same time - related issue.

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

3 participants