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

browser().navigateTo() is delayed sometimes #322

Closed
vojtajina opened this issue Apr 7, 2011 · 3 comments
Closed

browser().navigateTo() is delayed sometimes #322

vojtajina opened this issue Apr 7, 2011 · 3 comments

Comments

@vojtajina
Copy link
Contributor

In scenario tests, if you navigate more than once, sometimes it doesn't change the browser's url (maybe because it's done asynchronously, so sometimes it's too delayed)

describe('test', function() {
  it('should navigate the browser - once', function() {
    browser().navigateTo('../../app/index.html#/phones/nexus-s');
    expect(browser().location().hash()).toBe("/phones/nexus-s");
  });

  it('should navigate the browser - once', function() {
    browser().navigateTo('../../app/index.html');
    browser().navigateTo('#/phones/nexus-s');
    expect(browser().location().hash()).toBe("/phones/nexus-s");
  });
});

The first test always passes...
The second one sometimes failed (very often)...
@esprehn
Copy link
Contributor

esprehn commented Apr 8, 2011

Hmm, this seems like a bug with how we handle hash navigation.

src/scenario/Application.js:86 doesn't wait for onload, assuming that assigning the hash to a frame causes the window below it to navigate immediately, which is likely wrong. It should probably use frame.load(...) to call the execute action, and then set the src.

In what browser do you see this?

@esprehn
Copy link
Contributor

esprehn commented Apr 8, 2011

I just checked in Chrome and changing the hash doesn't cause an onload event which explains why we don't use onload in the Application.js

@vojtajina
Copy link
Contributor Author

Firefox 3.6.16 (on Ubuntu) - both tests pass, always
Chrome 10.0.648.204 (on Ubuntu) - second test sometimes fails, sometimes passes

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