summaryrefslogtreecommitdiff
path: root/qa/qa/page/project
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2019-04-29 17:57:34 +1000
committerMark Lapierre <mlapierre@gitlab.com>2019-04-29 17:57:34 +1000
commitf15f9970ab73c1474a45734bd3b792a838b2c4d2 (patch)
tree095b8b0e3898d63c96f301a88dc7d6543c3618f2 /qa/qa/page/project
parentee4ccd31556f8be905e968af448bbb4ecf62dcb6 (diff)
downloadgitlab-ce-f15f9970ab73c1474a45734bd3b792a838b2c4d2.tar.gz
Wait for branches to not be present
When testing if branches are deleted, wait for the branch element to not be present. Do the same for both checks (second and third branches).
Diffstat (limited to 'qa/qa/page/project')
-rw-r--r--qa/qa/page/project/branches/show.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/qa/qa/page/project/branches/show.rb b/qa/qa/page/project/branches/show.rb
index 922a6ddb086..ba00ecbd535 100644
--- a/qa/qa/page/project/branches/show.rb
+++ b/qa/qa/page/project/branches/show.rb
@@ -27,11 +27,9 @@ module QA
finished_loading?
end
- def has_branch_title?(branch_title)
+ def has_no_branch?(branch_name)
within_element(:all_branches) do
- within(".item-title") do
- has_text?(branch_title)
- end
+ has_no_css?(".js-branch-#{branch_name}")
end
end
@@ -49,13 +47,12 @@ module QA
end
end
- def wait_for_texts_not_to_be_visible(texts)
- text_not_visible = wait do
- texts.all? do |text|
- has_no_text?(text)
- end
+ def wait_for_branch_not_present(branch_name)
+ branch_not_present = wait(reload: false) do
+ has_no_branch?(branch_name)
end
- raise "Expected text(s) #{texts} not to be visible" unless text_not_visible
+
+ raise "Expected branch `#{branch_name}` not to be present" unless branch_not_present
end
end
end