diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 18:09:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 18:09:59 +0300 |
commit | 0c87da93750c6428328a3e3cd2ebd0882f6294e3 (patch) | |
tree | 1b6cb32a86a461e592634249db84f34b44d0c2eb /qa | |
parent | d87800c3cfa21bde64704542d61a587c5ff4306e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/page/base.rb | 13 | ||||
-rw-r--r-- | qa/qa/page/element.rb | 2 | ||||
-rw-r--r-- | qa/qa/page/merge_request/show.rb | 4 |
3 files changed, 13 insertions, 6 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index 7452077de67..6c01fa9f344 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -5,6 +5,14 @@ require 'capybara/dsl' module QA module Page class Base + # Generic matcher for common css selectors like: + # - class name '.someclass' + # - id '#someid' + # - selection by attributes 'input[attribute=name][value=value]' + # + # @return [Regex] + CSS_SELECTOR_PATTERN = /^(\.[a-z-]+|\#[a-z-]+)+|([a-z]+\[.*\])$/i + prepend Support::Page::Logging prepend Mobile::Page::Base if QA::Runtime::Env.mobile_layout? @@ -386,6 +394,7 @@ module QA def element_selector_css(name, *attributes) return name.selector_css if name.is_a? Page::Element + return name if name.is_a?(String) && name.match?(CSS_SELECTOR_PATTERN) Page::Element.new(name, *attributes).selector_css end @@ -506,8 +515,8 @@ module QA return element_when_flag_disabled if has_element?(element_when_flag_disabled, visible: visibility) raise ElementNotFound, - "Could not find the expected element as #{element_when_flag_enabled} or #{element_when_flag_disabled}." \ - "The relevant feature flag is #{feature_flag}" + "Could not find the expected element as #{element_when_flag_enabled} or #{element_when_flag_disabled}." \ + "The relevant feature flag is #{feature_flag}" end end end diff --git a/qa/qa/page/element.rb b/qa/qa/page/element.rb index db2f2153560..f0e67627dca 100644 --- a/qa/qa/page/element.rb +++ b/qa/qa/page/element.rb @@ -4,6 +4,8 @@ require 'active_support/core_ext/array/extract_options' module QA module Page + # Gitlab element css selector builder using data-testid attribute + # class Element attr_reader :name, :attributes diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index 53699d6bb21..e0ec5d50bc5 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -467,10 +467,6 @@ module QA click_element(:submit_commit_button) end - def cancel_auto_merge! - click_element(:cancel_auto_merge_button) - end - def mr_widget_text find_element(:mr_widget_content).text end |