@camunda/e2e-test-suite 0.0.1306 → 0.0.1308
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.
- package/dist/pages/8.8/ConnectorSettingsPage.js +7 -1
- package/dist/pages/8.8/ModelerHomePage.js +7 -0
- package/dist/pages/8.8/OCIdentityRolesPage.js +10 -1
- package/dist/pages/8.8/UtilitiesPage.js +12 -3
- package/dist/pages/8.8/WorkspaceMembersPage.js +14 -18
- package/dist/tests/8.8/access-user-role-management.spec.js +10 -13
- package/dist/tests/8.8/rba-enabled-v1-user-flows.spec.js +9 -2
- package/dist/tests/8.8/rba-enabled-v2-user-flows.spec.js +2 -2
- package/dist/tests/8.8/utr-enabled-user-flows.spec.js +3 -6
- package/dist/tests/api/components/connectors-api-tests.spec.d.ts +10 -0
- package/dist/tests/api/components/connectors-api-tests.spec.js +30 -0
- package/dist/tests/api/components/console-api-tests.spec.d.ts +8 -0
- package/dist/tests/api/components/console-api-tests.spec.js +30 -0
- package/dist/tests/api/components/identity-api-tests.spec.d.ts +9 -0
- package/dist/tests/api/components/identity-api-tests.spec.js +49 -0
- package/dist/tests/api/components/web-modeler-api-tests.spec.d.ts +11 -0
- package/dist/tests/api/components/web-modeler-api-tests.spec.js +56 -0
- package/dist/tests/api/grpc/grpc-api-tests.spec.d.ts +11 -0
- package/dist/tests/api/grpc/grpc-api-tests.spec.js +62 -0
- package/dist/utils/api/capabilities.d.ts +22 -0
- package/dist/utils/api/capabilities.js +46 -1
- package/dist/utils/api/config.d.ts +20 -0
- package/dist/utils/api/config.js +10 -0
- package/dist/utils/api/grpc.d.ts +9 -0
- package/dist/utils/api/grpc.js +37 -0
- package/dist/utils/hubResourceRename.js +13 -3
- package/package.json +1 -1
|
@@ -20,7 +20,13 @@ class ConnectorSettingsPage {
|
|
|
20
20
|
inputTab;
|
|
21
21
|
constructor(page) {
|
|
22
22
|
this.page = page;
|
|
23
|
-
|
|
23
|
+
// Scoped to the properties panel: getByLabel matches on a substring, so
|
|
24
|
+
// page-wide it also resolves the breadcrumb's "<diagram name> actions"
|
|
25
|
+
// button whenever the diagram name happens to contain "url" -- a strict
|
|
26
|
+
// mode violation that has nothing to do with this field.
|
|
27
|
+
this.urlInput = page
|
|
28
|
+
.locator('[data-test="properties-panel"]')
|
|
29
|
+
.getByLabel('URL');
|
|
24
30
|
this.resultExpressionInput = page.getByRole('textbox', {
|
|
25
31
|
name: /^Result expression$/,
|
|
26
32
|
});
|
|
@@ -733,6 +733,13 @@ class ModelerHomePage {
|
|
|
733
733
|
return;
|
|
734
734
|
}
|
|
735
735
|
await this.clickWorkspaceDiagramTypeDropdown();
|
|
736
|
+
// A click that lands while the toolbar is still settling leaves the menu
|
|
737
|
+
// closed, and the option then never appears however long it is waited
|
|
738
|
+
// for. Re-open once instead of spending the option's full 60s budget on a
|
|
739
|
+
// menu that is not there.
|
|
740
|
+
if (!(await this.becameVisible(this.processApplicationPage.createProcessApplicationOption, 15000))) {
|
|
741
|
+
await this.clickWorkspaceDiagramTypeDropdown();
|
|
742
|
+
}
|
|
736
743
|
await this.processApplicationPage.clickCreateProcessApplicationOption();
|
|
737
744
|
}
|
|
738
745
|
// Re-enters this test's container if it already has one, without creating
|
|
@@ -138,7 +138,16 @@ class OCIdentityRolesPage {
|
|
|
138
138
|
await this.createIdField.fill(role.id);
|
|
139
139
|
await this.createNameField.fill(role.name);
|
|
140
140
|
await this.createRoleModalCreateButton.click();
|
|
141
|
-
|
|
141
|
+
try {
|
|
142
|
+
await (0, test_1.expect)(this.createRoleModal).not.toBeVisible({ timeout: 30000 });
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// Same drop as in doAssignUserToRole: a Create click that lands while
|
|
146
|
+
// the modal is still mid-render is swallowed, leaving the modal open
|
|
147
|
+
// with no error surfaced. Re-click Create once before failing.
|
|
148
|
+
await this.createRoleModalCreateButton.click();
|
|
149
|
+
await (0, test_1.expect)(this.createRoleModal).not.toBeVisible({ timeout: 30000 });
|
|
150
|
+
}
|
|
142
151
|
await (0, expectLocatorWithPagination_1.expectLocatorWithPagination)(this.page, this.rolesList
|
|
143
152
|
.getByRole('cell', {
|
|
144
153
|
name: role.name,
|
|
@@ -470,9 +470,18 @@ async function assertTestUsesCorrectOrganization(page) {
|
|
|
470
470
|
// once its SPA has booted, and on CI runners that boot alone was measured
|
|
471
471
|
// at ~45s past /login-callback -- a 30s wait aborted the exchange on every
|
|
472
472
|
// attempt. Ported from the already-verified 8.9/8.10 fix.
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
473
|
+
// Read the URL rather than waiting on the navigation: waitForURL waits
|
|
474
|
+
// for the `load` event, and Hub's SPA routinely starts the next
|
|
475
|
+
// navigation while the callback's load is still in flight, so Chromium
|
|
476
|
+
// reports the abandoned one as `net::ERR_ABORTED; maybe frame was
|
|
477
|
+
// detached?` even though the code exchange itself completes. That abort
|
|
478
|
+
// is not the rate-limit marker loginWithRetry backs off on, so it burned
|
|
479
|
+
// all five attempts -- 133 times across the setup project in CI run
|
|
480
|
+
// 36722117210. Polling the URL is the condition actually being waited
|
|
481
|
+
// for and cannot be aborted by a navigation.
|
|
482
|
+
await test_1.expect
|
|
483
|
+
.poll(() => page.url().includes('?code='), { timeout: 120000 })
|
|
484
|
+
.toBe(false);
|
|
476
485
|
await (0, sleep_1.sleep)(5000);
|
|
477
486
|
}
|
|
478
487
|
if (page.url().includes('modeler')) {
|
|
@@ -140,22 +140,13 @@ class WorkspaceMembersPage {
|
|
|
140
140
|
.getByRole('option', { name: new RegExp(escapeRegExp(email), 'i') })
|
|
141
141
|
.or(this.page.locator('[cmdk-item]').filter({ hasText: email }))
|
|
142
142
|
.first();
|
|
143
|
-
// The result list is a multi-select
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
// so
|
|
148
|
-
// sets cmdk's highlight -- aria-selected and data-selected both read
|
|
149
|
-
// "true" while data-staged stays "false" and "Add" stays disabled.
|
|
150
|
-
// Click the leading svg, which is the box itself, and gate on the one
|
|
151
|
-
// attribute that actually tracks the pick.
|
|
143
|
+
// The result list is a multi-select whose rows are cmdk items, not
|
|
144
|
+
// checkbox elements, so getByRole('checkbox') matches nothing. A row
|
|
145
|
+
// click only moves cmdk's highlight: aria-selected and data-selected
|
|
146
|
+
// both read "true" while the row is still unstaged and "Add" stays
|
|
147
|
+
// disabled, so neither is usable as the gate.
|
|
152
148
|
await (0, test_1.expect)(result).toBeVisible({ timeout: 30000 });
|
|
153
|
-
//
|
|
154
|
-
// is a decorative svg the design system gives `pointer-events: none`, so
|
|
155
|
-
// that click lands on the row, and a row click only moves cmdk's
|
|
156
|
-
// highlight -- across three live runs `data-staged` never left "false"
|
|
157
|
-
// while `aria-selected` read "true" and "Add" stayed disabled. The
|
|
158
|
-
// list's "Select all" control is what actually stages. It is a
|
|
149
|
+
// The list's "Select all" control is what actually stages. It is a
|
|
159
150
|
// <button data-test="members-picker-select-all">, not a cmdk item, and
|
|
160
151
|
// its label is split across text nodes ("Select all (", "1", ")"), so it
|
|
161
152
|
// is addressed by its test id. The search box above has already been
|
|
@@ -168,9 +159,14 @@ class WorkspaceMembersPage {
|
|
|
168
159
|
await this.page
|
|
169
160
|
.locator('[data-test="members-picker-select-all"]')
|
|
170
161
|
.click({ timeout: 15000 });
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
162
|
+
// The staged flag moved: hub #29735 dropped the bespoke `data-staged`
|
|
163
|
+
// attribute (and the decorative svg box next to it) in favour of the
|
|
164
|
+
// design system's `checked` prop, which renders `aria-checked`. Accept
|
|
165
|
+
// either so this holds against builds from before and after that change.
|
|
166
|
+
await test_1.expect
|
|
167
|
+
.poll(async () => (await result.getAttribute('aria-checked')) === 'true' ||
|
|
168
|
+
(await result.getAttribute('data-staged')) === 'true', { timeout: 15000 })
|
|
169
|
+
.toBe(true);
|
|
174
170
|
if (role !== 'Editor') {
|
|
175
171
|
await this.selectRoleIn(this.page.getByRole('combobox', { name: 'Workspace role' }).first(), role);
|
|
176
172
|
}
|
|
@@ -87,11 +87,10 @@ _8_8_1.test.describe('User Roles User Flow', () => {
|
|
|
87
87
|
await (0, resetSession_1.resetSessionAll)(context, page);
|
|
88
88
|
});
|
|
89
89
|
await _8_8_1.test.step('Log in as test user', async () => {
|
|
90
|
-
|
|
91
|
-
await loginPage.loginWithTestUser({
|
|
90
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, new LoginPage_1.LoginPage(page), {
|
|
92
91
|
username: process.env.C8_USERNAME_TEST_8,
|
|
93
92
|
password: process.env.C8_PASSWORD_TEST_8,
|
|
94
|
-
});
|
|
93
|
+
}, 1000);
|
|
95
94
|
await (0, sleep_1.sleep)(600000); //wait for Optimize cache to refresh
|
|
96
95
|
});
|
|
97
96
|
await _8_8_1.test.step('Navigate to Console and Ensure Apps are Available in App Switcher', async () => {
|
|
@@ -197,11 +196,10 @@ _8_8_1.test.describe('User Roles User Flow', () => {
|
|
|
197
196
|
await (0, resetSession_1.resetSession)(browser, page);
|
|
198
197
|
});
|
|
199
198
|
await _8_8_1.test.step('Log in as test user', async () => {
|
|
200
|
-
|
|
201
|
-
await loginPage.loginWithTestUser({
|
|
199
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, new LoginPage_1.LoginPage(page), {
|
|
202
200
|
username: process.env.C8_USERNAME_TEST_9,
|
|
203
201
|
password: process.env.C8_PASSWORD_TEST_9,
|
|
204
|
-
});
|
|
202
|
+
}, 1000);
|
|
205
203
|
});
|
|
206
204
|
// An organization role no longer decides on its own what a non-admin can
|
|
207
205
|
// reach. Since camunda-hub's environments work (pdp-3443, pdp-3715), a
|
|
@@ -255,10 +253,10 @@ _8_8_1.test.describe('User Roles User Flow', () => {
|
|
|
255
253
|
// switches to the main user and back rather than doing it as the
|
|
256
254
|
// analyst under test.
|
|
257
255
|
await (0, resetSession_1.resetSession)(browser, page);
|
|
258
|
-
await new LoginPage_1.LoginPage(page)
|
|
256
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, new LoginPage_1.LoginPage(page), {
|
|
259
257
|
username: process.env.C8_USERNAME,
|
|
260
258
|
password: process.env.C8_PASSWORD,
|
|
261
|
-
});
|
|
259
|
+
}, 1000);
|
|
262
260
|
const workspaceMembersPage = new WorkspaceMembersPage_1.WorkspaceMembersPage(page);
|
|
263
261
|
await workspaceMembersPage.openManageMembers(analystWorkspaceName);
|
|
264
262
|
// Flagged before the grant, not after: a failure partway through
|
|
@@ -275,10 +273,10 @@ _8_8_1.test.describe('User Roles User Flow', () => {
|
|
|
275
273
|
// button "Analyst Role Cluster").
|
|
276
274
|
await (0, consoleApiHelpers_1.linkClusterToWorkspaceViaApi)(page, workspaceMembersPage.workspaceId(), clusterName);
|
|
277
275
|
await (0, resetSession_1.resetSession)(browser, page);
|
|
278
|
-
await new LoginPage_1.LoginPage(page)
|
|
276
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, new LoginPage_1.LoginPage(page), {
|
|
279
277
|
username: process.env.C8_USERNAME_TEST_9,
|
|
280
278
|
password: process.env.C8_PASSWORD_TEST_9,
|
|
281
|
-
});
|
|
279
|
+
}, 1000);
|
|
282
280
|
});
|
|
283
281
|
await _8_8_1.test.step('Wait for the role change to reach Optimize', async () => {
|
|
284
282
|
// Replaces a blind `sleep(600000)`. The role change only takes effect in
|
|
@@ -391,11 +389,10 @@ _8_8_1.test.describe('User Roles User Flow', () => {
|
|
|
391
389
|
await (0, resetSession_1.resetSession)(browser, page);
|
|
392
390
|
});
|
|
393
391
|
await _8_8_1.test.step('Log in as test user', async () => {
|
|
394
|
-
|
|
395
|
-
await loginPage.loginWithTestUser({
|
|
392
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, new LoginPage_1.LoginPage(page), {
|
|
396
393
|
username: process.env.C8_USERNAME_TEST_10,
|
|
397
394
|
password: process.env.C8_PASSWORD_TEST_10,
|
|
398
|
-
});
|
|
395
|
+
}, 1000);
|
|
399
396
|
});
|
|
400
397
|
await _8_8_1.test.step('Wait for the role change to reach Optimize', async () => {
|
|
401
398
|
// Replaces a blind `sleep(600000)`. The role change only takes effect in
|
|
@@ -125,8 +125,15 @@ _8_8_1.test.describe.parallel('RBA Enabled User Flows Test @tasklistV1', () => {
|
|
|
125
125
|
await _8_8_1.test.step('Navigate to Tasklist and Make Sure that the Two Deployed Processes Are Accessible', async () => {
|
|
126
126
|
await appsPage.clickCamundaApps();
|
|
127
127
|
await appsPage.clickTasklist(clusterName);
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
// A single 30s wait is not enough here: Tasklist is entered right after
|
|
129
|
+
// a mid-test re-login, and the first load can land before the app has
|
|
130
|
+
// rendered its banner. Reload between attempts, as the sibling step
|
|
131
|
+
// below already does.
|
|
132
|
+
await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, taskPanelPage.taskListPageBanner, {
|
|
133
|
+
visibilityTimeout: 20000,
|
|
134
|
+
postAction: async () => {
|
|
135
|
+
await page.reload();
|
|
136
|
+
},
|
|
130
137
|
});
|
|
131
138
|
await taskPanelPage.clickProcessesTab();
|
|
132
139
|
await taskProcessesPage.clickpopupContinueButton();
|
|
@@ -127,7 +127,7 @@ _8_8_1.test.describe.parallel('RBA Enabled User Flows Test @tasklistV2', () => {
|
|
|
127
127
|
await page.goto('/');
|
|
128
128
|
await settingsPage.clickOpenSettingsButton();
|
|
129
129
|
await settingsPage.clickLogoutButton();
|
|
130
|
-
await
|
|
130
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, 1000);
|
|
131
131
|
});
|
|
132
132
|
await _8_8_1.test.step('Navigate to Tasklist and Make Sure that the Two Deployed Processes Are Not Accessible', async () => {
|
|
133
133
|
await appsPage.clickCamundaApps();
|
|
@@ -244,7 +244,7 @@ _8_8_1.test.describe.parallel('RBA Enabled User Flows Test @tasklistV2', () => {
|
|
|
244
244
|
await page.goto('/');
|
|
245
245
|
await settingsPage.clickOpenSettingsButton();
|
|
246
246
|
await settingsPage.clickLogoutButton();
|
|
247
|
-
await
|
|
247
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, 1000);
|
|
248
248
|
});
|
|
249
249
|
await _8_8_1.test.step('Navigate to Tasklist and Only First Process Is Accessible', async () => {
|
|
250
250
|
await appsPage.clickCamundaApps();
|
|
@@ -83,8 +83,7 @@ _8_8_1.test.describe.parallel('UTR Enabled User Flows Test @tasklistV1', () => {
|
|
|
83
83
|
await page.goto('/');
|
|
84
84
|
});
|
|
85
85
|
await _8_8_1.test.step('Login with Test User and Check Tasks in Tasklist ', async () => {
|
|
86
|
-
|
|
87
|
-
await loginPage.loginWithTestUser(testUser);
|
|
86
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, new LoginPage_1.LoginPage(page), testUser, 1000);
|
|
88
87
|
await appsPage.clickCamundaApps();
|
|
89
88
|
await appsPage.clickTasklist(clusterName);
|
|
90
89
|
await (0, test_1.expect)(taskPanelPage.taskListPageBanner).toBeVisible({
|
|
@@ -203,8 +202,7 @@ _8_8_1.test.describe.parallel('UTR Enabled User Flows Test @tasklistV1', () => {
|
|
|
203
202
|
await page.goto('/');
|
|
204
203
|
});
|
|
205
204
|
await _8_8_1.test.step('Login with Test User and Check Tasks in Tasklist ', async () => {
|
|
206
|
-
|
|
207
|
-
await loginPage.loginWithTestUser(testUser1);
|
|
205
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, new LoginPage_1.LoginPage(page), testUser1, 1000);
|
|
208
206
|
await appsPage.clickCamundaApps();
|
|
209
207
|
await appsPage.clickTasklist(clusterName);
|
|
210
208
|
await (0, test_1.expect)(taskPanelPage.taskListPageBanner).toBeVisible({
|
|
@@ -228,8 +226,7 @@ _8_8_1.test.describe.parallel('UTR Enabled User Flows Test @tasklistV1', () => {
|
|
|
228
226
|
await page.goto('/');
|
|
229
227
|
});
|
|
230
228
|
await _8_8_1.test.step('Login with Second Test User and Check Tasks in Tasklist ', async () => {
|
|
231
|
-
|
|
232
|
-
await loginPage.loginWithTestUser(testUser2);
|
|
229
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, new LoginPage_1.LoginPage(page), testUser2, 1000);
|
|
233
230
|
await appsPage.clickCamundaApps();
|
|
234
231
|
await appsPage.clickTasklist(clusterName);
|
|
235
232
|
await (0, test_1.expect)(taskPanelPage.taskListPageBanner).toBeVisible({
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Connectors runtime's HTTP endpoints, reached through the ingress.
|
|
3
|
+
*
|
|
4
|
+
* The self-managed bundle leaves `/inbound` and the actuator open (only
|
|
5
|
+
* `/configurations/**` is secured), so these calls carry no credentials. They
|
|
6
|
+
* prove the route and that the runtime is up and serving its inbound
|
|
7
|
+
* registry; connector behaviour is tested in camunda/connectors and in the
|
|
8
|
+
* browser suites' connector flows.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The Connectors runtime's HTTP endpoints, reached through the ingress.
|
|
4
|
+
*
|
|
5
|
+
* The self-managed bundle leaves `/inbound` and the actuator open (only
|
|
6
|
+
* `/configurations/**` is secured), so these calls carry no credentials. They
|
|
7
|
+
* prove the route and that the runtime is up and serving its inbound
|
|
8
|
+
* registry; connector behaviour is tested in camunda/connectors and in the
|
|
9
|
+
* browser suites' connector flows.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const api_1 = require("../../../fixtures/api");
|
|
13
|
+
const test_1 = require("@playwright/test");
|
|
14
|
+
const capabilities_1 = require("../../../utils/api/capabilities");
|
|
15
|
+
const config_1 = require("../../../utils/api/config");
|
|
16
|
+
const base = config_1.apiConfig.components.connectors;
|
|
17
|
+
api_1.test.describe('Connectors runtime API', () => {
|
|
18
|
+
const unavailable = (0, capabilities_1.componentUnavailable)('connectors');
|
|
19
|
+
api_1.test.skip(!!unavailable, unavailable || '');
|
|
20
|
+
(0, api_1.test)('reports itself healthy', async ({ request }) => {
|
|
21
|
+
const response = await request.get(`${base}/actuator/health`);
|
|
22
|
+
(0, test_1.expect)(response.status()).toBe(200);
|
|
23
|
+
(0, test_1.expect)(await response.json()).toMatchObject({ status: 'UP' });
|
|
24
|
+
});
|
|
25
|
+
(0, api_1.test)('lists active inbound connectors', async ({ request }) => {
|
|
26
|
+
const response = await request.get(`${base}/inbound`);
|
|
27
|
+
(0, test_1.expect)(response.status()).toBe(200);
|
|
28
|
+
(0, test_1.expect)(Array.isArray(await response.json())).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Console Self-Managed's Administration API (`/admin-api`), 8.8 and 8.9 only.
|
|
3
|
+
*
|
|
4
|
+
* The API checks the token's issuer and the `console-api` audience, nothing
|
|
5
|
+
* else, so a listing plus the refusal of an anonymous call covers what a Helm
|
|
6
|
+
* deployment decides: the route and the audience wiring.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Console Self-Managed's Administration API (`/admin-api`), 8.8 and 8.9 only.
|
|
4
|
+
*
|
|
5
|
+
* The API checks the token's issuer and the `console-api` audience, nothing
|
|
6
|
+
* else, so a listing plus the refusal of an anonymous call covers what a Helm
|
|
7
|
+
* deployment decides: the route and the audience wiring.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const api_1 = require("../../../fixtures/api");
|
|
11
|
+
const test_1 = require("@playwright/test");
|
|
12
|
+
const auth_1 = require("../../../utils/api/auth");
|
|
13
|
+
const capabilities_1 = require("../../../utils/api/capabilities");
|
|
14
|
+
const config_1 = require("../../../utils/api/config");
|
|
15
|
+
const base = config_1.apiConfig.components.console;
|
|
16
|
+
api_1.test.describe('Console Administration API', () => {
|
|
17
|
+
const unavailable = (0, capabilities_1.componentUnavailable)('console');
|
|
18
|
+
api_1.test.skip(!!unavailable, unavailable || '');
|
|
19
|
+
(0, api_1.test)('lists clusters', async ({ request }) => {
|
|
20
|
+
const response = await request.get(`${base}/admin-api/clusters`, {
|
|
21
|
+
headers: { Authorization: await (0, auth_1.authHeader)(request) },
|
|
22
|
+
});
|
|
23
|
+
(0, test_1.expect)(response.status()).toBe(200);
|
|
24
|
+
(0, test_1.expect)(Array.isArray(await response.json())).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
(0, api_1.test)('refuses a request without a token', async ({ request }) => {
|
|
27
|
+
const response = await request.get(`${base}/admin-api/clusters`);
|
|
28
|
+
(0, test_1.expect)(response.status()).toBe(401);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Management Identity's API (`/identity/api`), reached through the ingress
|
|
3
|
+
* with the suite's client-credentials token.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately thin: it proves the route, the token audience
|
|
6
|
+
* (`camunda-identity-resource-server`) and one write, which is what a Helm
|
|
7
|
+
* deployment can get wrong. Identity's own behaviour is tested in its repo.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Management Identity's API (`/identity/api`), reached through the ingress
|
|
4
|
+
* with the suite's client-credentials token.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately thin: it proves the route, the token audience
|
|
7
|
+
* (`camunda-identity-resource-server`) and one write, which is what a Helm
|
|
8
|
+
* deployment can get wrong. Identity's own behaviour is tested in its repo.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
const api_1 = require("../../../fixtures/api");
|
|
12
|
+
const test_1 = require("@playwright/test");
|
|
13
|
+
const auth_1 = require("../../../utils/api/auth");
|
|
14
|
+
const bpmn_1 = require("../../../utils/api/bpmn");
|
|
15
|
+
const capabilities_1 = require("../../../utils/api/capabilities");
|
|
16
|
+
const config_1 = require("../../../utils/api/config");
|
|
17
|
+
const base = config_1.apiConfig.components.identity;
|
|
18
|
+
api_1.test.describe('Management Identity API', () => {
|
|
19
|
+
const unavailable = (0, capabilities_1.componentUnavailable)('identity');
|
|
20
|
+
api_1.test.skip(!!unavailable, unavailable || '');
|
|
21
|
+
(0, api_1.test)('lists roles', async ({ request }) => {
|
|
22
|
+
const response = await request.get(`${base}/api/roles`, {
|
|
23
|
+
headers: { Authorization: await (0, auth_1.authHeader)(request) },
|
|
24
|
+
});
|
|
25
|
+
(0, test_1.expect)(response.status()).toBe(200);
|
|
26
|
+
(0, test_1.expect)(Array.isArray(await response.json())).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
(0, api_1.test)('creates and deletes a role', async ({ request }) => {
|
|
29
|
+
const headers = { Authorization: await (0, auth_1.authHeader)(request) };
|
|
30
|
+
const name = (0, bpmn_1.uniqueId)('api-smoke-role');
|
|
31
|
+
const created = await request.post(`${base}/api/roles`, {
|
|
32
|
+
headers,
|
|
33
|
+
data: { name, description: 'Created by the API smoke test' },
|
|
34
|
+
});
|
|
35
|
+
(0, test_1.expect)(created.status()).toBe(204);
|
|
36
|
+
try {
|
|
37
|
+
const roles = (await (await request.get(`${base}/api/roles`, { headers })).json());
|
|
38
|
+
(0, test_1.expect)(roles.map((role) => role.name)).toContain(name);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
const deleted = await request.delete(`${base}/api/roles/${encodeURIComponent(name)}`, { headers });
|
|
42
|
+
(0, test_1.expect)(deleted.status()).toBe(204);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
(0, api_1.test)('refuses a request without a token', async ({ request }) => {
|
|
46
|
+
const response = await request.get(`${base}/api/roles`);
|
|
47
|
+
(0, test_1.expect)(response.status()).toBe(401);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Web Modeler public API (`/modeler/api/v1`, served by Camunda Hub from
|
|
3
|
+
* 8.10), 8.9 onwards.
|
|
4
|
+
*
|
|
5
|
+
* The token must carry the `web-modeler-public-api` audience with the
|
|
6
|
+
* matching `read:*`, `create:*` and `delete:*` permissions; the internal
|
|
7
|
+
* `web-modeler-api` audience is not enough. The API's own behaviour is
|
|
8
|
+
* covered in camunda/camunda-hub; this proves the route, the audience and one
|
|
9
|
+
* write through a Helm deployment.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The Web Modeler public API (`/modeler/api/v1`, served by Camunda Hub from
|
|
4
|
+
* 8.10), 8.9 onwards.
|
|
5
|
+
*
|
|
6
|
+
* The token must carry the `web-modeler-public-api` audience with the
|
|
7
|
+
* matching `read:*`, `create:*` and `delete:*` permissions; the internal
|
|
8
|
+
* `web-modeler-api` audience is not enough. The API's own behaviour is
|
|
9
|
+
* covered in camunda/camunda-hub; this proves the route, the audience and one
|
|
10
|
+
* write through a Helm deployment.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
const api_1 = require("../../../fixtures/api");
|
|
14
|
+
const test_1 = require("@playwright/test");
|
|
15
|
+
const auth_1 = require("../../../utils/api/auth");
|
|
16
|
+
const bpmn_1 = require("../../../utils/api/bpmn");
|
|
17
|
+
const capabilities_1 = require("../../../utils/api/capabilities");
|
|
18
|
+
const config_1 = require("../../../utils/api/config");
|
|
19
|
+
const base = config_1.apiConfig.components.webModeler;
|
|
20
|
+
api_1.test.describe('Web Modeler public API', () => {
|
|
21
|
+
const unavailable = (0, capabilities_1.componentUnavailable)('webModeler');
|
|
22
|
+
api_1.test.skip(!!unavailable, unavailable || '');
|
|
23
|
+
(0, api_1.test)('describes the API to an authenticated caller', async ({ request }) => {
|
|
24
|
+
const response = await request.get(`${base}/api/v1/info`, {
|
|
25
|
+
headers: { Authorization: await (0, auth_1.authHeader)(request) },
|
|
26
|
+
});
|
|
27
|
+
(0, test_1.expect)(response.status()).toBe(200);
|
|
28
|
+
(0, test_1.expect)(await response.json()).toEqual(test_1.expect.any(Object));
|
|
29
|
+
});
|
|
30
|
+
(0, api_1.test)('creates and deletes a project', async ({ request }) => {
|
|
31
|
+
const headers = { Authorization: await (0, auth_1.authHeader)(request) };
|
|
32
|
+
const created = await request.post(`${base}/api/v1/projects`, {
|
|
33
|
+
headers,
|
|
34
|
+
data: { name: (0, bpmn_1.uniqueId)('api-smoke-project') },
|
|
35
|
+
});
|
|
36
|
+
const id = (await created.json().catch(() => ({}))).id;
|
|
37
|
+
try {
|
|
38
|
+
(0, test_1.expect)(created.status()).toBe(200);
|
|
39
|
+
(0, test_1.expect)(id).toBeTruthy();
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
// Runs whenever the POST returned an id, so a failed assertion above
|
|
43
|
+
// cannot leave the project behind.
|
|
44
|
+
if (id) {
|
|
45
|
+
const deleted = await request.delete(`${base}/api/v1/projects/${id}`, {
|
|
46
|
+
headers,
|
|
47
|
+
});
|
|
48
|
+
(0, test_1.expect)(deleted.status()).toBe(204);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
(0, api_1.test)('refuses a request without a token', async ({ request }) => {
|
|
53
|
+
const response = await request.get(`${base}/api/v1/info`);
|
|
54
|
+
(0, test_1.expect)(response.status()).toBe(401);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Zeebe gRPC API, reached through the same ingress and identity provider
|
|
3
|
+
* as the REST suite.
|
|
4
|
+
*
|
|
5
|
+
* gRPC has its own ingress host, TLS termination and token check, and none of
|
|
6
|
+
* the REST specs touches them: a cluster whose REST API passes can still
|
|
7
|
+
* refuse every gRPC client. These tests stay thin — one read, one command
|
|
8
|
+
* round trip and the authentication check — because the engine behaviour
|
|
9
|
+
* behind the commands is what the REST specs cover.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The Zeebe gRPC API, reached through the same ingress and identity provider
|
|
4
|
+
* as the REST suite.
|
|
5
|
+
*
|
|
6
|
+
* gRPC has its own ingress host, TLS termination and token check, and none of
|
|
7
|
+
* the REST specs touches them: a cluster whose REST API passes can still
|
|
8
|
+
* refuse every gRPC client. These tests stay thin — one read, one command
|
|
9
|
+
* round trip and the authentication check — because the engine behaviour
|
|
10
|
+
* behind the commands is what the REST specs cover.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
const api_1 = require("../../../fixtures/api");
|
|
14
|
+
const test_1 = require("@playwright/test");
|
|
15
|
+
const bpmn_1 = require("../../../utils/api/bpmn");
|
|
16
|
+
const capabilities_1 = require("../../../utils/api/capabilities");
|
|
17
|
+
const grpc_1 = require("../../../utils/api/grpc");
|
|
18
|
+
api_1.test.describe('gRPC', () => {
|
|
19
|
+
api_1.test.skip(!!capabilities_1.grpcUnavailable, capabilities_1.grpcUnavailable || '');
|
|
20
|
+
let zbc;
|
|
21
|
+
api_1.test.beforeEach(() => {
|
|
22
|
+
zbc = (0, grpc_1.grpcClient)();
|
|
23
|
+
});
|
|
24
|
+
api_1.test.afterEach(async () => {
|
|
25
|
+
await zbc.close();
|
|
26
|
+
});
|
|
27
|
+
(0, api_1.test)('reports the cluster topology', async () => {
|
|
28
|
+
const topology = await zbc.topology();
|
|
29
|
+
(0, test_1.expect)(topology.brokers.length).toBeGreaterThan(0);
|
|
30
|
+
(0, test_1.expect)(topology.partitionsCount).toBeGreaterThan(0);
|
|
31
|
+
(0, test_1.expect)(topology.gatewayVersion).not.toBe('');
|
|
32
|
+
});
|
|
33
|
+
(0, api_1.test)('deploys a process and runs an instance to completion', async ({ resources, }) => {
|
|
34
|
+
const processId = (0, bpmn_1.uniqueId)('grpc-roundtrip');
|
|
35
|
+
const deployment = await zbc.deployResource({
|
|
36
|
+
name: `${processId}.bpmn`,
|
|
37
|
+
process: Buffer.from((0, bpmn_1.emptyProcess)(processId)),
|
|
38
|
+
});
|
|
39
|
+
const definition = deployment.deployments[0].process;
|
|
40
|
+
resources.track('resource', definition.processDefinitionKey);
|
|
41
|
+
(0, test_1.expect)(definition.bpmnProcessId).toBe(processId);
|
|
42
|
+
const marker = (0, bpmn_1.uniqueId)('marker');
|
|
43
|
+
const result = await zbc.createProcessInstanceWithResult({
|
|
44
|
+
bpmnProcessId: processId,
|
|
45
|
+
variables: { marker },
|
|
46
|
+
requestTimeout: 30000,
|
|
47
|
+
});
|
|
48
|
+
(0, test_1.expect)(result.processDefinitionKey).toBe(definition.processDefinitionKey);
|
|
49
|
+
(0, test_1.expect)(result.variables).toMatchObject({ marker });
|
|
50
|
+
});
|
|
51
|
+
(0, api_1.test)('refuses a call without credentials', async () => {
|
|
52
|
+
api_1.test.skip(!!capabilities_1.unauthenticatedAccessAllowed, capabilities_1.unauthenticatedAccessAllowed || '');
|
|
53
|
+
const anonymous = (0, grpc_1.grpcClient)({ authenticated: false });
|
|
54
|
+
try {
|
|
55
|
+
// 16 is UNAUTHENTICATED in the gRPC status code table.
|
|
56
|
+
await (0, test_1.expect)(anonymous.topology()).rejects.toMatchObject({ code: 16 });
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
await anonymous.close();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* role that was not granted — is a failure, not a capability, and must stay
|
|
21
21
|
* red.
|
|
22
22
|
*/
|
|
23
|
+
import { apiConfig } from './config';
|
|
23
24
|
import type { ApiClient } from './http';
|
|
24
25
|
/**
|
|
25
26
|
* Reason text for the `/v2/users/**` gate, or `false` when the tree is served.
|
|
@@ -53,6 +54,14 @@ export declare const usersApiUnavailable: string | false;
|
|
|
53
54
|
*/
|
|
54
55
|
export declare const unauthenticatedAccessAllowed: string | false;
|
|
55
56
|
export declare const enforcementPrincipalUnavailable: string | false;
|
|
57
|
+
/**
|
|
58
|
+
* Reason text for the gRPC gate, or `false` when the run names a gateway.
|
|
59
|
+
*
|
|
60
|
+
* Unlike the gates above this is not a property of the cluster: every
|
|
61
|
+
* supported minor serves gRPC. It is a property of the run, since only a
|
|
62
|
+
* runner that knows the ingress host can say where the gateway is.
|
|
63
|
+
*/
|
|
64
|
+
export declare const grpcUnavailable: string | false;
|
|
56
65
|
export declare const absentUserMembership: {
|
|
57
66
|
status: number;
|
|
58
67
|
reason: string;
|
|
@@ -71,3 +80,16 @@ export declare const absentUserMembership: {
|
|
|
71
80
|
* is a finding, not a reason to stop looking.
|
|
72
81
|
*/
|
|
73
82
|
export declare function readAuthorizationsEnabled(api: ApiClient): Promise<boolean | undefined>;
|
|
83
|
+
type Component = keyof typeof apiConfig.components;
|
|
84
|
+
/**
|
|
85
|
+
* Reason text for a component spec's gate, or `false` when it can run.
|
|
86
|
+
*
|
|
87
|
+
* A component runs only where the run names its URL, since which components
|
|
88
|
+
* a deployment has is the runner's knowledge. Two are also bound to a version
|
|
89
|
+
* range: 8.10 has no standalone Console (its UI moved into Camunda Hub, and
|
|
90
|
+
* the chart has no Console templates), and before 8.9 the chart routes
|
|
91
|
+
* `/modeler` to the Web Modeler webapp rather than to the REST API that
|
|
92
|
+
* serves `/api/v1`.
|
|
93
|
+
*/
|
|
94
|
+
export declare function componentUnavailable(component: Component): string | false;
|
|
95
|
+
export {};
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* red.
|
|
23
23
|
*/
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.readAuthorizationsEnabled = exports.absentUserMembership = exports.enforcementPrincipalUnavailable = exports.unauthenticatedAccessAllowed = exports.usersApiUnavailable = void 0;
|
|
25
|
+
exports.componentUnavailable = exports.readAuthorizationsEnabled = exports.absentUserMembership = exports.grpcUnavailable = exports.enforcementPrincipalUnavailable = exports.unauthenticatedAccessAllowed = exports.usersApiUnavailable = void 0;
|
|
26
26
|
const config_1 = require("./config");
|
|
27
27
|
/**
|
|
28
28
|
* Reason text for the `/v2/users/**` gate, or `false` when the tree is served.
|
|
@@ -120,6 +120,17 @@ function enforcementUnavailableReason() {
|
|
|
120
120
|
return false;
|
|
121
121
|
}
|
|
122
122
|
exports.enforcementPrincipalUnavailable = enforcementUnavailableReason();
|
|
123
|
+
/**
|
|
124
|
+
* Reason text for the gRPC gate, or `false` when the run names a gateway.
|
|
125
|
+
*
|
|
126
|
+
* Unlike the gates above this is not a property of the cluster: every
|
|
127
|
+
* supported minor serves gRPC. It is a property of the run, since only a
|
|
128
|
+
* runner that knows the ingress host can say where the gateway is.
|
|
129
|
+
*/
|
|
130
|
+
exports.grpcUnavailable = config_1.apiConfig.grpc.address
|
|
131
|
+
? false
|
|
132
|
+
: 'GRPC_ADDRESS is not set, so this run names no gRPC gateway — see ' +
|
|
133
|
+
'tests/api/README.md';
|
|
123
134
|
/**
|
|
124
135
|
* What `PUT /{roles,groups,tenants}/{id}/users/{username}` does when the
|
|
125
136
|
* username belongs to nobody.
|
|
@@ -224,3 +235,37 @@ async function readAuthorizationsEnabled(api) {
|
|
|
224
235
|
return json.authorizationsEnabled;
|
|
225
236
|
}
|
|
226
237
|
exports.readAuthorizationsEnabled = readAuthorizationsEnabled;
|
|
238
|
+
const COMPONENT_VARIABLES = {
|
|
239
|
+
identity: 'API_IDENTITY_URL',
|
|
240
|
+
connectors: 'API_CONNECTORS_URL',
|
|
241
|
+
console: 'API_CONSOLE_URL',
|
|
242
|
+
webModeler: 'API_WEB_MODELER_URL',
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Reason text for a component spec's gate, or `false` when it can run.
|
|
246
|
+
*
|
|
247
|
+
* A component runs only where the run names its URL, since which components
|
|
248
|
+
* a deployment has is the runner's knowledge. Two are also bound to a version
|
|
249
|
+
* range: 8.10 has no standalone Console (its UI moved into Camunda Hub, and
|
|
250
|
+
* the chart has no Console templates), and before 8.9 the chart routes
|
|
251
|
+
* `/modeler` to the Web Modeler webapp rather than to the REST API that
|
|
252
|
+
* serves `/api/v1`.
|
|
253
|
+
*/
|
|
254
|
+
function componentUnavailable(component) {
|
|
255
|
+
if (!config_1.apiConfig.components[component]) {
|
|
256
|
+
return `${COMPONENT_VARIABLES[component]} is not set, so this run names no ${component} to call`;
|
|
257
|
+
}
|
|
258
|
+
// Connectors' inbound and actuator endpoints need no credentials; the others
|
|
259
|
+
// take the suite's client-credentials token.
|
|
260
|
+
if (component !== 'connectors' && config_1.apiConfig.authMethod !== 'oauth2') {
|
|
261
|
+
return `the ${component} API takes an OAuth2 token, and this run authenticates with ${config_1.apiConfig.authMethod}`;
|
|
262
|
+
}
|
|
263
|
+
if (component === 'console' && (0, config_1.atLeastVersion)('8.10')) {
|
|
264
|
+
return '8.10 ships no standalone Console, so there is no Administration API to call';
|
|
265
|
+
}
|
|
266
|
+
if (component === 'webModeler' && !(0, config_1.atLeastVersion)('8.9')) {
|
|
267
|
+
return 'before 8.9 the chart routes /modeler to the Web Modeler webapp, not its public API';
|
|
268
|
+
}
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
exports.componentUnavailable = componentUnavailable;
|
|
@@ -93,6 +93,26 @@ export interface ApiConfig {
|
|
|
93
93
|
clientId: string;
|
|
94
94
|
clientSecret: string;
|
|
95
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* The cluster's Zeebe gRPC gateway, as `host:port`, for the gRPC spec.
|
|
98
|
+
* Read from `GRPC_ADDRESS`; the spec runs when it is set and skips when it
|
|
99
|
+
* is empty. It authenticates the same way as the REST client above.
|
|
100
|
+
*/
|
|
101
|
+
grpc: {
|
|
102
|
+
address: string;
|
|
103
|
+
useTls: boolean;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Base URLs, context path included, of the other components the component
|
|
107
|
+
* specs smoke-test, e.g. `https://<host>/identity`. A component's spec runs
|
|
108
|
+
* when its URL is set and skips when it is empty.
|
|
109
|
+
*/
|
|
110
|
+
components: {
|
|
111
|
+
identity: string;
|
|
112
|
+
connectors: string;
|
|
113
|
+
console: string;
|
|
114
|
+
webModeler: string;
|
|
115
|
+
};
|
|
96
116
|
}
|
|
97
117
|
export declare function loadApiConfig(): ApiConfig;
|
|
98
118
|
export declare const apiConfig: ApiConfig;
|
package/dist/utils/api/config.js
CHANGED
|
@@ -43,6 +43,16 @@ function loadApiConfig() {
|
|
|
43
43
|
clientId: env('SECONDARY_CLIENT_ID'),
|
|
44
44
|
clientSecret: env('SECONDARY_CLIENT_SECRET'),
|
|
45
45
|
},
|
|
46
|
+
grpc: {
|
|
47
|
+
address: env('GRPC_ADDRESS'),
|
|
48
|
+
useTls: env('GRPC_TLS', 'true') === 'true',
|
|
49
|
+
},
|
|
50
|
+
components: {
|
|
51
|
+
identity: env('API_IDENTITY_URL').replace(/\/+$/, ''),
|
|
52
|
+
connectors: env('API_CONNECTORS_URL').replace(/\/+$/, ''),
|
|
53
|
+
console: env('API_CONSOLE_URL').replace(/\/+$/, ''),
|
|
54
|
+
webModeler: env('API_WEB_MODELER_URL').replace(/\/+$/, ''),
|
|
55
|
+
},
|
|
46
56
|
};
|
|
47
57
|
}
|
|
48
58
|
exports.loadApiConfig = loadApiConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Zeebe gRPC client for the gRPC spec, built from the same configuration as
|
|
3
|
+
* the REST `ApiClient`: OAuth2 client credentials or basic auth, and the
|
|
4
|
+
* tenant on a multi-tenant cluster.
|
|
5
|
+
*/
|
|
6
|
+
import { ZBClient } from 'zeebe-node';
|
|
7
|
+
export declare function grpcClient(options?: {
|
|
8
|
+
authenticated?: boolean;
|
|
9
|
+
}): ZBClient;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* A Zeebe gRPC client for the gRPC spec, built from the same configuration as
|
|
4
|
+
* the REST `ApiClient`: OAuth2 client credentials or basic auth, and the
|
|
5
|
+
* tenant on a multi-tenant cluster.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.grpcClient = void 0;
|
|
9
|
+
const zeebe_node_1 = require("zeebe-node");
|
|
10
|
+
const config_1 = require("./config");
|
|
11
|
+
function grpcClient(options = {}) {
|
|
12
|
+
const authenticated = options.authenticated ?? true;
|
|
13
|
+
const { oauth, basic } = config_1.apiConfig;
|
|
14
|
+
return new zeebe_node_1.ZBClient(config_1.apiConfig.grpc.address, {
|
|
15
|
+
useTLS: config_1.apiConfig.grpc.useTls,
|
|
16
|
+
// A failed call must surface as the failure, not as a retry loop that
|
|
17
|
+
// outlasts the test timeout.
|
|
18
|
+
retry: false,
|
|
19
|
+
loglevel: 'NONE',
|
|
20
|
+
...(config_1.apiConfig.multiTenancy ? { tenantId: config_1.apiConfig.tenantId } : {}),
|
|
21
|
+
...(!authenticated
|
|
22
|
+
? {}
|
|
23
|
+
: config_1.apiConfig.authMethod === 'basic'
|
|
24
|
+
? { basicAuth: { username: basic.username, password: basic.password } }
|
|
25
|
+
: {
|
|
26
|
+
oAuth: {
|
|
27
|
+
url: oauth.tokenUrl,
|
|
28
|
+
audience: oauth.audience,
|
|
29
|
+
...(oauth.scope ? { scope: oauth.scope } : {}),
|
|
30
|
+
clientId: oauth.clientId,
|
|
31
|
+
clientSecret: oauth.clientSecret,
|
|
32
|
+
cacheOnDisk: false,
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports.grpcClient = grpcClient;
|
|
@@ -54,17 +54,27 @@ async function renameHubResource(page, currentName, newName) {
|
|
|
54
54
|
await inline.press('Enter');
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
await (0, test_1.expect)(trigger).toHaveAccessibleName(`${currentName} actions`, {
|
|
58
|
-
timeout: 30000,
|
|
59
|
-
});
|
|
60
57
|
await (0, test_1.expect)(async () => {
|
|
61
58
|
if (await breadcrumbs.getByText(newName).isVisible())
|
|
62
59
|
return;
|
|
60
|
+
// Gated inside the retry rather than once before it: this resource's own
|
|
61
|
+
// breadcrumb segment is appended after the page settles, so `.last()` can
|
|
62
|
+
// still resolve to the parent's actions button for a while -- renaming
|
|
63
|
+
// through that one would rename the process application instead. As a
|
|
64
|
+
// single pre-check it failed the test outright when the segment arrived
|
|
65
|
+
// late (`"Cross Component Test Project actions"`, CI run 36725966162).
|
|
66
|
+
await (0, test_1.expect)(trigger).toHaveAccessibleName(`${currentName} actions`, {
|
|
67
|
+
timeout: 15000,
|
|
68
|
+
});
|
|
63
69
|
await trigger.click({ timeout: 15000 });
|
|
64
70
|
await page.getByRole('menuitem', { name: 'Rename' }).click({ timeout: 15000 });
|
|
65
71
|
await (0, test_1.expect)(renameInput).toBeVisible({ timeout: 15000 });
|
|
66
72
|
await renameInput.fill(newName);
|
|
67
73
|
await (0, test_1.expect)(renameInput).toHaveValue(newName, { timeout: 15000 });
|
|
74
|
+
// The dialog enables Rename only once its form has registered the value,
|
|
75
|
+
// so a click fired straight after the fill spends its whole budget
|
|
76
|
+
// retrying against a disabled button before the attempt is given up.
|
|
77
|
+
await (0, test_1.expect)(renameSubmit).toBeEnabled({ timeout: 15000 });
|
|
68
78
|
await renameSubmit.click({ timeout: 15000 });
|
|
69
79
|
await (0, test_1.expect)(breadcrumbs.getByText(newName)).toBeVisible({
|
|
70
80
|
timeout: 15000,
|