Commit acee49f2898013b7e0813eab72c15b2e79ccfb4a
1 parent
0462d511
Exists in
colab
and in
4 other branches
Added test to check valid color from color picker
signed-off-by: Pedro Bruel <pedro.bruel@gmail.com>
Showing
2 changed files
with
18 additions
and
1 deletions
Show diff stats
features/reading/new.feature
| ... | ... | @@ -29,7 +29,7 @@ Feature: New reading |
| 29 | 29 | Then I should be in the Sample Reading Group page |
| 30 | 30 | |
| 31 | 31 | @kalibro_restart @javascript |
| 32 | - Scenario: Using Colorpicker | |
| 32 | + Scenario: Checking color picker existence | |
| 33 | 33 | Given I am a regular user |
| 34 | 34 | And I am signed in |
| 35 | 35 | And I own a sample reading group |
| ... | ... | @@ -37,6 +37,19 @@ Feature: New reading |
| 37 | 37 | When I press the Pick color button |
| 38 | 38 | Then I should see a color picker Canvas |
| 39 | 39 | |
| 40 | + @kalibro_restart @javascript @wip | |
| 41 | + Scenario: Selecting a valid color with color picker | |
| 42 | + Given I am a regular user | |
| 43 | + And I am signed in | |
| 44 | + And I own a sample reading group | |
| 45 | + And I am at the New Reading page | |
| 46 | + And I fill the Label field with "My Reading" | |
| 47 | + And I fill the Grade field with "1" | |
| 48 | + When I press the Pick color button | |
| 49 | + And I click on the center of the color picker | |
| 50 | + And I press the Save button | |
| 51 | + Then I should be in the Sample Reading Group page | |
| 52 | + | |
| 40 | 53 | @kalibro_restart |
| 41 | 54 | Scenario: With an existing label (Label uniqueness test) |
| 42 | 55 | Given I am a regular user | ... | ... |
features/step_definitions/reading_steps.rb
| ... | ... | @@ -18,6 +18,10 @@ When(/^I click the "(.*?)" td$/) do |text| |
| 18 | 18 | p page.find('td', text: text).methods |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | +When(/^I click on the center of the color picker$/) do | |
| 22 | + page.find('div.colorpicker_color').click | |
| 23 | +end | |
| 24 | + | |
| 21 | 25 | Then(/^I should be at the New Reading page$/) do |
| 22 | 26 | visit new_reading_group_reading_path(@reading_group.id) |
| 23 | 27 | end | ... | ... |