Commit 2227335ca7cbcbc1defa4653f3724848249ed5e4
Committed by
Paulo Meireles
1 parent
5a8e308c
Exists in
master
and in
22 other branches
[Mezuro] Updating acceptance tests
Showing
3 changed files
with
44 additions
and
30 deletions
Show diff stats
features/step_definitions/mezuro_steps.rb
| 1 | +When /^I create a Mezuro (project|configuration) with the following data$/ do |type, fields| | ||
| 2 | + click_link ("Mezuro " + type) | ||
| 3 | + | ||
| 4 | + fields.rows_hash.each do |name, value| | ||
| 5 | + When %{I fill in "#{name}" with "#{value}"} | ||
| 6 | + end | ||
| 7 | + | ||
| 8 | + if Article.find_by_name(fields.rows_hash[:Title]) | ||
| 9 | + return false | ||
| 10 | + end | ||
| 11 | + | ||
| 12 | + click_button "Save" # Does not work without selenium? | ||
| 13 | + Article.find_by_name(fields.rows_hash[:Title]) | ||
| 14 | +end | ||
| 15 | + | ||
| 1 | Then /^I directly delete content with name "([^\"]*)" for testing purposes$/ do |content_name| | 16 | Then /^I directly delete content with name "([^\"]*)" for testing purposes$/ do |content_name| |
| 2 | Article.find_by_name(content_name).destroy | 17 | Article.find_by_name(content_name).destroy |
| 3 | end | 18 | end |
plugins/mezuro/test/features/creating_configuration.feature
| 1 | Feature: Create configuration | 1 | Feature: Create configuration |
| 2 | As a mezuro user | 2 | As a mezuro user |
| 3 | - I want to create a Kalibro configuration | 3 | + I want to create a Mezuro configuration |
| 4 | 4 | ||
| 5 | Background: | 5 | Background: |
| 6 | Given the following users | 6 | Given the following users |
| @@ -8,14 +8,14 @@ Feature: Create configuration | @@ -8,14 +8,14 @@ Feature: Create configuration | ||
| 8 | | joaosilva | Joao Silva | | 8 | | joaosilva | Joao Silva | |
| 9 | And I am logged in as "joaosilva" | 9 | And I am logged in as "joaosilva" |
| 10 | And "Mezuro" plugin is enabled | 10 | And "Mezuro" plugin is enabled |
| 11 | - And the following community | ||
| 12 | - | identifier | name | | ||
| 13 | - | mycommunity | My Community | | ||
| 14 | - And "Joao Silva" is admin of "My Community" | 11 | + |
| 12 | + Scenario: I see Mezuro Configuration on my control panel | ||
| 13 | + When I go to the Control panel | ||
| 14 | + Then I should see "Mezuro configuration" | ||
| 15 | 15 | ||
| 16 | Scenario: creating with valid attributes | 16 | Scenario: creating with valid attributes |
| 17 | - Given I am on My Community's cms | ||
| 18 | - When I create a content of type "Kalibro configuration" with the following data | 17 | + When I go to the Control panel |
| 18 | + And I create a Mezuro configuration with the following data | ||
| 19 | | Title | Qt_Calculator | | 19 | | Title | Qt_Calculator | |
| 20 | | Description | A sample description | | 20 | | Description | A sample description | |
| 21 | Then I should see "Name" | 21 | Then I should see "Name" |
| @@ -24,17 +24,17 @@ Feature: Create configuration | @@ -24,17 +24,17 @@ Feature: Create configuration | ||
| 24 | And I should see "A sample description" | 24 | And I should see "A sample description" |
| 25 | 25 | ||
| 26 | Scenario: creating with duplicated name | 26 | Scenario: creating with duplicated name |
| 27 | - Given I am on My Community's cms | ||
| 28 | - And I create a content of type "Kalibro configuration" with the following data | 27 | + When I go to the Control panel |
| 28 | + And I create a Mezuro configuration with the following data | ||
| 29 | | Title | Original Title | | 29 | | Title | Original Title | |
| 30 | - And I am on My Community's cms | ||
| 31 | - When I create a content of type "Kalibro configuration" with the following data | 30 | + And I go to the Control panel |
| 31 | + And I create a Mezuro configuration with the following data | ||
| 32 | | Title | Original Title | | 32 | | Title | Original Title | |
| 33 | Then I should see "1 error prohibited this article from being saved" | 33 | Then I should see "1 error prohibited this article from being saved" |
| 34 | 34 | ||
| 35 | Scenario: creating without title | 35 | Scenario: creating without title |
| 36 | - Given I am on My Community's cms | ||
| 37 | - When I create a content of type "Kalibro configuration" with the following data | 36 | + When I go to the Control panel |
| 37 | + And I create a Mezuro configuration with the following data | ||
| 38 | | Title | | | 38 | | Title | | |
| 39 | Then I should see "1 error prohibited this article from being saved" | 39 | Then I should see "1 error prohibited this article from being saved" |
| 40 | 40 |
plugins/mezuro/test/features/creating_project.feature
| 1 | Feature: Create project | 1 | Feature: Create project |
| 2 | As a mezuro user | 2 | As a mezuro user |
| 3 | - I want to create a Kalibro project | 3 | + I want to create a Mezuro project |
| 4 | 4 | ||
| 5 | Background: | 5 | Background: |
| 6 | Given the following users | 6 | Given the following users |
| @@ -13,10 +13,9 @@ Feature: Create project | @@ -13,10 +13,9 @@ Feature: Create project | ||
| 13 | | mycommunity | My Community | | 13 | | mycommunity | My Community | |
| 14 | And "Joao Silva" is admin of "My Community" | 14 | And "Joao Silva" is admin of "My Community" |
| 15 | 15 | ||
| 16 | - Scenario: I see Kalibro project's input form | ||
| 17 | - Given I am on My Community's cms | ||
| 18 | - When I follow "New content" | ||
| 19 | - And I follow "Kalibro project" | 16 | + Scenario: I see Mezuro project's input form |
| 17 | + Given I am on My Community's control panel | ||
| 18 | + When I follow "Mezuro Project" | ||
| 20 | Then I should see "Title" | 19 | Then I should see "Title" |
| 21 | And I should see "License" | 20 | And I should see "License" |
| 22 | And I should see "Repository type" | 21 | And I should see "Repository type" |
| @@ -28,24 +27,24 @@ Feature: Create project | @@ -28,24 +27,24 @@ Feature: Create project | ||
| 28 | And I should see "Configuration" | 27 | And I should see "Configuration" |
| 29 | And I should see "Kalibro for Java" | 28 | And I should see "Kalibro for Java" |
| 30 | 29 | ||
| 31 | - Scenario: I create a Kalibro project with valid attributes | ||
| 32 | - Given I am on My Community's cms | ||
| 33 | - When I create a content of type "Kalibro project" with the following data | 30 | + Scenario: I create a Mezuro project with valid attributes |
| 31 | + Given I am on My Community's control panel | ||
| 32 | + When I create a Mezuro project with the following data | ||
| 34 | | Title | Sample Project | | 33 | | Title | Sample Project | |
| 35 | | License | GPL | | 34 | | License | GPL | |
| 36 | | Repository type | SUBVERSION | | 35 | | Repository type | SUBVERSION | |
| 37 | | Repository url | https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator | | 36 | | Repository url | https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator | |
| 38 | | Configuration | Kalibro for Java | | 37 | | Configuration | Kalibro for Java | |
| 39 | - Then I should see "Sample Project" | ||
| 40 | - And I should see "GPL" | ||
| 41 | - And I should see "SUBVERSION" | ||
| 42 | - And I should see "https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator" | ||
| 43 | - And I should see "Kalibro for Java" | ||
| 44 | - And I directly delete content with name "Sample Project" for testing purposes | 38 | + Then I should see "Sample Project" |
| 39 | + And I should see "GPL" | ||
| 40 | + And I should see "SUBVERSION" | ||
| 41 | + And I should see "https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator" | ||
| 42 | + And I should see "Kalibro for Java" | ||
| 43 | + And I directly delete content with name "Sample Project" for testing purposes | ||
| 45 | 44 | ||
| 46 | - Scenario: I can't create a Kalibro project with invalid attributes | ||
| 47 | - Given I am on My Community's cms | ||
| 48 | - When I create a content of type "Kalibro project" with the following data | 45 | + Scenario: I can't create a Mezuro project with invalid attributes |
| 46 | + Given I am on My Community's control panel | ||
| 47 | + When I create a Mezuro project with the following data | ||
| 49 | | Title | | | 48 | | Title | | |
| 50 | | License | GPL | | 49 | | License | GPL | |
| 51 | | Repository type | SUBVERSION | | 50 | | Repository type | SUBVERSION | |