summaryrefslogtreecommitdiff
path: root/qa/qa/page/merge_request/show.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/merge_request/show.rb')
-rw-r--r--qa/qa/page/merge_request/show.rb47
1 files changed, 38 insertions, 9 deletions
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb
index 0b6a3085a3a..e1790deb3ec 100644
--- a/qa/qa/page/merge_request/show.rb
+++ b/qa/qa/page/merge_request/show.rb
@@ -49,6 +49,7 @@ module QA
view 'app/views/projects/merge_requests/show.html.haml' do
element :notes_tab
+ element :commits_tab
element :diffs_tab
end
@@ -67,8 +68,11 @@ module QA
element :edit_in_ide_button
end
- view 'app/assets/javascripts/diffs/components/inline_diff_table_row.vue' do
+ view 'app/assets/javascripts/diffs/components/diff_row.vue' do
element :diff_comment_button
+ end
+
+ view 'app/assets/javascripts/diffs/components/inline_diff_table_row.vue' do
element :new_diff_line_link
end
@@ -104,6 +108,17 @@ module QA
element :suggestion_button
end
+ view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue' do
+ element :revert_button
+ element :cherry_pick_button
+ end
+
+ view 'app/assets/javascripts/vue_shared/components/markdown/apply_suggestion.vue' do
+ element :apply_suggestion_button
+ element :commit_message_textbox
+ element :commit_with_custom_message_button
+ end
+
def start_review
click_element(:start_review_button)
@@ -170,6 +185,10 @@ module QA
wait_for_requests
end
+ def click_commits_tab
+ click_element(:commits_tab)
+ end
+
def click_diffs_tab
click_element(:diffs_tab)
click_element(:dismiss_popover_button) if has_element?(:dismiss_popover_button, wait: 1)
@@ -219,18 +238,12 @@ module QA
end
def mark_to_squash
- # The squash checkbox is disabled on load
- wait_until do
- has_element?(:squash_checkbox)
- end
-
# The squash checkbox is enabled via JS
wait_until(reload: false) do
- !find_element(:squash_checkbox).disabled?
+ !find_element(:squash_checkbox, visible: false).disabled?
end
- # TODO: Fix workaround for data-qa-selector failure
- click_element(:squash_checkbox)
+ check_element(:squash_checkbox, true)
end
def merge!
@@ -349,6 +362,12 @@ module QA
click_element(:comment_now_button)
end
+ def apply_suggestion_with_message(message)
+ click_element(:apply_suggestion_button)
+ fill_element(:commit_message_textbox, message)
+ click_element(:commit_with_custom_message_button)
+ end
+
def add_suggestion_to_batch
all_elements(:add_suggestion_batch_button, minimum: 1).first.click
end
@@ -356,6 +375,16 @@ module QA
def apply_suggestions_batch
all_elements(:apply_suggestions_batch_button, minimum: 1).first.click
end
+
+ def cherry_pick!
+ click_element(:cherry_pick_button, Page::Component::CommitModal)
+ click_element(:submit_commit_button)
+ end
+
+ def revert_change!
+ click_element(:revert_button, Page::Component::CommitModal)
+ click_element(:submit_commit_button)
+ end
end
end
end