spriteCloud / lapis-lazuli

Cucumber helper functions and scaffolding for easier test automation suite development.
Other
7 stars 7 forks source link

browser.wait does not show selectors when failing to find an element #43

Closed sjieg closed 7 years ago

sjieg commented 7 years ago

When failing to find an element in browser.find the selector is shown: {:pick=>:first, :mode=>:match_one, :selectors=>[{:element=>"#doesnotexist"} But when using browser.wait only the timeout time is shown.

Reproduced in irb

irb(main):001:0> require 'lapis_lazuli'
=> true
irb(main):002:0> include LapisLazuli
=> Object
irb(main):003:0> browser.goto 'google.com'
=> "http://google.com"
irb(main):004:0> browser.find('#doesnotexist')
RuntimeError: Error in find - Cannot find elements with selectors: {:pick=>:first, :mode=>:match_one, :selectors=>[{:element=>"#doesnotexist"}]} [ https://www.google.nl/?gfe_rd=cr&ei=tzaYWI3LG6zc8AeQq5eQCw&gws_rd=ssl ]
irb(main):005:0> browser.wait(:like => [:div, :id, 'doesnotexist'])
Watir::Wait::TimeoutError: timed out after 10 seconds [ https://www.google.nl/?gfe_rd=cr&ei=tzaYWI3LG6zc8AeQq5eQCw&gws_rd=ssl ]
irb(main):007:0>