gitlab-org--gitlab-foss/features/steps/project/network_graph.rb

94 lines
2.4 KiB
Ruby
Raw Normal View History

class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
2012-09-10 11:35:03 -04:00
include SharedAuthentication
2014-02-07 11:59:55 -05:00
include SharedPaths
2012-09-10 11:35:03 -04:00
include SharedProject
step 'page should have network graph' do
expect(page).to have_selector ".network-graph"
end
2013-03-04 03:50:42 -05:00
When 'I visit project "Shop" network page' do
# Stub Graph max_size to speed up test (10 commits vs. 650)
Network::Graph.stub(max_count: 10)
2014-01-19 13:55:59 -05:00
project = Project.find_by(name: "Shop")
visit namespace_project_network_path(project.namespace, project, "master")
end
2013-03-04 03:50:42 -05:00
step 'page should select "master" in select box' do
expect(page).to have_selector '.select2-chosen', text: "master"
2013-03-04 03:50:42 -05:00
end
step 'page should select "v1.0.0" in select box' do
expect(page).to have_selector '.select2-chosen', text: "v1.0.0"
2013-04-14 05:15:35 -04:00
end
step 'page should have "master" on graph' do
2013-07-15 09:18:47 -04:00
within '.network-graph' do
expect(page).to have_content 'master'
2013-03-04 03:50:42 -05:00
end
end
When 'I switch ref to "feature"' do
2014-09-24 02:28:41 -04:00
select 'feature', from: 'ref'
sleep 2
2013-03-04 03:50:42 -05:00
end
When 'I switch ref to "v1.0.0"' do
2014-09-24 02:28:41 -04:00
select 'v1.0.0', from: 'ref'
sleep 2
end
2013-04-14 05:15:35 -04:00
When 'click "Show only selected branch" checkbox' do
find('#filter_ref').click
sleep 2
end
step 'page should have content not containing "v1.0.0"' do
2013-07-15 09:18:47 -04:00
within '.network-graph' do
expect(page).to have_content 'Change some files'
2013-04-14 05:15:35 -04:00
end
end
step 'page should not have content not containing "v1.0.0"' do
2013-07-15 09:18:47 -04:00
within '.network-graph' do
expect(page).not_to have_content 'Change some files'
2013-04-14 05:15:35 -04:00
end
end
step 'page should select "feature" in select box' do
expect(page).to have_selector '.select2-chosen', text: "feature"
2013-03-04 03:50:42 -05:00
end
step 'page should select "v1.0.0" in select box' do
expect(page).to have_selector '.select2-chosen', text: "v1.0.0"
end
step 'page should have "feature" on graph' do
2013-07-15 09:18:47 -04:00
within '.network-graph' do
expect(page).to have_content 'feature'
2013-03-04 03:50:42 -05:00
end
end
When 'I looking for a commit by SHA of "v1.0.0"' do
within ".network-form" do
fill_in 'extended_sha1', with: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
2013-03-04 03:50:42 -05:00
find('button').click
end
sleep 2
2013-03-04 03:50:42 -05:00
end
step 'page should have "v1.0.0" on graph' do
2013-07-15 09:18:47 -04:00
within '.network-graph' do
expect(page).to have_content 'v1.0.0'
2013-03-04 03:50:42 -05:00
end
end
When 'I look for a commit by ";"' do
within ".network-form" do
fill_in 'extended_sha1', with: ';'
find('button').click
end
end
end