adding_metric_configuration.feature
2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Feature: Add metric configuration to a configuration
As a mezuro user
I want to add metric configurations to a Kalibro configuration
Background:
Given the following users
| login | name |
| joaosilva | Joao Silva |
And I am logged in as "joaosilva"
And "Mezuro" plugin is enabled
And the following community
| identifier | name |
| mycommunity | My Community |
And "Joao Silva" is admin of "My Community"
And I am on My Community's cms
And I create a content of type "Kalibro configuration" with the following data
| Title | My Configuration |
| Description | A sample description |
Scenario: adding a native metric configuration
When I follow "Add metric"
And I follow "Analizo"
And I follow "Lines of Code"
And I fill in the following:
| Code: | Sample Code |
| Weight: | 10.0 |
And I select "Average" from "Aggregation Form:"
And I press "Add"
Then I should see "Lines of Code"
And I should see "Analizo"
And I should see "Sample Code"
Scenario: adding a native metric configuration without code
When I follow "Add metric"
And I follow "Analizo"
And I follow "Number of Children"
And I don't fill anything
And I press "Add"
Then I should be at the url "/myprofile/my-community/plugin/mezuro/new_metric_configuration"
Scenario: adding a compound metric configuration
When I follow "Add metric"
And I follow "New Compound Metric"
And I fill in the following:
| Name: | Compound sample |
| Description: | 10.0 |
| Script: | return 42; |
| Code: | anyCode |
| Weight: | 10.0 |
And I select "Class" from "Scope:"
And I select "Average" from "Aggregation Form:"
And I press "Add"
Then I should see "Compound sample"
Scenario: adding a compound metric configuration with invalid script
When I follow "Add metric"
And I follow "New Compound Metric"
And I fill in the following:
| Name: | Compound sample |
| Description: | 10.0 |
| Script: | invalid script |
| Code: | anyCode |
| Weight: | 10.0 |
And I select "Class" from "Scope:"
And I select "Average" from "Aggregation Form:"
And I press "Add"
Then I should see "Compound sample"