The idea is that the correct place to know about the failure is the step in which it happens, not on the following step that fails.
For instance, when submitting a form that you expect to take you to another page. When an error shows up after the submission, usually the error that is obtained comes from not finding an element on the following page. So the error message returned is not providing useful information about the actual problem (an error in the form submission).
One idea would be to somehow implement an automatic #on_page? check to ensure that a method takes you to another page.
I'm not sure the best implementation. I think we probably want a #submit_form method that does a #fill_form and then by default clicks a submit button? Or an element with a key word "submit" if it is defined? Perhaps the submit method can take a keyword parameter for "navigates" that defaults to false, but can be set to true and will raise an error if #on_page? does not return false.
The idea is that the correct place to know about the failure is the step in which it happens, not on the following step that fails.
For instance, when submitting a form that you expect to take you to another page. When an error shows up after the submission, usually the error that is obtained comes from not finding an element on the following page. So the error message returned is not providing useful information about the actual problem (an error in the form submission).
One idea would be to somehow implement an automatic
#on_page?check to ensure that a method takes you to another page.I'm not sure the best implementation. I think we probably want a
#submit_formmethod that does a#fill_formand then by default clicks asubmitbutton? Or an element with a key word "submit" if it is defined? Perhaps the submit method can take a keyword parameter for "navigates" that defaults to false, but can be set to true and will raise an error if#on_page?does not return false.