summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorRamya Authappan <rauthappan@gitlab.com>2019-01-25 09:01:51 +0000
committerRamya Authappan <rauthappan@gitlab.com>2019-01-25 09:01:51 +0000
commitaabc48761132d91ba37b1f9a9cb829902af6a38b (patch)
tree9a88e39ee148840f2c3402e48f9eca40f9133989 /qa
parent000a67f41edbda27b7efbb890f464a2b77929e1b (diff)
parent1720cbc8949e83ac4af835013cc58d5f84724b2c (diff)
downloadgitlab-ce-aabc48761132d91ba37b1f9a9cb829902af6a38b.tar.gz
Merge branch 'qa-update-merge-request-page' into 'master'
Update merge request page object and rebase test Closes gitlab-org/quality/staging#3 See merge request gitlab-org/gitlab-ce!24375
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/merge_request/show.rb28
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb8
2 files changed, 20 insertions, 16 deletions
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb
index 4f21ed602d9..3823afb9b9f 100644
--- a/qa/qa/page/merge_request/show.rb
+++ b/qa/qa/page/merge_request/show.rb
@@ -50,17 +50,17 @@ module QA
end
def fast_forward_possible?
- !has_text?('Fast-forward merge is not possible')
+ has_no_text?('Fast-forward merge is not possible')
end
def has_merge_button?
refresh
- has_css?(element_selector_css(:merge_button))
+ has_element?(:merge_button)
end
def has_merge_options?
- has_css?(element_selector_css(:merge_moment_dropdown))
+ has_element?(:merge_moment_dropdown)
end
def merge_immediately
@@ -75,19 +75,21 @@ module QA
def rebase!
# The rebase button is disabled on load
wait do
- has_css?(element_selector_css(:mr_rebase_button))
+ has_element?(:mr_rebase_button)
end
# The rebase button is enabled via JS
wait(reload: false) do
- !first(element_selector_css(:mr_rebase_button)).disabled?
+ !find_element(:mr_rebase_button).disabled?
end
click_element :mr_rebase_button
- wait(reload: false) do
+ success = wait(reload: false) 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)
@@ -106,30 +108,32 @@ module QA
def merge!
# The merge button is disabled on load
wait do
- has_css?(element_selector_css(:merge_button))
+ has_element?(:merge_button)
end
# The merge button is enabled via JS
wait(reload: false) do
- !first(element_selector_css(:merge_button)).disabled?
+ !find_element(:merge_button).disabled?
end
merge_immediately
- wait(reload: false) do
+ success = wait(reload: false) 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
- has_css?(element_selector_css(:squash_checkbox))
+ has_element?(:squash_checkbox)
end
# The squash checkbox is enabled via JS
wait(reload: false) do
- !first(element_selector_css(:squash_checkbox)).disabled?
+ !find_element(:squash_checkbox).disabled?
end
click_element :squash_checkbox
@@ -145,7 +149,7 @@ module QA
def add_comment_to_diff(text)
wait(time: 5) do
- page.has_text?("No newline at end of file")
+ has_text?("No newline at end of file")
end
all_elements(:new_diff_line).first.hover
click_element :diff_comment
diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb
index 43cc737bfb1..3fbcd77dac6 100644
--- a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb
@@ -5,15 +5,15 @@ module QA
describe 'Merge request rebasing' do
it 'user rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
+ Page::Main::Login.perform(&:sign_in_using_credentials)
project = Resource::Project.fabricate! do |project|
project.name = "only-fast-forward"
end
project.visit!
- Page::Project::Menu.act { go_to_settings }
- Page::Project::Settings::MergeRequest.act { enable_ff_only }
+ Page::Project::Menu.perform(&:go_to_settings)
+ Page::Project::Settings::MergeRequest.perform(&:enable_ff_only)
merge_request = Resource::MergeRequest.fabricate! do |merge_request|
merge_request.project = project
@@ -38,7 +38,7 @@ module QA
merge_request.rebase!
expect(merge_request).to have_merge_button
- expect(merge_request.fast_forward_possible?).to be_truthy
+ expect(merge_request).to be_fast_forward_possible
end
end
end