Skip to content

EE Introduce data-qa-selector to supplant .qa-class

Dan Davison requested to merge ee-qa-data-qa-selector-replacement into master

CE Port: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/28906

What does this MR do?

Iteration on moving away from using CSS classes for GitLab QA framework element identification.

The first iteration will involve allowing the fallback use of old CSS classes.

For instance:

devise.html.haml

%body.qa-login-page
%body{data: { qa_selector: 'login_page' } }

login.rb

view 'devise.html.haml' do
  # will use a CSS OR match:
  #   [data-qa-selector='login_page'],.qa-login-page
  element :login_page

  # it will prioritize [data-qa-selector] first.
end

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

No performance degradation or improvement will be seen from using data-qa-* versus CSS classes.

Quality Requirements

  • Works for both [data-qa-selector='something'] and .qa-something
  • Spec created
  • Cop updated
  • qa:selectors job updated?
  • Login page selectors changed from qa- to data-qa-selector

Merge request reports