@camunda/e2e-test-suite 0.0.229 → 0.0.230
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/fixtures/8.7.d.ts +2 -0
- package/dist/fixtures/8.7.js +4 -0
- package/dist/pages/8.7/ClientCredentialsDetailsPage.d.ts +12 -0
- package/dist/pages/8.7/ClientCredentialsDetailsPage.js +36 -0
- package/dist/pages/8.7/ClusterDetailsPage.d.ts +6 -1
- package/dist/pages/8.7/ClusterDetailsPage.js +36 -2
- package/dist/tests/8.7/operate-access-flow.spec.d.ts +1 -0
- package/dist/tests/8.7/operate-access-flow.spec.js +57 -0
- package/dist/utils/urlHelpers.d.ts +12 -0
- package/dist/utils/urlHelpers.js +18 -0
- package/package.json +1 -1
package/dist/fixtures/8.7.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { SignUpPage } from '../pages/8.7/SignUpPage';
|
|
|
27
27
|
import { PlayPage } from '../pages/8.7/PlayPage';
|
|
28
28
|
import { ConnectorTemplatePage } from '../pages/8.7/ConnectorTemplatePage';
|
|
29
29
|
import { IdpCreatePage } from '../pages/8.7/IdpCreatePage';
|
|
30
|
+
import { ClientCredentialsDetailsPage } from '../pages/8.7/ClientCredentialsDetailsPage';
|
|
30
31
|
type PlaywrightFixtures = {
|
|
31
32
|
makeAxeBuilder: () => AxeBuilder;
|
|
32
33
|
loginPage: LoginPage;
|
|
@@ -57,6 +58,7 @@ type PlaywrightFixtures = {
|
|
|
57
58
|
playPage: PlayPage;
|
|
58
59
|
connectorTemplatePage: ConnectorTemplatePage;
|
|
59
60
|
idpCreatePage: IdpCreatePage;
|
|
61
|
+
clientCredentialsDetailsPage: ClientCredentialsDetailsPage;
|
|
60
62
|
overrideTrackingScripts: void;
|
|
61
63
|
};
|
|
62
64
|
declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & PlaywrightFixtures, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
package/dist/fixtures/8.7.js
CHANGED
|
@@ -34,6 +34,7 @@ const SignUpPage_1 = require("../pages/8.7/SignUpPage");
|
|
|
34
34
|
const PlayPage_1 = require("../pages/8.7/PlayPage");
|
|
35
35
|
const ConnectorTemplatePage_1 = require("../pages/8.7/ConnectorTemplatePage");
|
|
36
36
|
const IdpCreatePage_1 = require("../pages/8.7/IdpCreatePage");
|
|
37
|
+
const ClientCredentialsDetailsPage_1 = require("../pages/8.7/ClientCredentialsDetailsPage");
|
|
37
38
|
const test = test_1.test.extend({
|
|
38
39
|
makeAxeBuilder: async ({ page }, use) => {
|
|
39
40
|
const makeAxeBuilder = () => new playwright_1.default({ page }).withTags([
|
|
@@ -129,6 +130,9 @@ const test = test_1.test.extend({
|
|
|
129
130
|
idpCreatePage: async ({ page }, use) => {
|
|
130
131
|
await use(new IdpCreatePage_1.IdpCreatePage(page));
|
|
131
132
|
},
|
|
133
|
+
clientCredentialsDetailsPage: async ({ page }, use) => {
|
|
134
|
+
await use(new ClientCredentialsDetailsPage_1.ClientCredentialsDetailsPage(page));
|
|
135
|
+
},
|
|
132
136
|
overrideTrackingScripts: [
|
|
133
137
|
async ({ context }, use) => {
|
|
134
138
|
await context.route('https://cmp.osano.com/16CVvwSNKHi9t1grQ/9403708a-488b-4f3b-aea6-613825dec79f/osano.js', (route) => route.fulfill({
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class ClientCredentialsDetailsPage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly operateUrlRow: Locator;
|
|
5
|
+
readonly operateUrlValue: Locator;
|
|
6
|
+
readonly clientNameHeading: (clientName: string) => Locator;
|
|
7
|
+
constructor(page: Page);
|
|
8
|
+
isOpen(clientName: string): Promise<void>;
|
|
9
|
+
getOperateUrl(): Promise<string>;
|
|
10
|
+
goBack(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export { ClientCredentialsDetailsPage };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientCredentialsDetailsPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
class ClientCredentialsDetailsPage {
|
|
6
|
+
page;
|
|
7
|
+
operateUrlRow;
|
|
8
|
+
operateUrlValue;
|
|
9
|
+
clientNameHeading;
|
|
10
|
+
constructor(page) {
|
|
11
|
+
this.page = page;
|
|
12
|
+
this.operateUrlRow = page.getByRole('cell', { name: 'Operate URL' });
|
|
13
|
+
this.operateUrlValue = this.operateUrlRow.getByRole('textbox');
|
|
14
|
+
this.clientNameHeading = (clientName) => page.getByRole('heading', { name: clientName });
|
|
15
|
+
}
|
|
16
|
+
async isOpen(clientName) {
|
|
17
|
+
await (0, test_1.expect)(this.clientNameHeading(clientName)).toBeVisible({
|
|
18
|
+
timeout: 30000,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async getOperateUrl() {
|
|
22
|
+
if (await this.operateUrlValue.isVisible({ timeout: 10000 }).catch(() => false)) {
|
|
23
|
+
return await this.operateUrlValue.inputValue();
|
|
24
|
+
}
|
|
25
|
+
const text = await this.page.innerText('body');
|
|
26
|
+
const match = text.match(/Operate URL\s*([\w:/.-]+\/?)/i);
|
|
27
|
+
if (!match || !match[1]) {
|
|
28
|
+
throw new Error('Operate URL not found in client credentials page');
|
|
29
|
+
}
|
|
30
|
+
return match[1];
|
|
31
|
+
}
|
|
32
|
+
async goBack() {
|
|
33
|
+
await this.page.goBack();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ClientCredentialsDetailsPage = ClientCredentialsDetailsPage;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
import { ClientCredentialsDetailsPage } from '../8.7/ClientCredentialsDetailsPage';
|
|
2
3
|
declare class ClusterDetailsPage {
|
|
3
4
|
private page;
|
|
4
5
|
readonly apiTab: Locator;
|
|
@@ -38,6 +39,9 @@ declare class ClusterDetailsPage {
|
|
|
38
39
|
readonly apiClientNameTextbox: Locator;
|
|
39
40
|
readonly expandButton: Locator;
|
|
40
41
|
readonly rbaHeading: Locator;
|
|
42
|
+
readonly clientCredentialsLink: (clientCredentials: string) => Locator;
|
|
43
|
+
readonly clientRow: (name: string) => Locator;
|
|
44
|
+
readonly clientRowDeleteButton: (name: string) => Locator;
|
|
41
45
|
constructor(page: Page);
|
|
42
46
|
clickAPITab(): Promise<void>;
|
|
43
47
|
clickCreateClientButton(): Promise<void>;
|
|
@@ -53,7 +57,8 @@ declare class ClusterDetailsPage {
|
|
|
53
57
|
clickSettingsTab(): Promise<void>;
|
|
54
58
|
enableRBA(): Promise<void>;
|
|
55
59
|
disableRBA(): Promise<void>;
|
|
56
|
-
|
|
60
|
+
searchAndClickClientCredentialsLink(name: string): Promise<ClientCredentialsDetailsPage>;
|
|
61
|
+
deleteAPIClientsIfExist(name?: string): Promise<void>;
|
|
57
62
|
clickAlertsTab(): Promise<void>;
|
|
58
63
|
clickCreateFirstAlertButton(): Promise<void>;
|
|
59
64
|
clickCreateNewAlertButton(): Promise<void>;
|
|
@@ -4,6 +4,7 @@ exports.ClusterDetailsPage = void 0;
|
|
|
4
4
|
const test_1 = require("@playwright/test");
|
|
5
5
|
const sleep_1 = require("../../utils/sleep");
|
|
6
6
|
const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
|
|
7
|
+
const ClientCredentialsDetailsPage_1 = require("../8.7/ClientCredentialsDetailsPage");
|
|
7
8
|
class ClusterDetailsPage {
|
|
8
9
|
page;
|
|
9
10
|
apiTab;
|
|
@@ -43,6 +44,9 @@ class ClusterDetailsPage {
|
|
|
43
44
|
apiClientNameTextbox;
|
|
44
45
|
expandButton;
|
|
45
46
|
rbaHeading;
|
|
47
|
+
clientCredentialsLink;
|
|
48
|
+
clientRow;
|
|
49
|
+
clientRowDeleteButton;
|
|
46
50
|
constructor(page) {
|
|
47
51
|
this.page = page;
|
|
48
52
|
this.apiTab = page.getByRole('tab', { name: 'API' });
|
|
@@ -128,6 +132,9 @@ class ClusterDetailsPage {
|
|
|
128
132
|
this.rbaHeading = this.page.getByRole('heading', {
|
|
129
133
|
name: 'Resource-based authorizations',
|
|
130
134
|
});
|
|
135
|
+
this.clientCredentialsLink = (clientCredentials) => page.getByRole('cell', { name: clientCredentials });
|
|
136
|
+
this.clientRow = (name) => this.clientsList.filter({ hasText: name });
|
|
137
|
+
this.clientRowDeleteButton = (name) => this.clientRow(name).getByRole('button', { name: 'Delete' });
|
|
131
138
|
}
|
|
132
139
|
async clickAPITab() {
|
|
133
140
|
await (0, test_1.expect)(this.apiTab).toBeVisible({ timeout: 60000 });
|
|
@@ -238,7 +245,34 @@ class ClusterDetailsPage {
|
|
|
238
245
|
console.log('Toggle text elements not found or less than 2.');
|
|
239
246
|
}
|
|
240
247
|
}
|
|
241
|
-
async
|
|
248
|
+
async searchAndClickClientCredentialsLink(name) {
|
|
249
|
+
await (0, test_1.expect)(this.clientsList.first()).toBeVisible({ timeout: 60000 });
|
|
250
|
+
const clientLink = this.clientCredentialsLink(name);
|
|
251
|
+
await (0, test_1.expect)(clientLink).toBeVisible({ timeout: 30000 });
|
|
252
|
+
await clientLink.click();
|
|
253
|
+
const clientCredentialsDetailsPage = new ClientCredentialsDetailsPage_1.ClientCredentialsDetailsPage(this.page);
|
|
254
|
+
await clientCredentialsDetailsPage.isOpen(name);
|
|
255
|
+
return clientCredentialsDetailsPage;
|
|
256
|
+
}
|
|
257
|
+
async deleteAPIClientsIfExist(name) {
|
|
258
|
+
if (name) {
|
|
259
|
+
const row = this.clientRow(name);
|
|
260
|
+
const deleteButton = this.clientRowDeleteButton(name);
|
|
261
|
+
try {
|
|
262
|
+
await (0, test_1.expect)(deleteButton).toBeVisible({ timeout: 10000 });
|
|
263
|
+
await deleteButton.click();
|
|
264
|
+
await (0, test_1.expect)(this.dialog).toBeVisible();
|
|
265
|
+
await this.deleteSubButton.click();
|
|
266
|
+
await (0, test_1.expect)(this.page.getByText('Deleting...')).not.toBeVisible({
|
|
267
|
+
timeout: 10000,
|
|
268
|
+
});
|
|
269
|
+
await (0, test_1.expect)(row).not.toBeVisible();
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
console.warn(`No client row found for ${name} or deletion failed: ${error}`);
|
|
273
|
+
}
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
242
276
|
await this.doDelete(this.dialog, 'API clients');
|
|
243
277
|
}
|
|
244
278
|
async clickAlertsTab() {
|
|
@@ -362,7 +396,7 @@ class ClusterDetailsPage {
|
|
|
362
396
|
timeout: 20000,
|
|
363
397
|
});
|
|
364
398
|
await (0, test_1.expect)(this.clientCredentialsDialog.getByText('The Client Secret will not be shown again.')).toBeVisible();
|
|
365
|
-
await (0, test_1.expect)(this.
|
|
399
|
+
await (0, test_1.expect)(this.clientRow(name)).toContainText('Zeebe, Tasklist, Operate, Optimize, and Secrets');
|
|
366
400
|
}
|
|
367
401
|
async clickEnvVarsButton() {
|
|
368
402
|
await (0, test_1.expect)(this.envVarsTab).toBeVisible({ timeout: 40000 });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
const _8_7_1 = require("../../fixtures/8.7");
|
|
5
|
+
const UtilitiesPage_1 = require("../../pages/8.7/UtilitiesPage");
|
|
6
|
+
const _setup_1 = require("../../test-setup.js");
|
|
7
|
+
const users_1 = require("../../utils/users");
|
|
8
|
+
const urlHelpers_1 = require("../../utils/urlHelpers");
|
|
9
|
+
const testUser = (0, users_1.getTestUser)('twentySecondUser');
|
|
10
|
+
// This test covers the manual scenario: create a new API client via UI, copy the Operate URL, and verify the Operate endpoint denies unauthenticated access.
|
|
11
|
+
_8_7_1.test.describe.configure({ mode: 'parallel' });
|
|
12
|
+
_8_7_1.test.describe('Operate access requires authentication', () => {
|
|
13
|
+
let clientName;
|
|
14
|
+
const clusterName = 'Test Cluster';
|
|
15
|
+
_8_7_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
|
|
16
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
|
|
17
|
+
});
|
|
18
|
+
_8_7_1.test.afterEach(async ({ page, homePage, clusterPage, clusterDetailsPage }, testInfo) => {
|
|
19
|
+
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
20
|
+
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
21
|
+
if (clientName) {
|
|
22
|
+
await homePage.clickClusters();
|
|
23
|
+
await clusterPage.clickClusterLink(clusterName);
|
|
24
|
+
await clusterDetailsPage.clickAPITab();
|
|
25
|
+
await clusterDetailsPage.deleteAPIClientsIfExist(clientName);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
(0, _8_7_1.test)('check that request POST /v1/process-definitions/search returns 403 without credentials', async ({ homePage, clusterPage, clusterDetailsPage, clientCredentialsDetailsPage, request, }) => {
|
|
29
|
+
clientName = `operate-deny-${await (0, _setup_1.generateRandomStringAsync)(5)}`;
|
|
30
|
+
await _8_7_1.test.step('Add API Client to Cluster', async () => {
|
|
31
|
+
await homePage.clickClusters();
|
|
32
|
+
await clusterPage.clickClusterLink(clusterName);
|
|
33
|
+
await clusterDetailsPage.clickAPITab();
|
|
34
|
+
await clusterDetailsPage.createAPIClient(clientName);
|
|
35
|
+
await clusterDetailsPage.clickCloseModalButton();
|
|
36
|
+
await (0, test_1.expect)(clusterDetailsPage.clientsList.filter({ hasText: clientName })).toBeVisible({ timeout: 6000 });
|
|
37
|
+
});
|
|
38
|
+
let operateUrl = '';
|
|
39
|
+
await _8_7_1.test.step('Capture Operate URL from client credentials page and close it', async () => {
|
|
40
|
+
await clusterDetailsPage.searchAndClickClientCredentialsLink(clientName);
|
|
41
|
+
operateUrl = await clientCredentialsDetailsPage.getOperateUrl();
|
|
42
|
+
(0, test_1.expect)(operateUrl).toMatch(/^https?:\/\//);
|
|
43
|
+
await clientCredentialsDetailsPage.goBack();
|
|
44
|
+
await clusterDetailsPage.clickAPITab();
|
|
45
|
+
});
|
|
46
|
+
await _8_7_1.test.step('POST search endpoint without auth should be rejected', async () => {
|
|
47
|
+
const sanitizedOperateUrl = (0, urlHelpers_1.sanitizeUrl)(operateUrl);
|
|
48
|
+
const response = await request.post(`${sanitizedOperateUrl}/v1/process-definitions/search`, {
|
|
49
|
+
data: { filter: {}, size: 10 },
|
|
50
|
+
});
|
|
51
|
+
(0, test_1.expect)(response.status()).toBe(403);
|
|
52
|
+
const body = await response.json();
|
|
53
|
+
(0, test_1.expect)(body.status).toBe(403);
|
|
54
|
+
(0, test_1.expect)(body.error).toBe('Forbidden');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL utility functions for test operations
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Removes trailing slash from a URL if present
|
|
6
|
+
* @param url - The URL to sanitize
|
|
7
|
+
* @returns The URL without a trailing slash
|
|
8
|
+
* @example
|
|
9
|
+
* sanitizeUrl('https://example.com/') // returns 'https://example.com'
|
|
10
|
+
* sanitizeUrl('https://example.com') // returns 'https://example.com'
|
|
11
|
+
*/
|
|
12
|
+
export declare function sanitizeUrl(url: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* URL utility functions for test operations
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sanitizeUrl = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Removes trailing slash from a URL if present
|
|
9
|
+
* @param url - The URL to sanitize
|
|
10
|
+
* @returns The URL without a trailing slash
|
|
11
|
+
* @example
|
|
12
|
+
* sanitizeUrl('https://example.com/') // returns 'https://example.com'
|
|
13
|
+
* sanitizeUrl('https://example.com') // returns 'https://example.com'
|
|
14
|
+
*/
|
|
15
|
+
function sanitizeUrl(url) {
|
|
16
|
+
return url.replace(/\/$/, '');
|
|
17
|
+
}
|
|
18
|
+
exports.sanitizeUrl = sanitizeUrl;
|