diff options
author | Michael Kozono <mkozono@gmail.com> | 2018-07-13 10:07:04 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2018-07-13 10:48:42 -0700 |
commit | 829b20010d0ded17a84355c44047114327248818 (patch) | |
tree | 3bdd4b5ac1ad03c35bd21586d505cdbdca5dc245 /qa | |
parent | 6717643c30541a95eeb99202861c43eca7ffd9b4 (diff) | |
download | gitlab-ce-829b20010d0ded17a84355c44047114327248818.tar.gz |
Remove flaky and redundant expectationsmk/fix-flaky-protected-branch-expectations
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/factory/resource/branch.rb | 21 | ||||
-rw-r--r-- | qa/qa/page/project/settings/protected_branches.rb | 17 | ||||
-rw-r--r-- | qa/qa/specs/features/repository/protected_branches_spec.rb | 5 |
3 files changed, 1 insertions, 42 deletions
diff --git a/qa/qa/factory/resource/branch.rb b/qa/qa/factory/resource/branch.rb index 7fb0633ec90..bc252bf3148 100644 --- a/qa/qa/factory/resource/branch.rb +++ b/qa/qa/factory/resource/branch.rb @@ -9,18 +9,6 @@ module QA project.name = 'protected-branch-project' end - product :name do - Page::Project::Settings::Repository.act do - expand_protected_branches(&:last_branch_name) - end - end - - product :push_allowance do - Page::Project::Settings::Repository.act do - expand_protected_branches(&:last_push_allowance) - end - end - def initialize @branch_name = 'test/branch' @allow_to_push = true @@ -80,15 +68,6 @@ module QA end page.protect_branch - - # Avoid Selenium::WebDriver::Error::StaleElementReferenceError - # without sleeping. I.e. this completes fast on fast machines. - page.refresh - - # It is possible for the protected branch row to "disappear" at first - page.wait do - page.has_content?(branch_name) - end end end end diff --git a/qa/qa/page/project/settings/protected_branches.rb b/qa/qa/page/project/settings/protected_branches.rb index e572ae12132..76591a4e3fe 100644 --- a/qa/qa/page/project/settings/protected_branches.rb +++ b/qa/qa/page/project/settings/protected_branches.rb @@ -16,7 +16,6 @@ module QA end view 'app/views/projects/protected_branches/_update_protected_branch.html.haml' do - element :allowed_to_push element :allowed_to_merge end @@ -24,10 +23,6 @@ module QA element :protected_branches_list end - view 'app/views/projects/protected_branches/shared/_protected_branch.html.haml' do - element :protected_branch_name - end - def select_branch(branch_name) click_element :protected_branch_select @@ -62,18 +57,6 @@ module QA click_on 'Protect' end - def last_branch_name - within_element(:protected_branches_list) do - all('.qa-protected-branch-name').last - end - end - - def last_push_allowance - within_element(:protected_branches_list) do - all('.qa-allowed-to-push').last - end - end - private def click_allow(action, text) diff --git a/qa/qa/specs/features/repository/protected_branches_spec.rb b/qa/qa/specs/features/repository/protected_branches_spec.rb index 4e593a69aae..c2de94516d9 100644 --- a/qa/qa/specs/features/repository/protected_branches_spec.rb +++ b/qa/qa/specs/features/repository/protected_branches_spec.rb @@ -21,11 +21,8 @@ module QA end context 'when developers and maintainers are allowed to push to a protected branch' do - let!(:protected_branch) { create_protected_branch(allow_to_push: true) } - it 'user with push rights successfully pushes to the protected branch' do - expect(protected_branch.name).to have_content(branch_name) - expect(protected_branch.push_allowance).to have_content('Developers + Maintainers') + create_protected_branch(allow_to_push: true) push = push_new_file(branch_name) |