Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-04-25 17:44:28 +0300
committerLin Jen-Shin <godfat@godfat.org>2018-04-25 17:58:02 +0300
commit43f44d88dd2decb8b066e0301dd6741a6de0036d (patch)
tree6f44e1745bba4a2f4f0c0e8e7743748171182049 /qa
parent9cc2123e47661db37fbaff96f99999697aa60432 (diff)
Clear local storage after test so it's not interfering
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/project/settings/protected_branches.rb1
-rw-r--r--qa/qa/specs/features/repository/protected_branches_spec.rb7
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