Commit d78c667d authored by Stan Hu's avatar Stan Hu

Fix broken Spinach tests caused by changes in !6550

Partial fix to #23378
parent a453dace
......@@ -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
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment