bsc.feature
7.01 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
Feature: bsc
Background:
Given "Bsc" plugin is enabled
Scenario: display link to bsc creation on admin panel when bsc plugin active
Given I am logged in as admin
When I am on the environment control panel
Then I should see "Create Bsc"
When "Bsc" plugin is disabled
And I am on the environment control panel
Then I should not see "Create Bsc"
Scenario: be able to create a bsc
Given I am logged in as admin
And I am on the environment control panel
And I follow "Create Bsc"
And I fill in the following:
| Business name | Sample Bsc |
| Company name | Sample Bsc |
| profile_data_identifier | sample-identifier |
| Cnpj | 07.970.746/0001-77 |
When I press "Save"
Then there should be a profile named "Sample Bsc"
Scenario: display a button on bsc control panel to manage associated enterprises
Given the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj |
| Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 |
And I am logged in as admin
When I am on Bsc Test's control panel
Then I should see "Manage associated enterprises"
Scenario: display a button on bsc control panel to transfer ownership
Given the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj |
| Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 |
And I am logged in as admin
When I am on Bsc Test's control panel
Then I should see "Transfer ownership"
Scenario: create a new enterprise already associated with a bsc
Given the following user
| login | name |
| pedro-silva | Pedro Silva |
And the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj | owner |
| Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 | pedro-silva |
And organization_approval_method is "none" on environment
And I am logged in as "pedro-silva"
And I am on Bsc Test's control panel
And I follow "Manage associated enterprises"
And I follow "Add new enterprise"
And I fill in the following:
| Name | Associated Enterprise |
| Address | associated-enterprise |
When I press "Save"
Then "Associated Enterprise" should be associated with "Bsc Test"
Scenario: do not display "add new product" button
Given the following user
| login | name |
| pedro-silva | Pedro Silva |
And the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj | owner |
| Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 | pedro-silva |
And feature "disable_products_for_enterprises" is disabled on environment
And I am logged in as "pedro-silva"
And I am on Bsc Test's control panel
When I follow "Manage Products/Services"
Then I should not see "New product or service"
Scenario: display bsc's enterprises' products name on the bsc catalog
Given the following user
| login | name |
| pedro-silva | Pedro Silva |
And the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj | owner |
| Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 | pedro-silva |
And the following enterprise
| identifier | name |
| sample-enterprise | Sample Enterprise |
And the following product_category
| name |
| bike |
And the following products
| owner | category | name |
| sample-enterprise | bike | Master Bike |
And "Sample Enterprise" is associated with "Bsc Test"
And I am logged in as "pedro-silva"
When I go to Bsc Test's products page
Then I should see "Master Bike"
And I should see "Sample Enterprise"
Scenario: display enterprise name linked only if person is member of any Bsc
Given the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj |
| Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 |
| Another Bsc | another-bsc | Another Bsc Test Ltda | 07.970.746/0001-77 |
And the following enterprise
| identifier | name |
| sample-enterprise | Sample Enterprise |
And the following product_category
| name |
| bike |
And the following products
| owner | category | name |
| sample-enterprise | bike | Master Bike |
And "Sample Enterprise" is associated with "Bsc Test"
And the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj |
And the following user
| login | name |
| pedro | Pedro Souto |
| maria | Maria Souto |
And pedro is member of another-bsc
And I am logged in as "pedro"
When I go to Bsc Test's products page
Then I should see "Sample Enterprise"
And I should see "Sample Enterprise" within "a.bsc-catalog-enterprise-link"
But I am logged in as "maria"
When I go to Bsc Test's products page
Then I should see "Sample Enterprise"
#TODO -> test that it's not a link
Scenario: allow only environment administrators to delete bsc profile
Given the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj |
| Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 |
And the following user
| login | name |
| pedro | Pedro Souto |
And "Pedro Souto" is admin of "Bsc Test"
And I am logged in as "pedro"
And I am on Bsc Test's control panel
And I follow "Bsc info and settings"
When I follow "Delete profile"
Then I should see "Access denied"
And "Bsc Test" profile should exist
But I am logged in as admin
And I am on Bsc Test's control panel
And I follow "Bsc info and settings"
When I follow "Delete profile"
Then I should see "Deleting profile Bsc Test"
And I follow "Yes, I am sure"
Then "Bsc Test" profile should not exist
# Like we can believe that selenium is going to work...
@selenium
Scenario: list already associated enterprises on manage associated enterprises
Given the folllowing "bsc" from "bsc_plugin"
| business_name | identifier | company_name | cnpj |
| Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 |
And the following enterprises
| identifier | name |
| enterprise-1 | Enterprise 1 |
| enterprise-2 | Enterprise 2 |
And "Enterprise 1" is associated with "Bsc Test"
And "Enterprise 2" is associated with "Bsc Test"
And I am logged in as admin
And I am on Bsc Test's control panel
When I follow "Manage associated enterprises"
Then I should see "Enterprise 1"
And I should see "Enterprise 2"