I have this two page-object elements:
images(:new_number, src: '/static/images/sec_core/plus.png')
text_fields(:users, class: 'custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left ui-autocomplete-input')
And I am able to use it to click in the last image of a list of images in the HTML if I use the following code:
users_elements[user_index].parent.parent.parent[1].image_elements(:src => '/static/images/sec_core/plus.png').last.parent.when_present.click
Isn't it possible to reuse the page-object element somehow, as a watir "method" in order to avoid repeating code, something that's similar to this:
users_elements[user_index].parent.parent.parent[1].new_number_elements.last.parent.when_present.click