Thanks Justin..
I have two more question though.

1. How does the the method in monkey_path.b takes precedence over the 
method in actual page-object gem?
2. There are may intances in the application where a div element receives 
the click rather than a button.

eg
  div(:expand_perks_section_icon, :css => '.icon-plus-wrapper')



This element is  a div and receives the click as shown below.
  def expand_perks_section
    expand_perks_section_icon_element.when_present.click
  end



Writing a separate method each time for such things is really a pain.
Is there a better solution for such cases

On Friday, 1 February 2019 00:11:33 UTC+11, NaviHan wrote:
>
> I have an element defined as
>
> div(:reward_history, :class => 'reward-history-header')
>
>
> The page-object gem generated four methods for this element which are
>
>
> 'reward_history', 'reward_history_element', and 'reward_history?'
>
>
>
> The fourth method 'reward_history?' check if the element exists in the 
> DOM?
>
>
> But what if the element exists in the DOM but is hidden, which is 
> basically checking if the element is present?
>
>
> Is there an autogenerated method for this?
>
> I tried 'reward_history(:&present?)' but didn't work
>
> As of now I have to write a method separately which does this
>
>   def is_reward_history_present?
>     return reward_history_element.present?
>   end
>
>
>
>

-- 
-- 
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.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
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 watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to