summaryrefslogtreecommitdiff
path: root/features/steps
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2016-10-16 03:30:31 +0100
committerStan Hu <stanhu@gmail.com>2016-10-16 20:02:16 -0700
commit93e464f454ec997743048e34db5c848b4146d452 (patch)
tree83acadb14af06e65a975e20fce3c3cc5a16b9ef0 /features/steps
parentd78c667d581dca6b75895f70f0ae6ebdd0f5d815 (diff)
downloadgitlab-ce-93e464f454ec997743048e34db5c848b4146d452.tar.gz
Added logic to handle a revision input that does not exist in the menu
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/project/commits/commits.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb
index fd7b1debd68..b08912de25f 100644
--- a/features/steps/project/commits/commits.rb
+++ b/features/steps/project/commits/commits.rb
@@ -49,8 +49,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
step 'I fill compare fields with refs' do
- select_using_dropdown('from', sample_commit.parent_id)
- select_using_dropdown('to', sample_commit.id)
+ select_using_dropdown('from', sample_commit.parent_id, true)
+ select_using_dropdown('to', sample_commit.id, true)
click_button "Compare"
end
@@ -184,10 +184,14 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
expect(page).not_to have_content "Change some files"
end
- def select_using_dropdown(dropdown_type, selection)
+ def select_using_dropdown(dropdown_type, selection, is_commit = false)
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
+ dropdown.fill_in("Filter by Git revision", with: selection)
+ if is_commit
+ dropdown.find('input[type="search"]').send_keys(:return)
+ else
+ find_link(selection, visible: true).click
+ end
end
end