Skip to content

Backport Capybara.wait_until#144

Merged
dtognazzini merged 9 commits intomasterfrom
backPortCapybaraWaitUntil
Apr 27, 2016
Merged

Backport Capybara.wait_until#144
dtognazzini merged 9 commits intomasterfrom
backPortCapybaraWaitUntil

Conversation

@dtognazzini
Copy link
Copy Markdown
Contributor

@dtognazzini dtognazzini commented Apr 27, 2016

  • Provide Capybara.wait_until functionality through AePageObjects.wait_until.
  • Deprecate and replace all AePageObjects::Waiter functionality with an internal poll_until. AePageObjects::Waiter will be removed in version 2.

Addresses #99

@dtognazzini dtognazzini force-pushed the backPortCapybaraWaitUntil branch from 65e151d to abe9743 Compare April 27, 2016 06:10
@dtognazzini
Copy link
Copy Markdown
Contributor Author

@ipmsteven, @pkmiec

Hey guys. I'm curious what your thoughts are on these changes.

wait_until is the same code from Capybara 1, which is often very useful when writing page objects code where you need to wait for a condition to occur over several elements. Following the removal of wait_until from Capybara 1, most folks have moved this type of waiting into the test suites, which is a good idea and something we've done as well. Still, sometimes you need to perform waiting actually in page object code.

poll_until is pretty much the same thing as wait_until, but zeroes-out the per-node waiting, which is super useful when asking questions like "is this node absent/present/visible/hidden right now?" and you don't want to wait. poll_until is also used for "document loading" when looking across multiple windows. I was struggling finding a good name for poll_until. My thought was that by ignoring the per node waiting, the user wants to do something like poll the page, but not wait for any particular element. Whereas wait_until implies waiting for an arbitrary condition to occur, poll_until implies polling the page for a condition, which is signified by zeroing-out the per node wait time.

@dtognazzini
Copy link
Copy Markdown
Contributor Author

After talking with @pkmiec, we concluded that the poll_until functionality, while useful internally to AePageObjects, doesn't have use externally. I've made some changes to hide it.

@dtognazzini dtognazzini merged commit 9d4c313 into master Apr 27, 2016
@dtognazzini dtognazzini deleted the backPortCapybaraWaitUntil branch April 27, 2016 21:29
@ipmsteven
Copy link
Copy Markdown
Contributor

👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants