user_registration.feature
5.43 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: User Registration
Background:
Given "MpogSoftwarePlugin" plugin is enabled
And I am logged in as admin
And I go to /admin/plugins
And I check "MpogSoftwarePlugin"
And I press "Save changes"
And I go to /admin/features/manage_fields
And I check "person_fields_country_active"
And I check "person_fields_country_required"
And I check "person_fields_country_signup"
And I check "person_fields_state_active"
And I check "person_fields_state_required"
And I check "person_fields_state_signup"
And I check "person_fields_city_active"
And I check "person_fields_city_required"
And I check "person_fields_city_signup"
And I press "Save changes"
And the following blocks
| owner | type |
| environment | LoginBlock |
And I go to /account/logout
@selenium
Scenario: Successful autocomplete with part of the institution name and adding institution
Given I go to /account/signup
And Institutions has initial default values on database
And the following public institutions
| name | acronym | country | state | city | cnpj | juridical_nature | governmental_power | governmental_sphere |
| Ministerio das Cidades | MC | BR | DF | Gama | 58.745.189/0001-21 | Autarquia | Executivo | Federal |
| Governo do DF | GDF | BR | DF | Taguatinga | 12.645.166/0001-44 | Autarquia | Legislativo | Federal |
| Ministerio do Planejamento | MP | BR | DF | Brasilia | 41.769.591/0001-43 | Autarquia | Judiciario | Federal |
And I type in "Minis" into autocomplete list "input_institution" and I choose "Ministerio do Planejamento"
And I follow "Add new institution"
Then I should see "Ministerio do Planejamento" within ".institutions_added"
@selenium
Scenario: Successfull autocomplete with institution acronym
Given I go to /account/signup
And Institutions has initial default values on database
And the following public institutions
| name | acronym | country | state | city | cnpj | juridical_nature | governmental_power | governmental_sphere |
| Ministerio das Cidades | MC | BR | DF | Gama | 58.745.189/0001-21 | Autarquia | Executivo | Federal |
| Governo do DF | GDF | BR | DF | Taguatinga | 12.645.166/0001-44 | Autarquia | Legislativo | Federal |
| Ministerio do Planejamento | MP | BR | DF | Brasilia | 41.769.591/0001-43 | Autarquia | Judiciario | Federal |
And I type in "MP" into autocomplete list "input_institution" and I choose "Ministerio do Planejamento"
And I follow "Add new institution"
Then I should see "Ministerio do Planejamento" within ".institutions_added"
@selenium
Scenario: Remove the incomplete resgistration percentage message
Given I go to /account/signup
And I fill in the following within ".no-boxes":
| e-Mail | josesilva@gmail.com |
| Password | secret |
| Password confirmation | secret |
| Full name | José da Silva |
| State | Bahia |
| City | Salvador |
| Secondary e-Mail | josesilva@example.com |
And I select "Brazil" from "profile_data[country]"
And I fill in "Username" with "josesilva"
And wait for the captcha signup time
And I press "Create my account"
When José da Silva's account is activated
And I go to login page
And I fill in "Username" with "josesilva"
And I fill in "Password" with "secret"
And I press "Log in"
And I click on anything with selector ".hide-incomplete-percentage"
Then I should not see "Complete Profile: 37%"
@selenium
Scenario: When the user logged in and hide link of imcomplete percentage and user log out and log in again, the percentage registration link must appear
Given the following users
| login | name | email | country | state | city |
| maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia |
When I am logged in as "maria"
And I go to /profile/maria
And I should see "Complete Profile:"
And I click on anything with selector ".hide-incomplete-percentage"
And I should not see "Complete Profile"
And I follow "Logout"
And I am logged in as "maria"
And I go to /profile/maria
Then I should see "Complete Profile:"
@selenium
Scenario: When the user logged in and hide link of imcomplete percentage and user update page, the percentage registration link must not appear
Given the following users
| login | name | email | country | state | city |
| maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia |
When I am logged in as "maria"
And I go to /profile/maria
And I should see "Complete Profile"
And I click on anything with selector ".hide-incomplete-percentage"
And I should not see "Complete Profile"
And I go to /myprofile/maria/profile_editor/edit
And I should not see "Complete Profile"
And I go to /profile/maria
Then I should not see "Complete Profile"