debian-mirror-gitlab/features/steps/project/network_graph.rb

113 lines
3 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
2014-09-02 18:07:02 +05:30
include SharedAuthentication
include SharedPaths
include SharedProject
2015-04-26 12:48:37 +05:30
step 'page should have network graph' do
2015-09-11 14:41:01 +05:30
expect(page).to have_selector ".network-graph"
2014-09-02 18:07:02 +05:30
end
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)
2015-09-11 14:41:01 +05:30
@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'")
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'page should select "master" in select box' do
2016-06-22 15:30:34 +05:30
expect(page).to have_selector '.dropdown-menu-toggle', text: "master"
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'page should select "v1.0.0" in select box' do
2016-06-22 15:30:34 +05:30
expect(page).to have_selector '.dropdown-menu-toggle', text: "v1.0.0"
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'page should have "master" on graph' do
2015-09-11 14:41:01 +05:30
page.within '.network-graph' do
expect(page).to have_content 'master'
end
end
step "page should have 'test' on graph" do
page.within '.network-graph' do
expect(page).to have_content "'test'"
2014-09-02 18:07:02 +05:30
end
end
When 'I switch ref to "feature"' do
2016-06-22 15:30:34 +05:30
first('.js-project-refs-dropdown').click
page.within '.project-refs-form' do
click_link 'feature'
end
2014-09-02 18:07:02 +05:30
end
When 'I switch ref to "v1.0.0"' do
2016-06-22 15:30:34 +05:30
first('.js-project-refs-dropdown').click
page.within '.project-refs-form' do
click_link 'v1.0.0'
end
2014-09-02 18:07:02 +05:30
end
When 'click "Show only selected branch" checkbox' do
find('#filter_ref').click
end
2015-04-26 12:48:37 +05:30
step 'page should have content not containing "v1.0.0"' do
2015-09-11 14:41:01 +05:30
page.within '.network-graph' do
expect(page).to have_content 'Change some files'
2014-09-02 18:07:02 +05:30
end
end
2016-06-02 11:05:42 +05:30
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-09-11 14:41:01 +05:30
page.within '.network-graph' do
expect(page).not_to have_content 'Change some files'
2014-09-02 18:07:02 +05:30
end
end
2015-04-26 12:48:37 +05:30
step 'page should select "feature" in select box' do
2016-06-22 15:30:34 +05:30
expect(page).to have_selector '.dropdown-menu-toggle', text: "feature"
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'page should select "v1.0.0" in select box' do
2016-06-22 15:30:34 +05:30
expect(page).to have_selector '.dropdown-menu-toggle', text: "v1.0.0"
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'page should have "feature" on graph' do
2015-09-11 14:41:01 +05:30
page.within '.network-graph' do
expect(page).to have_content 'feature'
2014-09-02 18:07:02 +05:30
end
end
When 'I looking for a commit by SHA of "v1.0.0"' do
2015-09-11 14:41:01 +05:30
page.within ".network-form" do
2014-09-02 18:07:02 +05:30
fill_in 'extended_sha1', with: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
find('button').click
end
sleep 2
end
2015-04-26 12:48:37 +05:30
step 'page should have "v1.0.0" on graph' do
2015-09-11 14:41:01 +05:30
page.within '.network-graph' do
expect(page).to have_content 'v1.0.0'
2014-09-02 18:07:02 +05:30
end
end
When 'I look for a commit by ";"' do
2015-09-11 14:41:01 +05:30
page.within ".network-form" do
2014-09-02 18:07:02 +05:30
fill_in 'extended_sha1', with: ';'
find('button').click
end
end
end