Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
Register now

extend capybara node `click` and `visit` actions to fetch `element`s and wait/validate

a great practice in test automation frameworks that i've had tremendous success in the past, was to extend existing framework methods to wait and validate elements are present before continuing.

psuedo code:

visit(:gitlab, QA::Page::Main::Login) #=> validate all "required" elements on the login page are present before continuing.

set_text(:username, "user")
set_text(:password, "pass")
click_element(:login_button, QA::Page::Dashboard) #=> validate the dashboard elements are present.

click_element(:dashboard_group_link, QA::Page::Group::Show) #=> validate the show page elements are present
click_element(:dropdown_link, QA::Layer::SomeLayer) #=> validate the layer has shown (the layer's parent selector)

in either of these cases, let's get the second parameter here and reflect through all of the elements on the page and validate they are there (unless they are marked Optional [i.e. only shows up when something else happens])

this will ensure that all elements are present on the page before continuing on with the test.

/cc @meks @grzesiek

this issue is being created because of https://gitlab.com/gitlab-org/gitlab-ce/issues/48243. i think something like this would help actions like this, instead of manually increasing waits.

Edited Jun 29, 2018 by Dan Davison
Assignee Loading
Time tracking Loading