@camunda/e2e-test-suite 0.0.537 → 0.0.539

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.
@@ -694,18 +694,20 @@ class ModelerCreatePage {
694
694
  await (0, test_1.expect)(this.page.getByTestId('instance-header').getByText(scenarioName)).toBeVisible();
695
695
  }
696
696
  async instanceStartedAssertion() {
697
- try {
698
- await (0, test_1.expect)(this.page.getByText('Instance started!')).toBeVisible({
699
- timeout: 180000,
700
- });
701
- }
702
- catch {
697
+ const success = this.page.getByText('Instance started!');
698
+ const failure = this.page.getByText('Instance could not be started');
699
+ // Race success against the error banner so we don't burn 180 s waiting
700
+ // for a toast that will never appear when Zeebe rejects the start request.
701
+ for (let attempt = 1; attempt <= 2; attempt++) {
702
+ await (0, test_1.expect)(success.or(failure)).toBeVisible({ timeout: 60000 });
703
+ if (await success.isVisible())
704
+ return;
705
+ if (attempt === 2) {
706
+ throw new Error('Process instance could not be started after 2 attempts');
707
+ }
703
708
  await this.clickStartInstanceMainButton();
704
709
  await this.completeDeploymentEndpointConfiguration();
705
710
  await this.clickStartInstanceSubButton();
706
- await (0, test_1.expect)(this.page.getByText('Instance started!')).toBeVisible({
707
- timeout: 180000,
708
- });
709
711
  }
710
712
  }
711
713
  async assertImplementationOption(implementationType) {
@@ -70,12 +70,12 @@ class OptimizeReportPage {
70
70
  }
71
71
  async waitUntilUserTaskProcessIsVisible(processName) {
72
72
  await (0, test_1.expect)(this.page.getByText(processName, { exact: true })).toBeVisible({
73
- timeout: 1000,
73
+ timeout: 30000,
74
74
  });
75
75
  }
76
76
  async clickUserTaskProcess(processName) {
77
77
  await this.page.getByText(processName, { exact: true }).first().click();
78
- await (0, sleep_1.sleep)(8000); // If we click the report and navigate away too fast after this, the report will not be generated as we expect
78
+ await (0, test_1.expect)(this.versionSelection).toBeEnabled({ timeout: 30000 });
79
79
  }
80
80
  async clickVersionSelection() {
81
81
  await this.versionSelection.click();
@@ -221,14 +221,14 @@ class PlayPage {
221
221
  await publishIcon.click({ timeout: 30000 });
222
222
  }
223
223
  async assertScenarioCompleted(scenarioName) {
224
- await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.page
225
- .locator('tr', { hasText: scenarioName })
226
- .locator('text=Completed'), {
224
+ const scenarioRow = this.page.locator('tr', { hasText: scenarioName });
225
+ const rowRetryButton = scenarioRow.getByRole('button', { name: 'Retry' });
226
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, scenarioRow.locator('text=Completed'), {
227
227
  totalTimeout: 90000,
228
228
  visibilityTimeout: 20000,
229
229
  postAction: async () => {
230
- if (await this.retryButton.isVisible()) {
231
- await this.retryButton.click();
230
+ if (await rowRetryButton.isVisible()) {
231
+ await rowRetryButton.click();
232
232
  }
233
233
  },
234
234
  });
@@ -4,7 +4,6 @@ const SM_8_8_1 = require("../../fixtures/SM-8.8");
4
4
  const test_1 = require("@playwright/test");
5
5
  const apiHelpers_1 = require("../../utils/apiHelpers");
6
6
  const randomName_1 = require("../../utils/randomName");
7
- SM_8_8_1.test.describe.configure({ mode: 'parallel' });
8
7
  SM_8_8_1.test.describe('API optimize SM Tests', () => {
9
8
  const baseUrl = process.env.CAMUNDA_OPTIMIZE_BASE_URL;
10
9
  (0, SM_8_8_1.test)('Dashboard Scenarios Flow Tests', async ({ request, browser }) => {
@@ -104,17 +103,19 @@ SM_8_8_1.test.describe('API optimize SM Tests', () => {
104
103
  (0, test_1.expect)([401, 404]).toContain(response.status());
105
104
  });
106
105
  await SM_8_8_1.test.step('Export existing dashboard successfully (200)', async () => {
107
- const response = await request.post(`${baseUrl}/api/public/export/dashboard/definition/json`, {
106
+ const response = await (0, apiHelpers_1.retryOn500)(() => request.post(`${baseUrl}/api/public/export/dashboard/definition/json`, {
108
107
  headers: {
109
108
  Authorization: optimizeBearerToken,
110
109
  'Content-Type': 'application/json',
111
110
  },
112
111
  data: [dashboardIdValue],
113
- });
112
+ }));
114
113
  await (0, apiHelpers_1.assertResponseStatus)(response, 200);
115
114
  });
116
115
  await SM_8_8_1.test.step('Delete dashboard successfully (200)', async () => {
117
- const response = await request.delete(`${baseUrl}/api/public/dashboard/${dashboardIdValue}`, { headers: { Authorization: optimizeBearerToken } });
116
+ const response = await (0, apiHelpers_1.retryOn500)(() => request.delete(`${baseUrl}/api/public/dashboard/${dashboardIdValue}`, {
117
+ headers: { Authorization: optimizeBearerToken },
118
+ }));
118
119
  await (0, apiHelpers_1.assertResponseStatus)(response, 200);
119
120
  });
120
121
  await SM_8_8_1.test.step('Verify dashboard not found after deletion (404/410/500)', async () => {
@@ -174,13 +175,13 @@ SM_8_8_1.test.describe('API optimize SM Tests', () => {
174
175
  (0, test_1.expect)(response.status()).toBe(401);
175
176
  });
176
177
  await SM_8_8_1.test.step('Export reports successfully (200)', async () => {
177
- const response = await request.post(`${baseUrl}/api/public/export/report/definition/json`, {
178
+ const response = await (0, apiHelpers_1.retryOn500)(() => request.post(`${baseUrl}/api/public/export/report/definition/json`, {
178
179
  headers: {
179
180
  Authorization: optimizeBearerToken,
180
181
  'Content-Type': 'application/json',
181
182
  },
182
183
  data: [reportId],
183
- });
184
+ }));
184
185
  await (0, apiHelpers_1.assertResponseStatus)(response, 200);
185
186
  const body = await response.json();
186
187
  (0, test_1.expect)(Array.isArray(body)).toBeTruthy();
@@ -4,6 +4,7 @@ import { Serializable } from 'playwright-core/types/structs';
4
4
  export declare function getApiRequestContext(): Promise<APIRequestContext>;
5
5
  export declare function assertResponseStatus(response: APIResponse | Response, status: number): Promise<void>;
6
6
  export declare function sendRequestAndAssertResponse(request: APIRequestContext, url: string, requestBody?: string | Buffer | Serializable, maxRetries?: number): Promise<void>;
7
+ export declare function retryOn500(fn: () => Promise<APIResponse>, maxAttempts?: number, delayMs?: number): Promise<APIResponse>;
7
8
  export declare function buildZeebeApiUrl(resourcePath: string, environmentOverride?: 'saas' | 'sm', clusterType?: string): string;
8
9
  export declare function authAPI(environment: 'saas'): Promise<string>;
9
10
  export declare function authAPI(environment: 'sm'): Promise<string>;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.updateCollectionScope = exports.createSingleProcessReport = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.createProcessInstance = exports.deployProcess = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.authAPI = exports.buildZeebeApiUrl = exports.sendRequestAndAssertResponse = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
6
+ exports.updateCollectionScope = exports.createSingleProcessReport = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.createProcessInstance = exports.deployProcess = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
7
7
  const test_1 = require("@playwright/test");
8
8
  const sleep_1 = require("./sleep");
9
9
  const fs_1 = __importDefault(require("fs"));
@@ -46,6 +46,16 @@ async function sendRequestAndAssertResponse(request, url, requestBody, maxRetrie
46
46
  }
47
47
  }
48
48
  exports.sendRequestAndAssertResponse = sendRequestAndAssertResponse;
49
+ async function retryOn500(fn, maxAttempts = 3, delayMs = 3000) {
50
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
51
+ const res = await fn();
52
+ if (res.status() !== 500 || attempt === maxAttempts)
53
+ return res;
54
+ await (0, sleep_1.sleep)(delayMs);
55
+ }
56
+ throw new Error('unreachable');
57
+ }
58
+ exports.retryOn500 = retryOn500;
49
59
  // ---- Cluster Credentials Helper ----
50
60
  function getClusterCredentials(clusterType) {
51
61
  if (!clusterType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.537",
3
+ "version": "0.0.539",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",