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

104 lines
2.7 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
2015-09-11 14:41:01 +05:30
expect(page).to have_selector '.select2-chosen', 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
2015-09-11 14:41:01 +05:30
expect(page).to have_selector '.select2-chosen', 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
2015-04-26 12:48:37 +05:30
select 'feature', from: 'ref'
2014-09-02 18:07:02 +05:30
sleep 2
end
When 'I switch ref to "v1.0.0"' do
2015-04-26 12:48:37 +05:30
select 'v1.0.0', from: 'ref'
2014-09-02 18:07:02 +05:30
sleep 2
end
When 'click "Show only selected branch" checkbox' do
find('#filter_ref').click
sleep 2
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
2015-04-26 12:48:37 +05:30
step 'page should not have content not containing "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
2015-09-11 14:41:01 +05:30
expect(page).to have_selector '.select2-chosen', 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
2015-09-11 14:41:01 +05:30
expect(page).to have_selector '.select2-chosen', 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