sefrone-api-e2e 1.4.0__tar.gz → 1.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/PKG-INFO +1 -1
  2. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/1_normal_auth_flow.yaml +27 -6
  3. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/2_account_endpoints.yaml +202 -170
  4. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/3_admin_account_endpoints.yaml +54 -4
  5. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/4_workspace_endpoints.yaml +1 -1
  6. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/5_apikey_endpoints.yaml +105 -15
  7. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e.egg-info/PKG-INFO +1 -1
  8. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/setup.py +1 -1
  9. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/README.md +0 -0
  10. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/__init__.py +0 -0
  11. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/api_e2e_manager.py +0 -0
  12. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/0_check_features.yaml +0 -0
  13. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/6_project_endpoints.yaml +0 -0
  14. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/7_email_2fa_flow.yaml +0 -0
  15. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/8_temporary_passwords_flow.yaml +0 -0
  16. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Auth/9_project_account_access_control_flow.yaml +0 -0
  17. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Oidc/1_relying_party_admin.yaml +0 -0
  18. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Oidc/2_authorization_code_flow.yaml +0 -0
  19. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Oidc/3_disable_propagation_flow.yaml +0 -0
  20. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e/Scenarios/Oidc/4_multi_project_isolation.yaml +0 -0
  21. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/e2e_scenarios_manager.py +0 -0
  22. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/env_patch.py +0 -0
  23. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/json_mock_server.py +0 -0
  24. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_assets.py +0 -0
  25. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_csv.py +0 -0
  26. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_email_mock.py +0 -0
  27. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_excel.py +0 -0
  28. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_mysql.py +0 -0
  29. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_postgresql.py +0 -0
  30. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_rest_api.py +0 -0
  31. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_satim_mock.py +0 -0
  32. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/runner_webhook_mock.py +0 -0
  33. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e/step_runner.py +0 -0
  34. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e.egg-info/SOURCES.txt +0 -0
  35. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e.egg-info/dependency_links.txt +0 -0
  36. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e.egg-info/requires.txt +0 -0
  37. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/sefrone_api_e2e.egg-info/top_level.txt +0 -0
  38. {sefrone_api_e2e-1.4.0 → sefrone_api_e2e-1.4.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sefrone_api_e2e
3
- Version: 1.4.0
3
+ Version: 1.4.1
4
4
  Summary: A Python package to provide e2e testing helpers for sefrone API projects
5
5
  Home-page: https://bitbucket.org/sefrone/sefrone_pypi
6
6
  Author: Sefrone
@@ -17,13 +17,34 @@ steps:
17
17
  body:
18
18
  response:
19
19
  token: string
20
+ projectId: string
20
21
  save:
21
22
  login_token: "{{body.response.token}}"
23
+ login_project_id: "{{body.response.projectId}}"
22
24
 
23
25
  - name: "Generate unique test suffix"
24
26
  randomize:
25
27
  seed_id: 8
26
28
 
29
+ - name: "Create a workspace for this flow"
30
+ skip_if:
31
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
32
+ method: "POST"
33
+ endpoint: "/api/v1/apiAuth/workspace"
34
+ request_headers:
35
+ - x-api-token: "{$stored.login_token}"
36
+ send_as: "json"
37
+ body:
38
+ name: "e2e_auth_ws_{$stored.seed_id}"
39
+ description: "E2E auth flow workspace"
40
+ projectId: "{$stored.login_project_id}"
41
+ expect:
42
+ status: 200
43
+ body:
44
+ errorCode: number
45
+ errorCodeStr: string
46
+ message: string
47
+
27
48
  - name: "Get user info"
28
49
  method: "GET"
29
50
  endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/info/{$stored.login_token}"
@@ -125,9 +146,9 @@ steps:
125
146
  - name: "Create guest account for workspace"
126
147
  skip_if:
127
148
  - "GuestAccount not in {$stored.0_check_features.enabled_features}"
128
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
149
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
129
150
  method: "POST"
130
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/guest"
151
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_auth_ws_{$stored.seed_id}/guest"
131
152
  expect:
132
153
  status: 200
133
154
  body:
@@ -153,14 +174,14 @@ steps:
153
174
  assertions:
154
175
  - "{{body.response.accountType}} == 'guest'"
155
176
  - "{{body.response.linkedWorkspaces.count()}} == 1"
156
- - "{{body.response.linkedWorkspaces[0].workspaceName}} == '$var(DEFAULT_WORKSPACE_NAME)'"
177
+ - "{{body.response.linkedWorkspaces[0].workspaceName}} == 'e2e_auth_ws_{$stored.seed_id}'"
157
178
 
158
179
  - name: "Get same workspace guest account with existing token"
159
180
  skip_if:
160
181
  - "GuestAccount not in {$stored.0_check_features.enabled_features}"
161
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
182
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
162
183
  method: "POST"
163
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/guest"
184
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_auth_ws_{$stored.seed_id}/guest"
164
185
  request_headers:
165
186
  - x-api-token: "{$stored.workspace_guest_token}"
166
187
  expect:
@@ -186,7 +207,7 @@ steps:
186
207
  - "{{body.response.accountId}} == '{$stored.workspace_guest_account_id}'"
187
208
  - "{{body.response.token}} == '{$stored.workspace_guest_token}'"
188
209
  - "{{body.response.linkedWorkspaces.count()}} == 1"
189
- - "{{body.response.linkedWorkspaces[0].workspaceName}} == '$var(DEFAULT_WORKSPACE_NAME)'"
210
+ - "{{body.response.linkedWorkspaces[0].workspaceName}} == 'e2e_auth_ws_{$stored.seed_id}'"
190
211
 
191
212
  - name: "Login with wrong password"
192
213
  method: "POST"
@@ -1,170 +1,202 @@
1
- name: "Account Endpoints Flow"
2
- base_url: "http://localhost:$var(API_PUBLIC_PORT)"
3
- steps:
4
- - name: "Login admin user"
5
- retry:
6
- attempts: 10
7
- delay_seconds: 5
8
- method: "POST"
9
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
10
- send_as: "json"
11
- body:
12
- device: "e2e_test_device"
13
- pseudo: "$var(DEFAULT_USERNAME)"
14
- password: "$var(DEFAULT_PASSWORD)"
15
- expect:
16
- status: 200
17
- body:
18
- response:
19
- token: string
20
- save:
21
- admin_token: "{{body.response.token}}"
22
-
23
- - name: "Generate unique test suffix"
24
- randomize:
25
- guest_seed_account_id: 8
26
-
27
- - name: "Create account by workspace"
28
- skip_if:
29
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
30
- method: "POST"
31
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/create?accountType=standard"
32
- request_headers:
33
- - x-api-token: "{$stored.admin_token}"
34
- send_as: "json"
35
- body:
36
- username: "e2e_account_{$stored.guest_seed_account_id}"
37
- password: "e2e_account_pwd_v1"
38
- expect:
39
- status: 200
40
- body:
41
- errorCode: number
42
- errorCodeStr: string
43
- message: string
44
- response:
45
- accountId: string
46
- projectId: string
47
- project: string
48
- accountType: string
49
- isActive: boolean
50
- username: string
51
- linkedWorkspaces:
52
- - workspaceId: string
53
- workspaceName: string
54
- workspaceDescription: string
55
- save:
56
- managed_account_id: "{{body.response.accountId}}"
57
- managed_account_username: "{{body.response.username}}"
58
- assertions:
59
- - "{{body.response.accountType}} == 'standard'"
60
- - "{{body.response.isActive}} == True"
61
- - "{{body.response.linkedWorkspaces.count()}} == 1"
62
- - "{{body.response.linkedWorkspaces[0].workspaceName}} == '$var(DEFAULT_WORKSPACE_NAME)'"
63
-
64
- - name: "Get created account permissions"
65
- skip_if:
66
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
67
- method: "GET"
68
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/permission/{$stored.managed_account_id}"
69
- request_headers:
70
- - x-api-token: "{$stored.admin_token}"
71
- expect:
72
- status: 200
73
- body:
74
- errorCode: number
75
- errorCodeStr: string
76
- message: string
77
- response:
78
- accountId: string
79
- projectId: string
80
- assertions:
81
- - "{{body.response.accountId}} == '{$stored.managed_account_id}'"
82
-
83
- - name: "Update created account by workspace"
84
- skip_if:
85
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
86
- method: "POST"
87
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/update/{$stored.managed_account_id}"
88
- request_headers:
89
- - x-api-token: "{$stored.admin_token}"
90
- send_as: "json"
91
- body:
92
- username: "e2e_updated_{$stored.guest_seed_account_id}"
93
- expect:
94
- status: 200
95
- body:
96
- errorCode: number
97
- errorCodeStr: string
98
- message: string
99
-
100
- - name: "Set created account credentials by workspace"
101
- skip_if:
102
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
103
- method: "POST"
104
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/credentials/{$stored.managed_account_id}"
105
- request_headers:
106
- - x-api-token: "{$stored.admin_token}"
107
- send_as: "json"
108
- body:
109
- password: "e2e_account_pwd_v2"
110
- expect:
111
- status: 200
112
- body:
113
- errorCode: number
114
- errorCodeStr: string
115
- message: string
116
-
117
- - name: "Login updated account with new credentials"
118
- skip_if:
119
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
120
- method: "POST"
121
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
122
- send_as: "json"
123
- body:
124
- device: "e2e_test_device"
125
- pseudo: "e2e_updated_{$stored.guest_seed_account_id}"
126
- password: "e2e_account_pwd_v2"
127
- expect:
128
- status: 200
129
- body:
130
- errorCode: number
131
- errorCodeStr: string
132
- message: string
133
- response:
134
- accountId: string
135
- token: string
136
- save:
137
- managed_account_token: "{{body.response.token}}"
138
- assertions:
139
- - "{{body.response.accountId}} == '{$stored.managed_account_id}'"
140
-
141
- - name: "Delete created account by workspace"
142
- skip_if:
143
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
144
- method: "DELETE"
145
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/delete/{$stored.managed_account_id}"
146
- request_headers:
147
- - x-api-token: "{$stored.admin_token}"
148
- expect:
149
- status: 200
150
- body:
151
- errorCode: number
152
- errorCodeStr: string
153
- message: string
154
-
155
- - name: "Login should fail for deleted account"
156
- skip_if:
157
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
158
- method: "POST"
159
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
160
- send_as: "json"
161
- body:
162
- device: "e2e_test_device"
163
- pseudo: "e2e_updated_{$stored.guest_seed_account_id}"
164
- password: "e2e_account_pwd_v2"
165
- expect:
166
- status: 401
167
- body:
168
- errorCode: number
169
- errorCodeStr: string
170
- message: string
1
+ name: "Account Endpoints Flow"
2
+ skip_if:
3
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
4
+ base_url: "http://localhost:$var(API_PUBLIC_PORT)"
5
+ steps:
6
+ - name: "Login admin user"
7
+ retry:
8
+ attempts: 10
9
+ delay_seconds: 5
10
+ method: "POST"
11
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
12
+ send_as: "json"
13
+ body:
14
+ device: "e2e_test_device"
15
+ pseudo: "$var(DEFAULT_USERNAME)"
16
+ password: "$var(DEFAULT_PASSWORD)"
17
+ expect:
18
+ status: 200
19
+ body:
20
+ response:
21
+ token: string
22
+ projectId: string
23
+ save:
24
+ admin_token: "{{body.response.token}}"
25
+ admin_project_id: "{{body.response.projectId}}"
26
+
27
+ - name: "Generate unique test suffix"
28
+ randomize:
29
+ guest_seed_account_id: 8
30
+
31
+ - name: "Create a workspace for this flow"
32
+ method: "POST"
33
+ endpoint: "/api/v1/apiAuth/workspace"
34
+ request_headers:
35
+ - x-api-token: "{$stored.admin_token}"
36
+ send_as: "json"
37
+ body:
38
+ name: "e2e_account_ws_{$stored.guest_seed_account_id}"
39
+ description: "E2E account endpoints workspace"
40
+ projectId: "{$stored.admin_project_id}"
41
+ expect:
42
+ status: 200
43
+ body:
44
+ errorCode: number
45
+ errorCodeStr: string
46
+ message: string
47
+
48
+ - name: "Get created workspace id"
49
+ method: "GET"
50
+ endpoint: "/api/v1/apiAuth/workspace/$var(AUTH_PROJECT_NAME)/e2e_account_ws_{$stored.guest_seed_account_id}"
51
+ request_headers:
52
+ - x-api-token: "{$stored.admin_token}"
53
+ expect:
54
+ status: 200
55
+ body:
56
+ response:
57
+ id: string
58
+ save:
59
+ flow_workspace_id: "{{body.response.id}}"
60
+
61
+ - name: "Create account by workspace"
62
+ method: "POST"
63
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_account_ws_{$stored.guest_seed_account_id}/create?accountType=standard"
64
+ request_headers:
65
+ - x-api-token: "{$stored.admin_token}"
66
+ send_as: "json"
67
+ body:
68
+ username: "e2e_account_{$stored.guest_seed_account_id}"
69
+ password: "e2e_account_pwd_v1"
70
+ expect:
71
+ status: 200
72
+ body:
73
+ errorCode: number
74
+ errorCodeStr: string
75
+ message: string
76
+ response:
77
+ accountId: string
78
+ projectId: string
79
+ project: string
80
+ accountType: string
81
+ isActive: boolean
82
+ username: string
83
+ linkedWorkspaces:
84
+ - workspaceId: string
85
+ workspaceName: string
86
+ workspaceDescription: string
87
+ save:
88
+ managed_account_id: "{{body.response.accountId}}"
89
+ managed_account_username: "{{body.response.username}}"
90
+ assertions:
91
+ - "{{body.response.accountType}} == 'standard'"
92
+ - "{{body.response.isActive}} == True"
93
+ - "{{body.response.linkedWorkspaces.count()}} == 1"
94
+ - "{{body.response.linkedWorkspaces[0].workspaceName}} == 'e2e_account_ws_{$stored.guest_seed_account_id}'"
95
+
96
+ - name: "Get created account permissions"
97
+ method: "GET"
98
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/permission/{$stored.managed_account_id}"
99
+ request_headers:
100
+ - x-api-token: "{$stored.admin_token}"
101
+ expect:
102
+ status: 200
103
+ body:
104
+ errorCode: number
105
+ errorCodeStr: string
106
+ message: string
107
+ response:
108
+ accountId: string
109
+ projectId: string
110
+ assertions:
111
+ - "{{body.response.accountId}} == '{$stored.managed_account_id}'"
112
+
113
+ - name: "Update created account by workspace"
114
+ method: "POST"
115
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_account_ws_{$stored.guest_seed_account_id}/update/{$stored.managed_account_id}"
116
+ request_headers:
117
+ - x-api-token: "{$stored.admin_token}"
118
+ send_as: "json"
119
+ body:
120
+ username: "e2e_updated_{$stored.guest_seed_account_id}"
121
+ expect:
122
+ status: 200
123
+ body:
124
+ errorCode: number
125
+ errorCodeStr: string
126
+ message: string
127
+
128
+ - name: "Set created account credentials by workspace"
129
+ method: "POST"
130
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_account_ws_{$stored.guest_seed_account_id}/credentials/{$stored.managed_account_id}"
131
+ request_headers:
132
+ - x-api-token: "{$stored.admin_token}"
133
+ send_as: "json"
134
+ body:
135
+ password: "e2e_account_pwd_v2"
136
+ expect:
137
+ status: 200
138
+ body:
139
+ errorCode: number
140
+ errorCodeStr: string
141
+ message: string
142
+
143
+ - name: "Login updated account with new credentials"
144
+ method: "POST"
145
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
146
+ send_as: "json"
147
+ body:
148
+ device: "e2e_test_device"
149
+ pseudo: "e2e_updated_{$stored.guest_seed_account_id}"
150
+ password: "e2e_account_pwd_v2"
151
+ expect:
152
+ status: 200
153
+ body:
154
+ errorCode: number
155
+ errorCodeStr: string
156
+ message: string
157
+ response:
158
+ accountId: string
159
+ token: string
160
+ save:
161
+ managed_account_token: "{{body.response.token}}"
162
+ assertions:
163
+ - "{{body.response.accountId}} == '{$stored.managed_account_id}'"
164
+
165
+ - name: "Delete created account by workspace"
166
+ method: "DELETE"
167
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_account_ws_{$stored.guest_seed_account_id}/delete/{$stored.managed_account_id}"
168
+ request_headers:
169
+ - x-api-token: "{$stored.admin_token}"
170
+ expect:
171
+ status: 200
172
+ body:
173
+ errorCode: number
174
+ errorCodeStr: string
175
+ message: string
176
+
177
+ - name: "Login should fail for deleted account"
178
+ method: "POST"
179
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
180
+ send_as: "json"
181
+ body:
182
+ device: "e2e_test_device"
183
+ pseudo: "e2e_updated_{$stored.guest_seed_account_id}"
184
+ password: "e2e_account_pwd_v2"
185
+ expect:
186
+ status: 401
187
+ body:
188
+ errorCode: number
189
+ errorCodeStr: string
190
+ message: string
191
+
192
+ - name: "Cleanup: Delete the workspace created for this flow"
193
+ method: "DELETE"
194
+ endpoint: "/api/v1/apiAuth/workspace/{$stored.flow_workspace_id}"
195
+ request_headers:
196
+ - x-api-token: "{$stored.admin_token}"
197
+ expect:
198
+ status: 200
199
+ body:
200
+ errorCode: number
201
+ errorCodeStr: string
202
+ message: string
@@ -19,9 +19,11 @@ steps:
19
19
  accountId: string
20
20
  accountType: string
21
21
  token: string
22
+ projectId: string
22
23
  save:
23
24
  root_admin_token: "{{body.response.token}}"
24
25
  root_admin_account_id: "{{body.response.accountId}}"
26
+ root_admin_project_id: "{{body.response.projectId}}"
25
27
  assertions:
26
28
  - "{{body.response.accountType}} == 'root'"
27
29
 
@@ -154,11 +156,45 @@ steps:
154
156
  errorCodeStr: string
155
157
  message: string
156
158
 
159
+ - name: "Create a workspace for this flow"
160
+ skip_if:
161
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
162
+ method: "POST"
163
+ endpoint: "/api/v1/apiAuth/workspace"
164
+ request_headers:
165
+ - x-api-token: "{$stored.root_admin_token}"
166
+ send_as: "json"
167
+ body:
168
+ name: "e2e_admin_ws_{$stored.seed_account_id}"
169
+ description: "E2E admin account endpoints workspace"
170
+ projectId: "{$stored.root_admin_project_id}"
171
+ expect:
172
+ status: 200
173
+ body:
174
+ errorCode: number
175
+ errorCodeStr: string
176
+ message: string
177
+
178
+ - name: "Get created workspace id"
179
+ skip_if:
180
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
181
+ method: "GET"
182
+ endpoint: "/api/v1/apiAuth/workspace/$var(AUTH_PROJECT_NAME)/e2e_admin_ws_{$stored.seed_account_id}"
183
+ request_headers:
184
+ - x-api-token: "{$stored.root_admin_token}"
185
+ expect:
186
+ status: 200
187
+ body:
188
+ response:
189
+ id: string
190
+ save:
191
+ flow_workspace_id: "{{body.response.id}}"
192
+
157
193
  - name: "Root add workspace link"
158
194
  skip_if:
159
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
195
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
160
196
  method: "POST"
161
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/link/{$stored.admin_managed_account_id}"
197
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_admin_ws_{$stored.seed_account_id}/link/{$stored.admin_managed_account_id}"
162
198
  request_headers:
163
199
  - x-api-token: "{$stored.root_admin_token}"
164
200
  expect:
@@ -170,9 +206,9 @@ steps:
170
206
 
171
207
  - name: "Root remove workspace link"
172
208
  skip_if:
173
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
209
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
174
210
  method: "DELETE"
175
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/link/{$stored.admin_managed_account_id}"
211
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_admin_ws_{$stored.seed_account_id}/link/{$stored.admin_managed_account_id}"
176
212
  request_headers:
177
213
  - x-api-token: "{$stored.root_admin_token}"
178
214
  expect:
@@ -635,3 +671,17 @@ steps:
635
671
  errorCode: number
636
672
  errorCodeStr: string
637
673
  message: string
674
+
675
+ - name: "Cleanup: Delete the workspace created for this flow"
676
+ skip_if:
677
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
678
+ method: "DELETE"
679
+ endpoint: "/api/v1/apiAuth/workspace/{$stored.flow_workspace_id}"
680
+ request_headers:
681
+ - x-api-token: "{$stored.root_admin_token}"
682
+ expect:
683
+ status: 200
684
+ body:
685
+ errorCode: number
686
+ errorCodeStr: string
687
+ message: string
@@ -220,7 +220,7 @@ steps:
220
220
 
221
221
  - name: "Standard account cannot get workspace without projects permission"
222
222
  method: "GET"
223
- endpoint: "/api/v1/apiAuth/workspace/$var(AUTH_PROJECT_NAME)/$var(DEFAULT_WORKSPACE_NAME)"
223
+ endpoint: "/api/v1/apiAuth/workspace/$var(AUTH_PROJECT_NAME)/e2e_workspace_updated_{$stored.seed_account_id}"
224
224
  request_headers:
225
225
  - x-api-token: "{$stored.std_token}"
226
226
  expect:
@@ -19,18 +19,88 @@ steps:
19
19
  body:
20
20
  response:
21
21
  token: string
22
+ accountId: string
23
+ projectId: string
22
24
  save:
23
25
  admin_token: "{{body.response.token}}"
26
+ admin_account_id: "{{body.response.accountId}}"
27
+ admin_project_id: "{{body.response.projectId}}"
24
28
 
25
29
  - name: "Generate unique test suffix"
26
30
  randomize:
27
31
  seed_account_id: 8
28
32
 
33
+ - name: "Create a workspace for this flow"
34
+ skip_if:
35
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
36
+ method: "POST"
37
+ endpoint: "/api/v1/apiAuth/workspace"
38
+ request_headers:
39
+ - x-api-token: "{$stored.admin_token}"
40
+ send_as: "json"
41
+ body:
42
+ name: "e2e_apikey_ws_{$stored.seed_account_id}"
43
+ description: "E2E API key endpoints workspace"
44
+ projectId: "{$stored.admin_project_id}"
45
+ expect:
46
+ status: 200
47
+ body:
48
+ errorCode: number
49
+ errorCodeStr: string
50
+ message: string
51
+
52
+ - name: "Get created workspace id"
53
+ skip_if:
54
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
55
+ method: "GET"
56
+ endpoint: "/api/v1/apiAuth/workspace/$var(AUTH_PROJECT_NAME)/e2e_apikey_ws_{$stored.seed_account_id}"
57
+ request_headers:
58
+ - x-api-token: "{$stored.admin_token}"
59
+ expect:
60
+ status: 200
61
+ body:
62
+ response:
63
+ id: string
64
+ save:
65
+ flow_workspace_id: "{{body.response.id}}"
66
+
67
+ # Creating workspace-scoped resources is allowed for root regardless of workspace links, but
68
+ # listing them (ValidateWorkspaceLink) is not - root must actually be linked to the workspace it
69
+ # just created, and the existing admin_token's cached metadata won't reflect a link added after
70
+ # the fact, so a fresh login is required to pick it up.
71
+ - name: "Link admin account to the created workspace"
72
+ skip_if:
73
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
74
+ method: "POST"
75
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_apikey_ws_{$stored.seed_account_id}/link/{$stored.admin_account_id}"
76
+ request_headers:
77
+ - x-api-token: "{$stored.admin_token}"
78
+ expect:
79
+ status: 200
80
+
81
+ - name: "Re-login root admin to refresh workspace metadata"
82
+ skip_if:
83
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
84
+ method: "POST"
85
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
86
+ send_as: "json"
87
+ body:
88
+ device: "e2e_test_device"
89
+ pseudo: "$var(DEFAULT_USERNAME)"
90
+ password: "$var(DEFAULT_PASSWORD)"
91
+ expect:
92
+ status: 200
93
+ body:
94
+ response:
95
+ token: string
96
+ save:
97
+ admin_token: "{{body.response.token}}"
98
+
29
99
  - name: "Create API key at workspace level"
30
100
  skip_if:
31
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
101
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
32
102
  method: "POST"
33
- endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/create"
103
+ endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/e2e_apikey_ws_{$stored.seed_account_id}/create"
34
104
  request_headers:
35
105
  - x-api-token: "{$stored.admin_token}"
36
106
  send_as: "json"
@@ -59,9 +129,9 @@ steps:
59
129
 
60
130
  - name: "List API keys by workspace"
61
131
  skip_if:
62
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
132
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
63
133
  method: "GET"
64
- endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/list?begin=0&count=10"
134
+ endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/e2e_apikey_ws_{$stored.seed_account_id}/list?begin=0&count=10"
65
135
  request_headers:
66
136
  - x-api-token: "{$stored.admin_token}"
67
137
  expect:
@@ -84,7 +154,7 @@ steps:
84
154
 
85
155
  - name: "Get API key details"
86
156
  skip_if:
87
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
157
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
88
158
  method: "GET"
89
159
  endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/info/{$stored.ws_apikey_value}"
90
160
  request_headers:
@@ -200,9 +270,9 @@ steps:
200
270
 
201
271
  - name: "Limited admin cannot list API keys without PermApiKeys"
202
272
  skip_if:
203
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
273
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
204
274
  method: "GET"
205
- endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/list?begin=0&count=10"
275
+ endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/e2e_apikey_ws_{$stored.seed_account_id}/list?begin=0&count=10"
206
276
  request_headers:
207
277
  - x-api-token: "{$stored.limited_admin_token}"
208
278
  expect:
@@ -210,9 +280,9 @@ steps:
210
280
 
211
281
  - name: "Limited admin cannot create API key without PermApiKeys"
212
282
  skip_if:
213
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
283
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
214
284
  method: "POST"
215
- endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/create"
285
+ endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/e2e_apikey_ws_{$stored.seed_account_id}/create"
216
286
  request_headers:
217
287
  - x-api-token: "{$stored.limited_admin_token}"
218
288
  send_as: "json"
@@ -223,7 +293,7 @@ steps:
223
293
 
224
294
  - name: "Limited admin cannot get API key info without PermApiKeys"
225
295
  skip_if:
226
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
296
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
227
297
  method: "GET"
228
298
  endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/info/{$stored.ws_apikey_value}"
229
299
  request_headers:
@@ -268,9 +338,9 @@ steps:
268
338
 
269
339
  - name: "link limited admin to test workspace"
270
340
  skip_if:
271
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
341
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
272
342
  method: "POST"
273
- endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/link/{$stored.limited_admin_id}"
343
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_apikey_ws_{$stored.seed_account_id}/link/{$stored.limited_admin_id}"
274
344
  request_headers:
275
345
  - x-api-token: "{$stored.admin_token}"
276
346
  expect:
@@ -294,9 +364,9 @@ steps:
294
364
 
295
365
  - name: "Limited admin can list API keys by workspace with PermApiKeys"
296
366
  skip_if:
297
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
367
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
298
368
  method: "GET"
299
- endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/$var(DEFAULT_WORKSPACE_NAME)/list?begin=0&count=10"
369
+ endpoint: "/api/v1/apiAuth/apiKey/$var(AUTH_PROJECT_NAME)/workspace/e2e_apikey_ws_{$stored.seed_account_id}/list?begin=0&count=10"
300
370
  request_headers:
301
371
  - x-api-token: "{$stored.limited_admin_token}"
302
372
  expect:
@@ -354,7 +424,7 @@ steps:
354
424
 
355
425
  - name: "Cleanup: Delete workspace API key account"
356
426
  skip_if:
357
- - "'$var(DEFAULT_WORKSPACE_NAME)' == ''"
427
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
358
428
  method: "DELETE"
359
429
  endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/delete/{$stored.ws_apikey_account_id}"
360
430
  request_headers:
@@ -377,3 +447,23 @@ steps:
377
447
  - x-api-token: "{$stored.admin_token}"
378
448
  expect:
379
449
  status: 200
450
+
451
+ - name: "Cleanup: Unlink admin account from the workspace created for this flow"
452
+ skip_if:
453
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
454
+ method: "DELETE"
455
+ endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/workspace/e2e_apikey_ws_{$stored.seed_account_id}/link/{$stored.admin_account_id}"
456
+ request_headers:
457
+ - x-api-token: "{$stored.admin_token}"
458
+ expect:
459
+ status: 200
460
+
461
+ - name: "Cleanup: Delete the workspace created for this flow"
462
+ skip_if:
463
+ - "Workspaces not in {$stored.0_check_features.enabled_features}"
464
+ method: "DELETE"
465
+ endpoint: "/api/v1/apiAuth/workspace/{$stored.flow_workspace_id}"
466
+ request_headers:
467
+ - x-api-token: "{$stored.admin_token}"
468
+ expect:
469
+ status: 200
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sefrone_api_e2e
3
- Version: 1.4.0
3
+ Version: 1.4.1
4
4
  Summary: A Python package to provide e2e testing helpers for sefrone API projects
5
5
  Home-page: https://bitbucket.org/sefrone/sefrone_pypi
6
6
  Author: Sefrone
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="sefrone_api_e2e",
8
- version="1.4.0",
8
+ version="1.4.1",
9
9
  author="Sefrone",
10
10
  author_email="contact@sefrone.com",
11
11
  description="A Python package to provide e2e testing helpers for sefrone API projects",