diff options
-rw-r--r-- | qa/qa/page/project/settings/protected_branches.rb | 1 | ||||
-rw-r--r-- | qa/qa/specs/features/repository/protected_branches_spec.rb | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/qa/qa/page/project/settings/protected_branches.rb b/qa/qa/page/project/settings/protected_branches.rb index 23c3217d3f7..63bc3aaa2bc 100644 --- a/qa/qa/page/project/settings/protected_branches.rb +++ b/qa/qa/page/project/settings/protected_branches.rb @@ -73,7 +73,6 @@ module QA def click_allow(action, text) click_element :"allowed_to_#{action}_select" - within_element(:"allowed_to_#{action}_dropdown") do click_on text diff --git a/qa/qa/specs/features/repository/protected_branches_spec.rb b/qa/qa/specs/features/repository/protected_branches_spec.rb index 88fa4994e32..bf863d446a2 100644 --- a/qa/qa/specs/features/repository/protected_branches_spec.rb +++ b/qa/qa/specs/features/repository/protected_branches_spec.rb @@ -19,6 +19,13 @@ module QA Page::Main::Login.act { sign_in_using_credentials } end + after do + # We need to clear localStorage because we're using it for the dropdown, + # and capybara doesn't do this for us. + # https://github.com/teamcapybara/capybara/issues/1702 + Capybara.execute_script 'localStorage.clear()' + end + scenario 'user is able to protect a branch' do protected_branch = Factory::Resource::Branch.fabricate! do |resource| resource.branch_name = branch_name |