summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2019-05-01 14:17:00 +1000
committerMark Lapierre <mlapierre@gitlab.com>2019-05-01 14:17:00 +1000
commit99a4e97389eb7e9e5a8122a336d7541b46097339 (patch)
treec2d4a27aa78ec224098a1642e0d2b825c16f5fbb /qa
parenta5af21cf13869eddf6492c4db727419bf87bb415 (diff)
downloadgitlab-ce-99a4e97389eb7e9e5a8122a336d7541b46097339.tar.gz
Check test result via an assertion
As long as `has_no_branch?` is only called in an assertion it shouldn't matter if it could return false but still allow the test to continue. So we don't need the new wait method
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/project/branches/show.rb10
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb4
2 files changed, 3 insertions, 11 deletions
diff --git a/qa/qa/page/project/branches/show.rb b/qa/qa/page/project/branches/show.rb
index ba00ecbd535..368e7ac7448 100644
--- a/qa/qa/page/project/branches/show.rb
+++ b/qa/qa/page/project/branches/show.rb
@@ -29,7 +29,7 @@ module QA
def has_no_branch?(branch_name)
within_element(:all_branches) do
- has_no_css?(".js-branch-#{branch_name}")
+ has_no_css?(".js-branch-#{branch_name}", wait: Support::Waiter::DEFAULT_MAX_WAIT_TIME)
end
end
@@ -46,14 +46,6 @@ module QA
click_element(:delete_merged_branches)
end
end
-
- def wait_for_branch_not_present(branch_name)
- branch_not_present = wait(reload: false) do
- has_no_branch?(branch_name)
- end
-
- raise "Expected branch `#{branch_name}` not to be present" unless branch_not_present
- end
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb
index ac6458385d9..20793c82d20 100644
--- a/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb
@@ -72,7 +72,7 @@ module QA
Page::Project::Branches::Show.perform do |branches_view|
branches_view.delete_branch(third_branch)
- branches_view.wait_for_branch_not_present(third_branch)
+ expect(branches_view).to have_no_branch(third_branch)
end
Page::Project::Branches::Show.perform(&:delete_merged_branches)
@@ -83,7 +83,7 @@ module QA
page.refresh
Page::Project::Branches::Show.perform do |branches_view|
- branches_view.wait_for_branch_not_present(second_branch)
+ expect(branches_view).to have_no_branch(second_branch)
end
end
end