Skip to content

WIP: Add extensible data-qa-* selection mechanisms

Dan Davison requested to merge qa-extensible-data-qa-selectors into master

What does this MR do?

Closes https://gitlab.com/gitlab-org/quality/team-tasks/issues/197.

Adds the ability to extend the data-qa selection mechanism to match on additional data attributes.

This is useful in cases such as selecting on a specific item in a collection of items.

Given an iteration over items:

- @projects.each_with_index do |project, idx|
  %ul
    %li
      = link_to project, data: { qa_selector: 'project_link', qa_index: idx }
view '...' do
  element :project_link, index: 1 #=> the first project listed
end

...

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Edited by Dan Davison

Merge request reports