@camunda/e2e-test-suite 0.0.235 → 0.0.236

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.
@@ -38,6 +38,8 @@ declare class ClusterDetailsPage {
38
38
  readonly authorizationsHeading: Locator;
39
39
  readonly orchestrationClusterCheckbox: Locator;
40
40
  readonly clientCredentialsLink: (clientCredentials: string) => Locator;
41
+ readonly clientRow: (name: string) => Locator;
42
+ readonly clientRowDeleteButton: (name: string) => Locator;
41
43
  constructor(page: Page);
42
44
  clickAPITab(): Promise<void>;
43
45
  clickCreateClientButton(): Promise<void>;
@@ -44,6 +44,8 @@ class ClusterDetailsPage {
44
44
  authorizationsHeading;
45
45
  orchestrationClusterCheckbox;
46
46
  clientCredentialsLink;
47
+ clientRow;
48
+ clientRowDeleteButton;
47
49
  constructor(page) {
48
50
  this.page = page;
49
51
  this.apiTab = page.getByRole('tab', { name: 'API' });
@@ -124,6 +126,8 @@ class ClusterDetailsPage {
124
126
  .locator('label')
125
127
  .filter({ hasText: /^Orchestration Cluster API$/ });
126
128
  this.clientCredentialsLink = (clientCredentials) => page.getByRole('cell', { name: clientCredentials });
129
+ this.clientRow = (name) => this.clientsList.filter({ hasText: name });
130
+ this.clientRowDeleteButton = (name) => this.clientRow(name).getByRole('button', { name: 'Delete' });
127
131
  }
128
132
  async clickAPITab() {
129
133
  await (0, test_1.expect)(this.apiTab).toBeVisible({ timeout: 60000 });
@@ -239,8 +243,8 @@ class ClusterDetailsPage {
239
243
  }
240
244
  async deleteAPIClientsIfExist(name) {
241
245
  if (name) {
242
- const row = this.clientsList.filter({ hasText: name });
243
- const deleteButton = row.getByRole('button', { name: 'Delete' });
246
+ const row = this.clientRow(name);
247
+ const deleteButton = this.clientRowDeleteButton(name);
244
248
  try {
245
249
  await (0, test_1.expect)(deleteButton).toBeVisible({ timeout: 10000 });
246
250
  await deleteButton.click();
@@ -5,21 +5,26 @@ const _8_9_1 = require("../../fixtures/8.9");
5
5
  const UtilitiesPage_1 = require("../../pages/8.9/UtilitiesPage");
6
6
  const _setup_1 = require("../../test-setup.js");
7
7
  const users_1 = require("../../utils/users");
8
+ const urlHelpers_1 = require("../../utils/urlHelpers");
8
9
  const testUser = (0, users_1.getTestUser)('twentySecondUser');
9
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.
10
11
  _8_9_1.test.describe.configure({ mode: 'parallel' });
11
12
  _8_9_1.test.describe('Operate access requires authentication @tasklistV2', () => {
12
13
  let clientName;
13
14
  const clusterName = 'Test Cluster';
14
- _8_9_1.test.afterEach(async ({ page, clusterDetailsPage }, testInfo) => {
15
- await (0, _setup_1.captureScreenshot)(page, testInfo);
16
- await (0, _setup_1.captureFailureVideo)(page, testInfo);
17
- await clusterDetailsPage.clickAPITab();
18
- await clusterDetailsPage.deleteAPIClientsIfExist(clientName);
19
- });
20
15
  _8_9_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
21
16
  await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
22
17
  });
18
+ _8_9_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
+ });
23
28
  (0, _8_9_1.test)('check that request POST /v2/process-definitions/search returns 401 without credentials', async ({ homePage, clusterPage, clusterDetailsPage, clientCredentialsDetailsPage, request, }) => {
24
29
  clientName = `operate-deny-${await (0, _setup_1.generateRandomStringAsync)(5)}`;
25
30
  await _8_9_1.test.step('Add API Client to Cluster', async () => {
@@ -39,13 +44,13 @@ _8_9_1.test.describe('Operate access requires authentication @tasklistV2', () =>
39
44
  await clusterDetailsPage.clickAPITab();
40
45
  });
41
46
  await _8_9_1.test.step('POST search endpoint without auth should be rejected', async () => {
42
- const sanitizedOperateUrl = operateUrl.replace(/\/$/, '');
47
+ const sanitizedOperateUrl = (0, urlHelpers_1.sanitizeUrl)(operateUrl);
43
48
  const response = await request.post(`${sanitizedOperateUrl}/v2/process-definitions/search`, {
44
49
  data: { filter: {}, size: 10 },
45
50
  });
46
51
  (0, test_1.expect)(response.status()).toBe(401);
47
52
  const body = await response.text();
48
- (0, test_1.expect)(body.length).toBe(0);
53
+ (0, test_1.expect)(body).toBe('');
49
54
  });
50
55
  });
51
56
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.235",
3
+ "version": "0.0.236",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",