Commit 61945fc5522368a96b69d2fd391fc98dbaf73124

Authored by Daniel Alves + Guilherme Rojas
Committed by Paulo Meireles
1 parent 9caca45f

[Mezuro] Reading feature finished.

Showing 1 changed file with 60 additions and 4 deletions   Show diff stats
plugins/mezuro/features/reading.feature
@@ -58,7 +58,48 @@ Feature: Reading @@ -58,7 +58,48 @@ Feature: Reading
58 Then I should see "Please fill all fields marked with (*)." inside an alert 58 Then I should see "Please fill all fields marked with (*)." inside an alert
59 59
60 @selenium 60 @selenium
61 - Scenario: I want to add a reading 61 + Scenario: I try to add a reading with an invalid color
  62 + Given I am on article "Sample Reading Group"
  63 + When I follow "Add Reading"
  64 + And I fill the fields with the new following data
  65 + | reading_label | Fantastic |
  66 + | reading_grade | 4.0 |
  67 + | reading_color | 1D10T4 |
  68 + And I press "Save"
  69 + Then I should see "This is not a valid color." inside an alert
  70 +
  71 + @selenium
  72 + Scenario: I try to add a reading with a label which already exists
  73 + Given I have a Mezuro reading with the following data
  74 + | label | Simple |
  75 + | grade | 2.0 |
  76 + | color | 34afe2 |
  77 + And I am on article "Sample Reading Group"
  78 + When I follow "Add Reading"
  79 + And I fill the fields with the new following data
  80 + | reading_label | Simple |
  81 + | reading_grade | 4.0 |
  82 + | reading_color | 1f0fa0 |
  83 + And I press "Save"
  84 + Then I should see "This label already exists! Please, choose another one." inside an alert
  85 +
  86 + @selenium
  87 + Scenario: I try to add a reading with a grade which already exists
  88 + Given I have a Mezuro reading with the following data
  89 + | label | Extraordinary |
  90 + | grade | 10.0 |
  91 + | color | b4bad0 |
  92 + And I am on article "Sample Reading Group"
  93 + When I follow "Add Reading"
  94 + And I fill the fields with the new following data
  95 + | reading_label | Super |
  96 + | reading_grade | 10.0 |
  97 + | reading_color | f0f000 |
  98 + And I press "Save"
  99 + Then I should see "This grade already exists! Please, choose another one." inside an alert
  100 +
  101 + @selenium
  102 + Scenario: I want to add a reading with valid attributes
62 Given I am on article "Sample Reading Group" 103 Given I am on article "Sample Reading Group"
63 When I follow "Add Reading" 104 When I follow "Add Reading"
64 And I fill the fields with the new following data 105 And I fill the fields with the new following data
@@ -85,7 +126,7 @@ Feature: Reading @@ -85,7 +126,7 @@ Feature: Reading
85 And I should see "Save" button 126 And I should see "Save" button
86 127
87 @selenium 128 @selenium
88 - Scenario: I want to edit a reading leaving empty its title 129 + Scenario: I try to edit a reading leaving empty its title
89 Given I have a Mezuro reading with the following data 130 Given I have a Mezuro reading with the following data
90 | label | Simple | 131 | label | Simple |
91 | grade | 2.0 | 132 | grade | 2.0 |
@@ -97,7 +138,7 @@ Feature: Reading @@ -97,7 +138,7 @@ Feature: Reading
97 Then I should see "Please fill all fields marked with (*)." inside an alert 138 Then I should see "Please fill all fields marked with (*)." inside an alert
98 139
99 @selenium 140 @selenium
100 - Scenario: I want to edit a reading leaving empty its grade 141 + Scenario: I try to edit a reading leaving empty its grade
101 Given I have a Mezuro reading with the following data 142 Given I have a Mezuro reading with the following data
102 | label | Simple | 143 | label | Simple |
103 | grade | 2.0 | 144 | grade | 2.0 |
@@ -109,7 +150,7 @@ Feature: Reading @@ -109,7 +150,7 @@ Feature: Reading
109 Then I should see "Please fill all fields marked with (*)." inside an alert 150 Then I should see "Please fill all fields marked with (*)." inside an alert
110 151
111 @selenium 152 @selenium
112 - Scenario: I want to edit a reading leaving empty its color 153 + Scenario: I try to edit a reading leaving empty its color
113 Given I have a Mezuro reading with the following data 154 Given I have a Mezuro reading with the following data
114 | label | Simple | 155 | label | Simple |
115 | grade | 2.0 | 156 | grade | 2.0 |
@@ -120,6 +161,21 @@ Feature: Reading @@ -120,6 +161,21 @@ Feature: Reading
120 And I press "Save" 161 And I press "Save"
121 Then I should see "Please fill all fields marked with (*)." inside an alert 162 Then I should see "Please fill all fields marked with (*)." inside an alert
122 163
  164 + @selenium
  165 + Scenario: I try to edit a reading with an invalid color
  166 + Given I have a Mezuro reading with the following data
  167 + | label | Worthless |
  168 + | grade | 1.0 |
  169 + | color | e5cad4 |
  170 + And I am on article "Sample Reading Group"
  171 + When I follow the edit link for "Worthless" reading
  172 + And I fill the fields with the new following data
  173 + | reading_label | Worthless |
  174 + | reading_grade | 1.0 |
  175 + | reading_color | bu5aoooooo |
  176 + And I press "Save"
  177 + Then I should see "This is not a valid color." inside an alert
  178 +
123 @selenium 179 @selenium
124 Scenario: I try to edit a reading with a label which already exists 180 Scenario: I try to edit a reading with a label which already exists
125 Given I have a Mezuro reading with the following data 181 Given I have a Mezuro reading with the following data