summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-16 09:08:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-16 09:08:10 +0000
commit13867d66e92c2fd8962a126db4fbdc32891343c9 (patch)
tree580a1baf1cdd3283ede126ee510ecf1d3562a471 /qa
parent83758a4e5fcfec056b36a4b56fb22c8a915753cc (diff)
downloadgitlab-ce-13867d66e92c2fd8962a126db4fbdc32891343c9.tar.gz
Add latest changes from gitlab-org/gitlab@masterogolowinski-master-patch-27476
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/base.rb11
-rw-r--r--qa/qa/page/merge_request/show.rb119
-rw-r--r--qa/qa/resource/project.rb2
-rw-r--r--qa/qa/support/page/logging.rb4
4 files changed, 53 insertions, 83 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb
index b01b4951738..dcba4fc8544 100644
--- a/qa/qa/page/base.rb
+++ b/qa/qa/page/base.rb
@@ -81,8 +81,8 @@ module QA
find_element(name, class: 'active')
end
- def all_elements(name)
- all(element_selector_css(name))
+ def all_elements(name, **kwargs)
+ all(element_selector_css(name), **kwargs)
end
def check_element(name)
@@ -206,12 +206,7 @@ module QA
end
def within_element_by_index(name, index)
- # Finding all elements can be flaky if the elements don't all load
- # immediately. So we wait for any to appear before trying to find a
- # specific one.
- has_element?(name)
-
- page.within all_elements(name)[index] do
+ page.within all_elements(name, minimum: index + 1)[index] do
yield
end
end
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb
index 198699c2fee..c3645a6a755 100644
--- a/qa/qa/page/merge_request/show.rb
+++ b/qa/qa/page/merge_request/show.rb
@@ -60,18 +60,35 @@ module QA
element :edit_button
end
+ def add_comment_to_diff(text)
+ wait(interval: 5) do
+ has_text?("No newline at end of file")
+ end
+ all_elements(:new_diff_line).first.hover
+ click_element :diff_comment
+ fill_element :reply_input, text
+ end
+
def click_discussions_tab
click_element :notes_tab
+
+ finished_loading?
end
def click_diffs_tab
click_element :diffs_tab
+
+ finished_loading?
end
def click_pipeline_link
click_element :pipeline_link
end
+ def edit!
+ click_element :edit_button
+ end
+
def fast_forward_possible?
has_no_text?('Fast-forward merge is not possible')
end
@@ -82,55 +99,6 @@ module QA
has_element?(:merge_button)
end
- def has_merge_options?
- has_element?(:merge_moment_dropdown)
- end
-
- def merged?
- has_element? :merged_status_content, text: 'The changes were merged into'
- end
-
- def merge_immediately
- wait(reload: false) do
- finished_loading?
- end
-
- if has_merge_options?
- retry_until do
- click_element :merge_moment_dropdown
- has_element? :merge_immediately_option
- end
-
- click_element :merge_immediately_option
- else
- click_element :merge_button
- end
-
- wait(reload: false) do
- merged?
- end
- end
-
- def rebase!
- # The rebase button is disabled on load
- wait do
- has_element?(:mr_rebase_button)
- end
-
- # The rebase button is enabled via JS
- wait(reload: false) do
- !find_element(:mr_rebase_button).disabled?
- end
-
- click_element :mr_rebase_button
-
- success = wait do
- has_text?('Fast-forward merge without a merge commit')
- end
-
- raise "Rebase did not appear to be successful" unless success
- end
-
def has_assignee?(username)
page.within(element_selector_css(:assignee_block)) do
has_text?(username)
@@ -156,20 +124,6 @@ module QA
has_element?(:description, text: description)
end
- def try_to_merge!
- merge_immediately if ready_to_merge?
- end
-
- def merge!
- try_to_merge!
-
- success = wait do
- has_text?('The changes were merged into')
- end
-
- raise "Merge did not appear to be successful" unless success
- end
-
def mark_to_squash
# The squash checkbox is disabled on load
wait do
@@ -184,17 +138,14 @@ module QA
click_element :squash_checkbox
end
- def add_comment_to_diff(text)
- wait(interval: 5) do
- has_text?("No newline at end of file")
- end
- all_elements(:new_diff_line).first.hover
- click_element :diff_comment
- fill_element :reply_input, text
+ def merge!
+ click_element :merge_button if ready_to_merge?
+
+ raise "Merge did not appear to be successful" unless merged?
end
- def edit!
- click_element :edit_button
+ def merged?
+ has_element?(:merged_status_content, text: 'The changes were merged into', wait: 30)
end
def ready_to_merge?
@@ -209,6 +160,30 @@ module QA
end
end
+ def rebase!
+ # The rebase button is disabled on load
+ wait do
+ has_element?(:mr_rebase_button)
+ end
+
+ # The rebase button is enabled via JS
+ wait(reload: false) do
+ !find_element(:mr_rebase_button).disabled?
+ end
+
+ click_element :mr_rebase_button
+
+ success = wait do
+ has_text?('Fast-forward merge without a merge commit')
+ end
+
+ raise "Rebase did not appear to be successful" unless success
+ end
+
+ def try_to_merge!
+ click_element :merge_button if ready_to_merge?
+ end
+
def view_email_patches
click_element :dropdown_toggle
visit_link_in_element(:download_email_patches)
diff --git a/qa/qa/resource/project.rb b/qa/qa/resource/project.rb
index 0928936284a..f2ca0e0b8fd 100644
--- a/qa/qa/resource/project.rb
+++ b/qa/qa/resource/project.rb
@@ -48,7 +48,7 @@ module QA
@standalone = false
@description = 'My awesome project'
@initialize_with_readme = false
- @auto_devops_enabled = true
+ @auto_devops_enabled = false
@visibility = 'public'
end
diff --git a/qa/qa/support/page/logging.rb b/qa/qa/support/page/logging.rb
index f1cb876222e..5d73d9635f8 100644
--- a/qa/qa/support/page/logging.rb
+++ b/qa/qa/support/page/logging.rb
@@ -49,8 +49,8 @@ module QA
element
end
- def all_elements(name)
- log("finding all :#{name}")
+ def all_elements(name, **kwargs)
+ log("finding all :#{name} with args #{kwargs}")
elements = super