The PageObject::Elements::Div#wait_until just calls the underlying 
Watir::Div#wait_until method, but with different default values (ie the 
timeout).

For the returned object:
* Watir::Div#wait_until is set to return itself - ie the Watir::Div. 
* PageObject::Elements::Div#wait_until simply returns whatever 
Watir::Div#wait_until returned - ie the Watir::Div.

Arguably, Page-Object should also start returning itself, so it can allow 
#wait_until methods to be chained.

Justin


On Tuesday, April 16, 2019 at 9:08:08 PM UTC-4, NaviHan wrote:
>
> In fact I have printed three classes
>
> puts applied_voucher_list_element.class
> puts applied_voucher_list_element.element.class
> puts applied_voucher_list_element.wait_until(&:present?).class
>
> and got
>
>
> PageObject::Elements::Div
> Watir::Div
> Watir::Div
>
>
> How  is applied_voucher_list_element.wait_until(&:present?).class returning 
> Watir::Div? This should have been calling the wait_until methods of 
> PageObject calss and returned PageObject::Div?
>
> On Monday, 15 April 2019 09:29:57 UTC+10, NaviHan wrote:
>>
>> The automation code in our project uses PageObject and yesterday's 
>> nightly build shows a failure.
>>
>>  [31m      timed out after 10 seconds, waiting for true condition on 
>> #<Watir::Div: located: false; {:class=>"slide-dialog-container-cart-page", 
>> :tag_name=>"div"}> (Watir::Wait::TimeoutError) [0m
>>
>>
>> On checking hooks I found a statement
>>
>> PageObject.default_element_wait=(10)
>>
>>
>> As per my undersatnding Watir has its own inbuilt page and element level 
>> waits which is a default of 30 seconds?
>> And the above statement over rides that to 10 seconds?
>>
>> Please correct me if Im wrong.
>>
>> Cheers
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to