Skip to content

Commit

Permalink
Test present? and displayed?
Browse files Browse the repository at this point in the history
Fix #31
  • Loading branch information
bootstraponline committed Jun 3, 2015
1 parent 5071dda commit 192083a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/protractor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,16 @@ def async_two_arg
matched = !!(actual.match(firefox_local) || actual.match(remote_driver))
expect_equal matched, true
end

it 'handles watir present and webdriver displayed' do
protractor.ignore_sync = true

# watir returns false on .present? when the element doesn't exist
expect_equal browser.element(tag_name: 'html').present?, true
no_wait { expect_equal browser.element(tag_name: 'doesntexist').present?, false }

# webdriver throws element not found on .displayed? when the element doesn't exist
expect_equal driver.find_element(tag_name: 'html').displayed?, true
expect_no_element_error { driver.find_element(tag_name: 'doesntexist').displayed? }
end
end

0 comments on commit 192083a

Please sign in to comment.