Commit 09f2a25b0a8404c141ecd7f7f4474c4daec23e2c

Authored by Diego Camarinha
Committed by Paulo Meireles
1 parent e860eba7

[Mezuro] Updating reading feature.

Showing 1 changed file with 103 additions and 1 deletions   Show diff stats
plugins/mezuro/features/reading.feature
... ... @@ -58,7 +58,7 @@ Feature: Reading
58 58 Then I should see "Please fill all fields marked with (*)." inside an alert
59 59  
60 60 @selenium
61   - Scenario: I want to add a reading with no color
  61 + Scenario: I want to add a reading
62 62 Given I am on article "Sample Reading Group"
63 63 When I follow "Add Reading"
64 64 And I fill the fields with the new following data
... ... @@ -83,3 +83,105 @@ Feature: Reading
83 83 And I should see "2.0" in the "reading_grade" input
84 84 And I should see "34afe2" in the "reading_color" input
85 85 And I should see "Save" button
  86 +
  87 + @selenium
  88 + Scenario: I want to edit a reading leaving empty its title
  89 + Given I have a Mezuro reading with the following data
  90 + | label | Simple |
  91 + | grade | 2.0 |
  92 + | color | 34afe2 |
  93 + And I am on article "Sample Reading Group"
  94 + When I follow the edit link for "Simple" reading
  95 + And I erase the "reading_label" field
  96 + And I press "Save"
  97 + Then I should see "Please fill all fields marked with (*)." inside an alert
  98 +
  99 + @selenium
  100 + Scenario: I want to edit a reading leaving empty its grade
  101 + Given I have a Mezuro reading with the following data
  102 + | label | Simple |
  103 + | grade | 2.0 |
  104 + | color | 34afe2 |
  105 + And I am on article "Sample Reading Group"
  106 + When I follow the edit link for "Simple" reading
  107 + And I erase the "reading_grade" field
  108 + And I press "Save"
  109 + Then I should see "Please fill all fields marked with (*)." inside an alert
  110 +
  111 + @selenium
  112 + Scenario: I want to edit a reading leaving empty its color
  113 + Given I have a Mezuro reading with the following data
  114 + | label | Simple |
  115 + | grade | 2.0 |
  116 + | color | 34afe2 |
  117 + And I am on article "Sample Reading Group"
  118 + When I follow the edit link for "Simple" reading
  119 + And I erase the "reading_color" field
  120 + And I press "Save"
  121 + Then I should see "Please fill all fields marked with (*)." inside an alert
  122 +
  123 + @selenium
  124 + Scenario: I try to edit a reading with a label which already exists
  125 + Given I have a Mezuro reading with the following data
  126 + | label | Simple |
  127 + | grade | 2.0 |
  128 + | color | 34afe2 |
  129 + And I have a Mezuro reading with the following data
  130 + | label | Complex |
  131 + | grade | 5.0 |
  132 + | color | 13deb2 |
  133 + And I am on article "Sample Reading Group"
  134 + When I follow the edit link for "Simple" reading
  135 + And I fill the fields with the new following data
  136 + | reading_label | Complex |
  137 + | reading_grade | 2.0 |
  138 + | reading_color | 34afe2 |
  139 + And I press "Save"
  140 + Then I should see "This label already exists! Please, choose another one." inside an alert
  141 +
  142 + @selenium
  143 + Scenario: I try to edit a reading with a grade which already exists
  144 + Given I have a Mezuro reading with the following data
  145 + | label | Terrible |
  146 + | grade | 0.0 |
  147 + | color | 4feda4 |
  148 + And I have a Mezuro reading with the following data
  149 + | label | Perfect |
  150 + | grade | 10.0 |
  151 + | color | de41b2 |
  152 + And I am on article "Sample Reading Group"
  153 + When I follow the edit link for "Terrible" reading
  154 + And I fill the fields with the new following data
  155 + | reading_label | Terrible |
  156 + | reading_grade | 10.0 |
  157 + | reading_color | 4feda4 |
  158 + And I press "Save"
  159 + Then I should see "This grade already exists! Please, choose another one." inside an alert
  160 +
  161 + @selenium
  162 + Scenario: I want to edit a reading with valid attributes
  163 + Given I have a Mezuro reading with the following data
  164 + | label | Awful |
  165 + | grade | 2.5 |
  166 + | color | babaca |
  167 + And I am on article "Sample Reading Group"
  168 + When I follow the edit link for "Awful" reading
  169 + And I fill the fields with the new following data
  170 + | reading_label | Awesome |
  171 + | reading_grade | 10.0 |
  172 + | reading_color | fa40fa |
  173 + And I press "Save"
  174 + Then I should see "Awesome"
  175 + And I should see "10.0"
  176 + And I should see the "#fa40fa" color
  177 +
  178 + @selenium
  179 + Scenario: I want to remove a reading
  180 + Given I have a Mezuro reading with the following data
  181 + | label | Unbelievable |
  182 + | grade | 9001.0 |
  183 + | color | f0f0ca |
  184 + And I am on article "Sample Reading Group"
  185 + When I follow the remove link for "Unbelievable" reading
  186 + Then I should not see "Unbelievable"
  187 + And I should not see "9001.0"
... ...