New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate timeouts when using hash navigation #85

Closed
davidderus opened this Issue Oct 9, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@davidderus

davidderus commented Oct 9, 2018

Describe the bug
The command NAVIGATE times out with dynamic apps using hash navigation.

If I'm loading a JS app relying on hash navigation, and then navigating to a route, Chrome will load the page but Ferret will not aknowledge it and will timeout.

To Reproduce
Steps to reproduce the behavior:

echo "LET doc = DOCUMENT('http://todomvc.com/examples/backbone', true)

WAIT_ELEMENT(doc, '.new-todo')

NAVIGATE(doc, 'http://todomvc.com/examples/backbone/#/completed')

RETURN true" > test.fql

ferret test.fql

The output will be:

Failed to execute the query
operation timed out: NAVIGATE(doc,'http://todomvc.com/examples/backbone/#/completed') at 5:0

Expected behavior

  • The command should not fail as the page has been loaded in Chrome
  • Ferret should continue

Desktop

  • OS: macOS 10.12.6
  • Browser: alpeware/chrome-headless-trunk with Chromium 71.0.3572.0
  • Version: 65a7f2a
@ziflex

This comment has been minimized.

Show comment
Hide comment
@ziflex

ziflex Oct 9, 2018

Contributor

@davidderus hi!
Yes, I guess I know why it happens. Looks like 'load' event does not get fired during this navigation.
We may add a 2nd optional parameter to NAVIGATE(url [,wait]) which would force Ferret to not wait for load event from the browser. And then, you could just use WAIT_ELEMENT function.

In your particular example, you could just click the button with the following code: CLICK(doc, "body > section > footer > ul > li:nth-child(3) > a").

Contributor

ziflex commented Oct 9, 2018

@davidderus hi!
Yes, I guess I know why it happens. Looks like 'load' event does not get fired during this navigation.
We may add a 2nd optional parameter to NAVIGATE(url [,wait]) which would force Ferret to not wait for load event from the browser. And then, you could just use WAIT_ELEMENT function.

In your particular example, you could just click the button with the following code: CLICK(doc, "body > section > footer > ul > li:nth-child(3) > a").

@ziflex ziflex added the question label Oct 9, 2018

@davidderus

This comment has been minimized.

Show comment
Hide comment
@davidderus

davidderus Oct 9, 2018

Yes, it works fine with CLICK and I'll use it for now.

I guess your suggestion for NAVIGATE could do the job and the timeout of WAIT_ELEMENT (or its default value) could be a good replacement for the navigate wait time in this specific case.

davidderus commented Oct 9, 2018

Yes, it works fine with CLICK and I'll use it for now.

I guess your suggestion for NAVIGATE could do the job and the timeout of WAIT_ELEMENT (or its default value) could be a good replacement for the navigate wait time in this specific case.

@ziflex

This comment has been minimized.

Show comment
Hide comment
@ziflex

ziflex Oct 9, 2018

Contributor

@davidderus great! I would hold off the change of NAVIGATE until we get more use cases when it would be the only way to solve a problem.

Contributor

ziflex commented Oct 9, 2018

@davidderus great! I would hold off the change of NAVIGATE until we get more use cases when it would be the only way to solve a problem.

@ziflex ziflex closed this Oct 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment