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
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-10-15 02:47:55 +0300
committerStan Hu <stanhu@gmail.com>2016-10-17 06:02:16 +0300
commitd78c667d581dca6b75895f70f0ae6ebdd0f5d815 (patch)
treed7028cab3a10d334dbc53e964811e00c8ddd54d4
parenta453dacec211678a4f7b94e8aa858e8eb4da9214 (diff)
Fix broken Spinach tests caused by changes in !6550
Partial fix to #23378
-rw-r--r--features/steps/project/commits/commits.rb20
-rw-r--r--spec/features/compare_spec.rb2
2 files changed, 15 insertions, 7 deletions
diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb
index b8264f97687..fd7b1debd68 100644
--- a/features/steps/project/commits/commits.rb
+++ b/features/steps/project/commits/commits.rb
@@ -42,15 +42,16 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
step 'I fill compare fields with branches' do
- fill_in 'from', with: 'feature'
- fill_in 'to', with: 'master'
+ select_using_dropdown('from', 'feature')
+ select_using_dropdown('to', 'master')
click_button 'Compare'
end
step 'I fill compare fields with refs' do
- fill_in "from", with: sample_commit.parent_id
- fill_in "to", with: sample_commit.id
+ select_using_dropdown('from', sample_commit.parent_id)
+ select_using_dropdown('to', sample_commit.id)
+
click_button "Compare"
end
@@ -97,8 +98,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
step 'I fill compare fields with branches' do
- fill_in 'from', with: 'master'
- fill_in 'to', with: 'feature'
+ select_using_dropdown('from', 'master')
+ select_using_dropdown('to', 'feature')
click_button 'Compare'
end
@@ -182,4 +183,11 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
expect(page).to have_content "More submodules"
expect(page).not_to have_content "Change some files"
end
+
+ def select_using_dropdown(dropdown_type, selection)
+ dropdown = find(".js-compare-#{dropdown_type}-dropdown")
+ dropdown.find(".compare-dropdown-toggle").click
+ dropdown.fill_in("Filter by branch/tag", with: selection)
+ find_link(selection, visible: true).click
+ end
end
diff --git a/spec/features/compare_spec.rb b/spec/features/compare_spec.rb
index 33dfd0d5b62..c22109d19b6 100644
--- a/spec/features/compare_spec.rb
+++ b/spec/features/compare_spec.rb
@@ -45,6 +45,6 @@ describe "Compare", js: true do
dropdown = find(".js-compare-#{dropdown_type}-dropdown")
dropdown.find(".compare-dropdown-toggle").click
dropdown.fill_in("Filter by branch/tag", with: selection)
- click_link selection
+ find_link(selection, visible: true).click
end
end