Skip to content

Commit

Permalink
additional fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Nov 9, 2016
1 parent d4fce90 commit 2107dc2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 33 deletions.
26 changes: 10 additions & 16 deletions _posts/2016-10-16-watir-6-0.md → _posts/2016-11-09-watir-6-0.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
layout: post
title: Watir 6.0
date: 2016-10-16
title: Watir 6.0 Released!
date: 2016-11-09
author: Titus Fortner
author_url: http://watirtight.com/
comments: true
categories: [Releases]
---

Watir 6.0 is now available on rubygems! Watir 6.0 is entirely implemented
Watir 6.0 is now available on RubyGems! Watir 6.0 is entirely implemented
with Selenium 3.0, and has several new features.
<!--more-->

Expand All @@ -29,12 +29,6 @@ for a complete list of updates.

Since Watir 6.0 Beta 5 there have been two significant additions.

# Watirspec repository deprecated
It is now much easier to write tests and submit Pull Requests!
The specs have been added to the Watir repository directly. The
previous implementation with a git submodule has always made
synchronizing changes between code and new tests difficult.

# Automatic Waits
A more thorough explanation surrounding the reasons for this change can
be found on this
Expand All @@ -47,20 +41,20 @@ the tests. If your test times have increased significantly, take a look at

# Updated Wait methods

`#when_present` is gone, and #wait_until and #wait_while have gotten
`#when_present` is gone, and `#wait_until` and `#wait_while` have gotten
more powerful.

You shouldn't need when present, but if you do, you can use the new
You shouldn't need `#when_present`, but if you do, you can use the new
implementation of `#wait_until_present`, which returns the object
being waited for to allow for use in chaining.

Here are some examples of the ways that the new `#wait_until` and
`#wait_while` methods can be used:

{% highlight ruby %}
Element#wait_until(&:present?).text
Element#wait_until(timeout: 5, &:present?).text
Element#wait_until(message: “Sorry”, &:present?)
Element#wait_while { |el| el.text == ‘foo’ }
Element#wait_while { element.text == ‘foo’ }
element.wait_until(&:present?).text
element.wait_until(timeout: 5, &:present?).text
element.wait_until(message: “Sorry”, &:present?)
element.wait_while { |el| el.text == ‘Foo’ }
element.wait_while { browser.title == ‘Foo’ }
{% endhighlight %}
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ <h1>{{ page.title }}</h1>

<ul>
<li>Read our <a href="http://www.rubydoc.info/gems/watir-webdriver">documentation</a> to get started</li>
<li>See what <a href="/users">companies are using Watir</a></li>
<li>Read the <a href="/watir-6-faq/">Watir 6.0 FAQ</a></li></ul>
<li>See what <a href="/users">companies are using Watir</a></li>
<li>Read the <a href="/watir-6-faq/">Watir 6.0 FAQ</a></li></ul>
</div>

<div class="unit half demo">
Expand Down
32 changes: 17 additions & 15 deletions watir-6-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: Watir 6 FAQ
* [Why are my tests failing because of a geckodriver error?](#C)
* [Why are my Internet Explorer tests failing?](#D)
* [Why am I getting warnings about #always_locate and/or #prefer_css?](#E)
* [Why am I getting warnings about \#when_present and \#while_present being deprecated?](#F)
* [Why am I getting warnings about \#when_present being deprecated?](#F)
* [Why am I getting warnings about keywords versus arguments?](#G)
* [Why are my tests taking so long?](#H)
* [What is with this "&:" symbols in the wait documentation?](#I)
Expand All @@ -18,18 +18,18 @@ title: Watir 6 FAQ
### Answers

<span id="A">**What about watir-webdriver?**</span><br>
All of the watir-webdriver code has been moved to the watir gem.
The future of Watir is using the w3c specification for automating
browsers, and that means basing the active implementation of Watir
All of the watir-webdriver code has been moved into the watir gem.
The future of Watir is using the W3C specification for browser
automation, and that means basing the active implementation of Watir
on Selenium.
<br><br>

<span id="B">**Why are my tests failing because of a chromedriver error?**</span><br>
Due to the changes Mozilla has made recently, it makes more sense for
chrome to be the default browser.
[Download Chromedriver](http://chromedriver.storage.googleapis.com/index.html)
Chrome to be the default browser.
[Download ChromeDriver](http://chromedriver.storage.googleapis.com/index.html)
and place it somewhere on your PATH.
[See here for more information](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver).
[See here for more information](https://sites.google.com/a/chromium.org/chromedriver/downloads).
<br><br>

<span id="C">**Why are my tests failing because of a geckodriver error?**</span><br>
Expand All @@ -43,7 +43,7 @@ title: Watir 6 FAQ
<span id="D">**Why are my Internet Explorer tests failing?**</span><br>
Watir now relies on the Selenium driver for Internet Explorer. If
you are having issues updating your tests to get them to pass, please
[ask us for help](http://watir.github.io/help/)
[ask us for help](http://watir.github.io/help/).
<br><br>

<span id="E">**Why am I getting warnings about #always_locate and/or #prefer_css?**</span><br>
Expand All @@ -54,10 +54,11 @@ title: Watir 6 FAQ

<span id="F">**Why am I getting warnings about #when_present being deprecated?**</span><br>
Watir by default now automatically calls `#when_present` and
`#when_enabled` before taking actions on elements where appropriate,
so their use is redundant. If you have decided to change the
recommended settings to use `Watir.relaxed_locate = false`, then
you can just swap out from these:
`#when_enabled` before taking actions on elements as appropriate,
so their use is redundant. If you are using the default settings you can just
delete these methods from your tests. If you have decided to change away from the
recommended settings (by explicitly setting `Watir.relaxed_locate = false`), then
swap out from these:

{% highlight ruby %}
browser.element.when_present.click
Expand All @@ -73,8 +74,9 @@ browser.element.wait_until(&:enabled?).click
<br><br>

<span id="G">**Why am I getting warnings about keywords versus arguments?**</span><br>
#wait_until and #wait_while now take keyword arguments instead of
ordered parameters. Previously, you would do this:
In order to make it more explicit what the method is doing, `#wait_until` and
`#wait_while` methods now accept keyword arguments, and the use of ordered parameters
is deprecated. Previously, you would do this:

{% highlight ruby %}
# Specify both parameters:
Expand All @@ -85,7 +87,7 @@ element.wait_until(5) { |el| el.present? }
element.wait_until(nil, "Oops not not there") { |el| el.present? }
{% endhighlight %}

Whereas now you need to explicitly specify the timeout and the message keywords
Whereas now you need to explicitly specify the timeout and/or the message keywords:

{% highlight ruby %}
# Specify both parameters:
Expand Down

0 comments on commit 2107dc2

Please sign in to comment.