From 43f44d88dd2decb8b066e0301dd6741a6de0036d Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Wed, 25 Apr 2018 22:44:28 +0800 Subject: Clear local storage after test so it's not interfering --- qa/qa/page/project/settings/protected_branches.rb | 1 - qa/qa/specs/features/repository/protected_branches_spec.rb | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'qa') 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 -- cgit v1.2.1