cheezy/page-object

Wait for element attribute values is not supported.

kapoorlakshya opened this issue · 0 comments

As of watir 6.13, we are able to replace element.wait_until { |el| el.text == 'Foo' } with element.wait_until(text: 'Foo'). However, this is not supported by this gem as of v2.2.5.

See [2] for error.

[1] pry(#<Test)> @browser.div(class: 'notificationMessage').wait_until(text: "Your request has been successfully submitted.")

=> #<Watir::Div: located: true; {:class=>"notificationMessage", :tag_name=>"div"}>
[2] pry(#<Test>)> @current_page.notification_message_element.wait_until(text: "Your request has been successfully submitted.")

=> NoMethodError: undefined method `zero?' for {:text=>"Your request has been successfully submitted."}:Hash
from I:/Ruby223x64/lib/ruby/gems/2.3.0/gems/watir-6.15.0/lib/watir/wait.rb:86:in `run_with_timer'
[3] pry(#<Test> @current_page.notification_message_element.element.wait_until(text: "Your request has been successfully submitted.")

=> #<Watir::Div: located: true; {:class=>"notificationMessage", :visible=>true, :tag_name=>"div"}>

I'll try to figure out the changes required and submit a PR to fix this.