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

browser.wait() icoherent api vs documentation #3679

Closed
pearljamik opened this issue Oct 28, 2016 · 2 comments
Closed

browser.wait() icoherent api vs documentation #3679

pearljamik opened this issue Oct 28, 2016 · 2 comments

Comments

@pearljamik
Copy link

pearljamik commented Oct 28, 2016

Documentation states that browser.wait() is a blocking call. Whereas when using api, the browser.wait() is definitely not waiting for resolution, it continues execution.

From documentation:

See also ExpectedConditions

Example: Suppose you have a function, startTestServer, that returns a promise for when a server is ready for requests. You can block a WebDriver client on this promise with:
Example
Code

var started = startTestServer();
browser.wait(started, 5 * 1000, 'Server should start within 5 seconds');
browser.get(getServerUrl());

The actual behaviour is DIFFERENT !

Please correct the behaviour or the documentation since it is VERY misleading and this is BASCIC functionality people want to use. If you want Protractor to spreat this is VERY important of an issue.

Bug report

  • Node Version: ``
  • Protractor Version: 4.0.9
  • Angular Version: 2.0
  • Browser(s): ``
  • Operating System and Version ``
  • Your protractor configuration file
  • A relevant example test
  • Output from running the test
  • Steps to reproduce the bug
  • The URL you are running your tests against (if relevant)

Feature Request

  • Reasons for adopting new feature
  • Is this a breaking change? (How will this affect existing functionality)
@NickTomlin
Copy link
Contributor

Could you clarify by what you mean by

Whereas when using api, the browser.wait() is definitely not waiting for resolution

browser.wait will pause execution of the webdriver flow until the timeout or the condition is satisfied. Without knowing what startTestServer returns it's hard to understand what is going on here but I suspect it is an issue in that funciton.

Could you provide a clear reproducible example repo that isolates this?

@sjelin
Copy link
Contributor

sjelin commented Dec 22, 2016

I think he means it doesn't block js execution, only control flow execution. Which is probably confusing for beginners. I'll fix it

@sjelin sjelin self-assigned this Dec 22, 2016
sjelin added a commit to sjelin/protractor that referenced this issue Jan 12, 2017
The existing documentation was redundant and confusing.

Closes angular#3679
sjelin added a commit to sjelin/protractor that referenced this issue Jan 12, 2017
The existing documentation was redundant and confusing.

Closes angular#3679
heathkit pushed a commit that referenced this issue Jan 14, 2017
The existing documentation was redundant and confusing.

Closes #3679
igniteram pushed a commit to igniteram/protractor that referenced this issue Feb 21, 2017
The existing documentation was redundant and confusing.

Closes angular#3679
bodyduardU pushed a commit to bodyduardU/protractor that referenced this issue Dec 5, 2022
The existing documentation was redundant and confusing.

Closes angular/protractor#3679
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

4 participants