Commit 38468efac2fbc9898b9d86f86b9c4e96cba9d467
Exists in
master
and in
5 other branches
Merge branch 'master' of gitlab.com:softwarepublico/mpog_software
Showing
2 changed files
with
93 additions
and
21 deletions
Show diff stats
... | ... | @@ -0,0 +1,93 @@ |
1 | +Feature: Institution Field | |
2 | + As a user | |
3 | + I want to sign up resgistring my institution | |
4 | + So others users can use it | |
5 | + | |
6 | + Background: | |
7 | + Given "MpogSoftwarePlugin" plugin is enabled | |
8 | + And I am logged in as admin | |
9 | + And I go to /admin/plugins | |
10 | + And I check "MpogSoftwarePlugin" | |
11 | + And I press "Save changes" | |
12 | + And I go to /account/logout | |
13 | + And Institutions has initial default values on database | |
14 | + | |
15 | + @selenium | |
16 | + Scenario: Show new institution field when follow add new institution | |
17 | + Given I go to /account/signup | |
18 | + When I follow "Add new institution" | |
19 | + And I should see "New Institution" | |
20 | + And I should see "Name" | |
21 | + And I should see "CNPJ" | |
22 | + And I should see "Public Institution" | |
23 | + And I choose "Public Institution" | |
24 | + And I should see "Acronym" | |
25 | + And I should see "Governmental Power:" | |
26 | + Then I should see "Governmental Sphere:" | |
27 | + | |
28 | + @selenium | |
29 | + Scenario: Show new institution fields when private institution is selected | |
30 | + Given I go to /account/signup | |
31 | + When I follow "Add new institution" | |
32 | + And I should see "New Institution" | |
33 | + And I should see "Name" | |
34 | + And I should see "CNPJ" | |
35 | + And I should see "Private Institution" | |
36 | + And I choose "Private Institution" | |
37 | + Then I should see "Fantasy name" | |
38 | + | |
39 | + @selenium | |
40 | + Scenario: Create new public institution when all required fields are filled. | |
41 | + Given I go to /account/signup | |
42 | + When I follow "Add new institution" | |
43 | + And I fill in "community_name" with "Institution Name" | |
44 | + And I fill in "institutions_cnpj" with "00.000.000/0001-00" | |
45 | + And I choose "Public Institution" | |
46 | + And I fill in "institutions_acronym" with "Teste" | |
47 | + And I select "Executivo" from "institutions_governmental_power" | |
48 | + And I select "Federal" from "institutions_governmental_sphere" | |
49 | + And I follow "Save" | |
50 | + Then I should see "Institution Name" | |
51 | + | |
52 | + @selenium | |
53 | + Scenario: Create new private institution when all required fields are filled | |
54 | + Given I go to /account/signup | |
55 | + When I follow "Add new institution" | |
56 | + And I fill in "community_name" with "Institution Name" | |
57 | + And I fill in "institutions_cnpj" with "00.000.000/0001-00" | |
58 | + And I choose "Private Institution" | |
59 | + And I fill in "institutions_acronym" with "Teste" | |
60 | + And I follow "Save" | |
61 | + Then I should see "Institution Name" | |
62 | + | |
63 | + @selenium | |
64 | + Scenario: Don't create an institution when name and cpnj are not filled | |
65 | + Given I go to /account/signup | |
66 | + When I follow "Add new institution" | |
67 | + And I choose "Private Institution" | |
68 | + And I fill in "institutions_acronym" with "Teste" | |
69 | + And I follow "Save" | |
70 | + Then I should see "Institution could not be created!" | |
71 | + And I should see "Name can't be blank" | |
72 | + And I should see "CNPJ can't be blank" | |
73 | + | |
74 | + @selenium | |
75 | + Scenario: Don't Create new institution when a governamental field is not filled | |
76 | + Given I go to /account/signup | |
77 | + When I follow "Add new institution" | |
78 | + And I fill in "community_name" with "Institution Name" | |
79 | + And I fill in "institutions_cnpj" with "00.000.000/0001-00" | |
80 | + And I choose "Public Institution" | |
81 | + And I follow "Save" | |
82 | + Then I should see "Governmental fields Could not find Governmental Power or Governmental Sphere" | |
83 | + | |
84 | + @selenium | |
85 | + Scenario: Don't Create new institution when a governamental field is not filled | |
86 | + Given I go to /account/signup | |
87 | + When I follow "Add new institution" | |
88 | + And I choose "Public Institution" | |
89 | + And I follow "Save" | |
90 | + Then I should see "Institution could not be created!" | |
91 | + And I should see "Governmental fields Could not find Governmental Power or Governmental Sphere" | |
92 | + And I should see "Name can't be blank" | |
93 | + And I should see "CNPJ can't be blank" | ... | ... |
features/instution_field.feature
... | ... | @@ -1,21 +0,0 @@ |
1 | -Feature: Institution Field | |
2 | - As a user | |
3 | - I want to sign up resgistring my institution | |
4 | - So others users can use it | |
5 | - | |
6 | - Background: | |
7 | - Given "MpogSoftwarePlugin" plugin is enabled | |
8 | - And I am logged in as admin | |
9 | - And I go to /admin/plugins | |
10 | - And I check "MpogSoftwarePlugin" | |
11 | - And I press "Save changes" | |
12 | - And I go to /account/logout | |
13 | - | |
14 | - @selenium | |
15 | - Scenario: Show new institution field when another institution is selected | |
16 | - Given I go to /account/signup | |
17 | - When I select "Other" from "Institution" | |
18 | - And I should see "New Institution" | |
19 | - And I fill in "institution_name" with "Test Institution" | |
20 | - And I fill in "profile_data_name" with " " | |
21 | - Then I should see "Test Institution" within "#user_institution_id" |