Commit 1738055dabb902b45d07839bec053bfc59fd05ee

Authored by Sato Hiroyuki
1 parent 6505cd5e

Add test for "Show only selected tag"

features/project/network.feature
@@ -25,3 +25,12 @@ Feature: Project Network Graph @@ -25,3 +25,12 @@ Feature: Project Network Graph
25 Then page should have network graph 25 Then page should have network graph
26 And page should select "master" in select box 26 And page should select "master" in select box
27 And page should have "v2.1.0" on graph 27 And page should have "v2.1.0" on graph
  28 +
  29 + @javascript
  30 + Scenario: I should filter selected tag
  31 + When I switch ref to "v2.1.0"
  32 + Then page should have content not cotaining "v2.1.0"
  33 + When click "Show only selected branch" checkbox
  34 + Then page should not have content not cotaining "v2.1.0"
  35 + When click "Show only selected branch" checkbox
  36 + Then page should have content not cotaining "v2.1.0"
features/steps/project/project_network_graph.rb
@@ -19,6 +19,10 @@ class ProjectNetworkGraph < Spinach::FeatureSteps @@ -19,6 +19,10 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
19 page.should have_selector '#ref_chzn span', text: "master" 19 page.should have_selector '#ref_chzn span', text: "master"
20 end 20 end
21 21
  22 + And 'page should select "v2.1.0" in select box' do
  23 + page.should have_selector '#ref_chzn span', text: "v2.1.0"
  24 + end
  25 +
22 And 'page should have "master" on graph' do 26 And 'page should have "master" on graph' do
23 within '.graph' do 27 within '.graph' do
24 page.should have_content 'master' 28 page.should have_content 'master'
@@ -35,6 +39,28 @@ class ProjectNetworkGraph < Spinach::FeatureSteps @@ -35,6 +39,28 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
35 sleep 2 39 sleep 2
36 end 40 end
37 41
  42 + When 'I switch ref to "v2.1.0"' do
  43 + page.select 'v2.1.0', from: 'ref'
  44 + sleep 2
  45 + end
  46 +
  47 + When 'click "Show only selected branch" checkbox' do
  48 + find('#filter_ref').click
  49 + sleep 2
  50 + end
  51 +
  52 + Then 'page should have content not cotaining "v2.1.0"' do
  53 + within '.graph' do
  54 + page.should have_content 'cleaning'
  55 + end
  56 + end
  57 +
  58 + Then 'page should not have content not cotaining "v2.1.0"' do
  59 + within '.graph' do
  60 + page.should_not have_content 'cleaning'
  61 + end
  62 + end
  63 +
38 And 'page should select "stable" in select box' do 64 And 'page should select "stable" in select box' do
39 page.should have_selector '#ref_chzn span', text: "stable" 65 page.should have_selector '#ref_chzn span', text: "stable"
40 end 66 end