Greetings,
Is there a way to access page object element in step definitions without created a method for it?
Something like this:
on_page(Homepage).some_button_element.visible?
Right now I have a list of elements that I should check if they are visible on the page or not.
In order to check if all these elements are present and visible on the page there are several ways to do it (as I see for now):
1. Create method per element or one method per all elements and check if they are visible or not inside the method.
2. Create step definitions passing the name of elements inside these steps and call appropriate method that checks if passed in element is visible or not.
But maybe there is a way to make page-object elements as attr_accessors? I tried "attr_accessor button(:some_button, :id => 'button')" but it did not work.
What is the right way of implementation?
Thanks in advance,
George