@camunda/e2e-test-suite 0.0.537 → 0.0.538
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.
|
@@ -221,14 +221,14 @@ class PlayPage {
|
|
|
221
221
|
await publishIcon.click({ timeout: 30000 });
|
|
222
222
|
}
|
|
223
223
|
async assertScenarioCompleted(scenarioName) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
|
231
|
-
await
|
|
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}`, {
|
|
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>;
|
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -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) {
|