You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now sections are threaded as elements with some other elements in it but this approach makes unable to use page methods inside sections: wait_until { login_button? } will raise NoMethodError: undefined method 'wait_until' for Watir::HTMLElement
In the short term, you could work around the issue by calling wait_until directly against the Watir::Browser, which is returned by the page object's browser method:
browser.wait_until { login_button? }
But I think sections should be treated as PageObjects with all related methods
The text was updated successfully, but these errors were encountered:
Hi. I have run into this issue too. Browser which was used for PageObject initialization is not available in @browser variable ( inside page section class ), but can be accessed with @browser.browser instead.
So @browser inside PageSection is actually an instance of Watir::HTMLElement. This seems like a bug that should be fixed.
$ rspec spec/test_spec.rb
page.ddg_header.browser is: #<Watir::HTMLElement: located: false; {:id=>"header_wrapper"}>
page.ddg_header.browser.browser is: #<Watir::Browser:0x..f958b67bbcb8d8eae url="https://duckduckgo.com/?q=search&ia=web" title="search at DuckDuckGo">
page.ddg_header.browser.browser.browser is: #<Watir::Browser:0x..f958b67bbcb8d8eae url="https://duckduckgo.com/?q=search&ia=web" title="search at DuckDuckGo">
.
Now sections are threaded as elements with some other elements in it but this approach makes unable to use page methods inside sections:
wait_until { login_button? }
will raiseNoMethodError: undefined method 'wait_until' for Watir::HTMLElement
From stackoverflow:
But I think sections should be treated as PageObjects with all related methods
The text was updated successfully, but these errors were encountered: