Search code examples
rubywatir-webdriverpage-object-gem

Access to page methods within section


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

Is there anyway to access page methods inside section class?


Solution

  • It seems like a bug and should be raised as an issue for the project (https://github.com/cheezy/page-object/issues).

    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? }