institution_registration.feature
3.96 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Feature: Institution Field
As a user
I want to sign up resgistring my institution
So others users can use it
Background:
Given "MpogSoftwarePlugin" plugin is enabled
And I am logged in as mpog_admin
And I go to /admin/plugins
And I check "MpogSoftwarePlugin"
And I press "Save changes"
And Institutions has initial default values on database
And I am logged in as mpog_admin
@selenium
Scenario: Show new institution fields when clicked in create new institution
Given I follow "Edit Profile"
When I follow "Create new institution"
And I should see "New Institution"
And I should see "Name"
And I should see "State"
And I should see "City"
And I should see "Country"
And I should see "CNPJ"
And I should see "Public Institution"
And I choose "Public Institution"
And I should see "Acronym"
And I should see "Governmental Power:"
Then I should see "Governmental Sphere:"
@selenium
Scenario: Show new institution fields when private institution is selected
Given I follow "Edit Profile"
When I follow "Create new institution"
And I should see "New Institution"
And I should see "Name"
And I should see "State"
And I should see "City"
And I should see "Country"
And I should see "CNPJ"
And I should see "Private Institution"
And I choose "Private Institution"
Then I should see "Fantasy name"
@selenium
Scenario: Create new public institution when all required fields are filled.
Given I follow "Edit Profile"
When I follow "Create new institution"
And I fill in "community_name" with "Institution Name"
And I fill in "institutions_cnpj" with "00.000.000/0001-00"
And I select "Brazil" from "community_country"
And I fill in "community_state" with "DF"
And I fill in "community_city" with "Brasilia"
And I choose "Public Institution"
And I select "Executivo" from "institutions_governmental_power"
And I select "Federal" from "institutions_governmental_sphere"
And I select "Autarquia" from "institutions_juridical_nature"
And I follow "Save"
Then I should see "Institution Name"
@selenium
Scenario: Create new private institution when all required fields are filled
Given I follow "Edit Profile"
When I follow "Create new institution"
And I fill in "community_name" with "Institution Name"
And I fill in "institutions_cnpj" with "00.000.000/0001-00"
And I select "Brazil" from "community_country"
And I fill in "community_state" with "DF"
And I fill in "community_city" with "Brasilia"
And I choose "Private Institution"
And I follow "Save"
Then I should see "Institution Name"
@selenium
Scenario: Don't create an institution when name and cpnj are not filled
Given I follow "Edit Profile"
When I follow "Create new institution"
And I choose "Private Institution"
And I fill in "institutions_acronym" with "Teste"
And I select "Brazil" from "community_country"
And I fill in "community_state" with "DF"
And I fill in "community_city" with "Brasilia"
And I follow "Save"
Then I should see "Institution could not be created!"
@selenium
Scenario: Don't Create new institution when a governamental field is not filled
Given I follow "Edit Profile"
When I follow "Create new institution"
And I fill in "community_name" with "Institution Name"
And I fill in "institutions_cnpj" with "00.000.000/0001-00"
And I select "Brazil" from "community_country"
And I fill in "community_state" with "DF"
And I fill in "community_city" with "Brasilia"
And I choose "Public Institution"
And I follow "Save"
Then I should see "Institution could not be created!"
@selenium
Scenario: Don't Create new institution when no field is filled
Given I follow "Edit Profile"
When I follow "Create new institution"
And I choose "Public Institution"
And I follow "Save"
Then I should see "Institution could not be created!"