Commit 99a4e973 authored by Mark Lapierre's avatar Mark Lapierre

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
parent a5af21cf
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment