@camunda/e2e-test-suite 0.0.228 → 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.
@@ -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>;
@@ -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
- deleteAPIClientsIfExist(): Promise<void>;
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 deleteAPIClientsIfExist() {
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.clientsList.filter({ hasText: name })).toContainText('Zeebe, Tasklist, Operate, Optimize, and Secrets');
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 });
@@ -314,7 +314,10 @@ class ClusterDetailsPage {
314
314
  await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.page.getByText(`${component}Healthy`, { exact: true }), {
315
315
  visibilityTimeout: 60000,
316
316
  totalTimeout: 400000,
317
- maxRetries: 6,
317
+ maxRetries: 7,
318
+ postAction: async () => {
319
+ await this.page.reload();
320
+ },
318
321
  });
319
322
  }
320
323
  }
@@ -50,7 +50,7 @@ declare class ClusterPage {
50
50
  clickClustersBreadcrumb(clusterName: string): Promise<void>;
51
51
  clickClusterLink(name: string): Promise<void>;
52
52
  clickConnectorSecretsTab(clusterName: string): Promise<void>;
53
- clickClusterOption(): Promise<void>;
53
+ clickClusterOption(version: string): Promise<void>;
54
54
  createClusterIfNotExists(clusterName: string, region?: string): Promise<void>;
55
55
  assertClusterHealthyStatusWithRetry(name: string, visibilityTimeout?: number, totalTimeout?: number): Promise<void>;
56
56
  clickAlphaTab(): Promise<void>;
@@ -5,6 +5,7 @@ const test_1 = require("@playwright/test");
5
5
  const sleep_1 = require("../../utils/sleep");
6
6
  const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
7
7
  const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
8
+ const clusterVersions_1 = require("../../utils/clusterVersions");
8
9
  class ClusterPage {
9
10
  page;
10
11
  defaultClusterType = 'G3-Dev';
@@ -195,7 +196,7 @@ class ClusterPage {
195
196
  await this.clickClusterType();
196
197
  await this.page.getByRole('tab', { name: region }).click();
197
198
  await this.selectSubRegion(region);
198
- await this.clickClusterOption();
199
+ await this.clickClusterOption(process.env.CLUSTER_VERSION);
199
200
  await this.determineTasklistAPI(tasklistV1Api);
200
201
  await this.clickCreateClusterButton();
201
202
  await this.logClusterCreationInfo(name);
@@ -274,21 +275,37 @@ class ClusterPage {
274
275
  },
275
276
  });
276
277
  }
277
- async clickClusterOption() {
278
+ async clickClusterOption(version) {
278
279
  const tabs = [
279
280
  this.clickDevTab,
280
281
  this.clickQAGenerationsTab,
281
282
  this.clickStableTab,
282
283
  this.clickAlphaTab,
283
284
  ];
284
- for (const clickTab of tabs) {
285
+ const maxRetries = 3;
286
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
285
287
  try {
286
- await clickTab.call(this);
287
- await this.clusterVersionOption.click({ timeout: 60000 });
288
- return;
288
+ if (version === clusterVersions_1.ClusterVersion.EIGHT_EIGHT_SNAPSHOT) {
289
+ await this.clickDevTab();
290
+ await this.clusterVersionOption.scrollIntoViewIfNeeded();
291
+ await (0, test_1.expect)(this.clusterVersionOption).toBeVisible({ timeout: 60000 });
292
+ await this.clusterVersionOption.click({ timeout: 60000 });
293
+ return;
294
+ }
295
+ for (const clickTab of tabs) {
296
+ try {
297
+ await clickTab.call(this);
298
+ await this.clusterVersionOption.click({ timeout: 30000 });
299
+ return;
300
+ }
301
+ catch (error) {
302
+ console.log('Version option not found in this tab, trying next tab if available...');
303
+ }
304
+ }
289
305
  }
290
306
  catch (error) {
291
- console.error('Error clicking tab or cluster version option:', error);
307
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
308
+ console.error('Error clicking tab or cluster version option: ' + errorMessage);
292
309
  }
293
310
  }
294
311
  throw new Error('Failed to find cluster generation');
@@ -320,6 +337,7 @@ class ClusterPage {
320
337
  await this.alphaTab.click();
321
338
  }
322
339
  async clickDevTab() {
340
+ await (0, test_1.expect)(this.devTab).toBeVisible({ timeout: 30000 });
323
341
  await this.devTab.click();
324
342
  }
325
343
  async clickStableTab() {
@@ -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
+ });
@@ -146,7 +146,7 @@ _8_8_1.test.describe('Smoke Tests', () => {
146
146
  await appsPage.clickCamundaApps();
147
147
  await appsPage.clickModeler();
148
148
  await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
149
- timeout: 10000,
149
+ timeout: 30000,
150
150
  });
151
151
  });
152
152
  await _8_8_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
@@ -0,0 +1,7 @@
1
+ export declare enum ClusterVersion {
2
+ EIGHT_SIX_SNAPSHOT = "8.6 Cross Component Test Suite",
3
+ EIGHT_SEVEN_SNAPSHOT = "8.7 Cross Component Test Suite",
4
+ EIGHT_EIGHT_SNAPSHOT = "8.8 Cross Component Test Suite",
5
+ EIGHT_NINE_SNAPSHOT = "8.9 Cross Component Test Suite",
6
+ EIGHT_TEN_SNAPSHOT = "8.10 Cross Component Test Suite"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClusterVersion = void 0;
4
+ var ClusterVersion;
5
+ (function (ClusterVersion) {
6
+ ClusterVersion["EIGHT_SIX_SNAPSHOT"] = "8.6 Cross Component Test Suite";
7
+ ClusterVersion["EIGHT_SEVEN_SNAPSHOT"] = "8.7 Cross Component Test Suite";
8
+ ClusterVersion["EIGHT_EIGHT_SNAPSHOT"] = "8.8 Cross Component Test Suite";
9
+ ClusterVersion["EIGHT_NINE_SNAPSHOT"] = "8.9 Cross Component Test Suite";
10
+ ClusterVersion["EIGHT_TEN_SNAPSHOT"] = "8.10 Cross Component Test Suite";
11
+ })(ClusterVersion || (exports.ClusterVersion = ClusterVersion = {}));
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.228",
3
+ "version": "0.0.230",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",