2014-09-22 10:30:25 -04:00
|
|
|
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
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should have network graph' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_selector ".network-graph"
|
2012-09-10 09:35:23 -04:00
|
|
|
end
|
|
|
|
|
2013-03-04 03:50:42 -05:00
|
|
|
When 'I visit project "Shop" network page' do
|
2013-03-07 01:42:30 -05:00
|
|
|
# Stub Graph max_size to speed up test (10 commits vs. 650)
|
|
|
|
Network::Graph.stub(max_count: 10)
|
2012-09-10 09:35:23 -04:00
|
|
|
|
2015-07-28 21:15:23 -04:00
|
|
|
@project = Project.find_by(name: "Shop")
|
|
|
|
visit namespace_project_network_path(@project.namespace, @project, "master")
|
|
|
|
end
|
|
|
|
|
|
|
|
step "I visit project network page on branch 'test'" do
|
|
|
|
visit namespace_project_network_path(@project.namespace, @project, "'test'")
|
2012-09-10 09:35:23 -04:00
|
|
|
end
|
2013-03-04 03:50:42 -05:00
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should select "master" in select box' do
|
2016-06-08 06:38:19 -04:00
|
|
|
expect(page).to have_selector '.dropdown-menu-toggle', text: "master"
|
2013-03-04 03:50:42 -05:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should select "v1.0.0" in select box' do
|
2016-06-08 06:38:19 -04:00
|
|
|
expect(page).to have_selector '.dropdown-menu-toggle', text: "v1.0.0"
|
2013-04-14 05:15:35 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should have "master" on graph' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.network-graph' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content 'master'
|
2013-03-04 03:50:42 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-07-28 21:15:23 -04:00
|
|
|
step "page should have 'test' on graph" do
|
|
|
|
page.within '.network-graph' do
|
|
|
|
expect(page).to have_content "'test'"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-31 15:34:37 -04:00
|
|
|
When 'I switch ref to "feature"' do
|
2016-06-08 06:38:19 -04:00
|
|
|
first('.js-project-refs-dropdown').click
|
|
|
|
|
|
|
|
page.within '.project-refs-form' do
|
|
|
|
click_link 'feature'
|
|
|
|
end
|
2013-03-04 03:50:42 -05:00
|
|
|
end
|
|
|
|
|
2014-07-31 15:34:37 -04:00
|
|
|
When 'I switch ref to "v1.0.0"' do
|
2016-06-08 06:38:19 -04:00
|
|
|
first('.js-project-refs-dropdown').click
|
|
|
|
|
|
|
|
page.within '.project-refs-form' do
|
|
|
|
click_link 'v1.0.0'
|
|
|
|
end
|
2013-04-25 09:05:22 -04:00
|
|
|
end
|
|
|
|
|
2013-04-14 05:15:35 -04:00
|
|
|
When 'click "Show only selected branch" checkbox' do
|
|
|
|
find('#filter_ref').click
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should have content not containing "v1.0.0"' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.network-graph' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content 'Change some files'
|
2013-04-14 05:15:35 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-03-14 01:09:42 -04:00
|
|
|
step 'page should have "v1.0.0" in title' do
|
|
|
|
expect(page).to have_css 'title', text: 'Network · v1.0.0', visible: false
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'page should only have content from "v1.0.0"' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.network-graph' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).not_to have_content 'Change some files'
|
2013-04-14 05:15:35 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should select "feature" in select box' do
|
2016-06-08 06:38:19 -04:00
|
|
|
expect(page).to have_selector '.dropdown-menu-toggle', text: "feature"
|
2013-03-04 03:50:42 -05:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should select "v1.0.0" in select box' do
|
2016-06-08 06:38:19 -04:00
|
|
|
expect(page).to have_selector '.dropdown-menu-toggle', text: "v1.0.0"
|
2013-04-25 09:05:22 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should have "feature" on graph' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.network-graph' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content 'feature'
|
2013-03-04 03:50:42 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-31 15:34:37 -04:00
|
|
|
When 'I looking for a commit by SHA of "v1.0.0"' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within ".network-form" do
|
2014-07-31 15:34:37 -04:00
|
|
|
fill_in 'extended_sha1', with: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
|
2013-03-04 03:50:42 -05:00
|
|
|
find('button').click
|
|
|
|
end
|
2013-03-06 01:17:01 -05:00
|
|
|
sleep 2
|
2013-03-04 03:50:42 -05:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'page should have "v1.0.0" on graph' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.network-graph' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content 'v1.0.0'
|
2013-03-04 03:50:42 -05:00
|
|
|
end
|
|
|
|
end
|
2013-08-21 03:55:18 -04:00
|
|
|
|
|
|
|
When 'I look for a commit by ";"' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within ".network-form" do
|
2013-08-21 06:20:29 -04:00
|
|
|
fill_in 'extended_sha1', with: ';'
|
2013-08-21 03:55:18 -04:00
|
|
|
find('button').click
|
|
|
|
end
|
|
|
|
end
|
2016-10-28 11:47:15 -04:00
|
|
|
|
|
|
|
step 'I should see non-existent git revision error message' do
|
|
|
|
expect(page).to have_selector '.flash-alert', text: "Git revision ';' does not exist."
|
|
|
|
end
|
2012-09-10 09:35:23 -04:00
|
|
|
end
|