@camunda/e2e-test-suite 0.0.571 → 0.0.573
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/pages/8.9/UtilitiesPage.js +27 -4
- package/dist/pages/SM-8.10/IdentityTenantPage.js +47 -24
- package/dist/pages/SM-8.8/IdentityTenantPage.js +47 -24
- package/dist/pages/SM-8.8/OperateProcessesPage.js +9 -3
- package/dist/pages/SM-8.9/IdentityTenantPage.js +47 -24
- package/dist/tests/8.9/api-tests-v2.spec.js +1 -1
- package/dist/tests/8.9/operate-access-flow.spec.js +68 -7
- package/dist/tests/8.9/optimize-api-tests.spec.js +705 -59
- package/dist/utils/apiHelpers.js +41 -7
- package/dist/utils/utils.js +2 -2
- package/package.json +1 -1
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -410,14 +410,48 @@ async function createStringClusterVariable(authToken, environment = 'saas', cust
|
|
|
410
410
|
}
|
|
411
411
|
exports.createStringClusterVariable = createStringClusterVariable;
|
|
412
412
|
async function getOptimizeCoockie(page) {
|
|
413
|
-
|
|
413
|
+
const optimizeUrl = process.env.CAMUNDA_OPTIMIZE_BASE_URL;
|
|
414
|
+
const maxLoginAttempts = 3;
|
|
415
|
+
// Auth0 can fail or rate-limit concurrent logins. Retry the whole flow if
|
|
416
|
+
// loginToApp throws (e.g. waitForURL times out after a bad Auth0 redirect).
|
|
417
|
+
for (let loginAttempt = 0; loginAttempt < maxLoginAttempts; loginAttempt++) {
|
|
418
|
+
try {
|
|
419
|
+
await page.goto('about:blank');
|
|
420
|
+
await page.context().clearCookies();
|
|
421
|
+
await (0, utils_1.loginToApp)(optimizeUrl, page);
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
catch (error) {
|
|
425
|
+
if (loginAttempt < maxLoginAttempts - 1) {
|
|
426
|
+
console.warn(`getOptimizeCoockie: login attempt ${loginAttempt + 1} failed, retrying after backoff...`, error);
|
|
427
|
+
await page.goto('about:blank');
|
|
428
|
+
await page.waitForTimeout(5000 * (loginAttempt + 1));
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
throw error;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
414
435
|
const context = page.context();
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
436
|
+
// Optimize sets its session cookies asynchronously after the Auth0 redirect.
|
|
437
|
+
// Poll storage state until both cookies are present (up to ~30 s).
|
|
438
|
+
let serviceTokenCookie;
|
|
439
|
+
let authTokenCookie;
|
|
440
|
+
for (let i = 0; i < 10; i++) {
|
|
441
|
+
const tempFile = path_1.default.join(os_1.default.tmpdir(), `.auth_optimize_${Date.now()}_${Math.random().toString(36).slice(2)}`);
|
|
442
|
+
await context.storageState({ path: tempFile });
|
|
443
|
+
const authData = JSON.parse(fs_1.default.readFileSync(tempFile, 'utf8'));
|
|
444
|
+
fs_1.default.unlinkSync(tempFile);
|
|
445
|
+
serviceTokenCookie = authData.cookies.find((cookie) => cookie.name === 'X-Optimize-Service-Token_0');
|
|
446
|
+
authTokenCookie = authData.cookies.find((cookie) => cookie.name === 'X-Optimize-Authorization_0');
|
|
447
|
+
if (serviceTokenCookie?.value && authTokenCookie?.value) {
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
if (i < 9) {
|
|
451
|
+
console.warn(`getOptimizeCoockie: cookies not ready yet (attempt ${i + 1}/10), retrying in 3 s...`);
|
|
452
|
+
await page.waitForTimeout(3000);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
421
455
|
const optimizeServiceToken = serviceTokenCookie?.value || '';
|
|
422
456
|
const optimizeAuthToken = authTokenCookie?.value || '';
|
|
423
457
|
const optimizeCookie = `X-Optimize-Service-Token_0=${optimizeServiceToken}; X-Optimize-Authorization_0=${optimizeAuthToken}`;
|
package/dist/utils/utils.js
CHANGED
|
@@ -12,9 +12,9 @@ async function loginToApp(appName, page) {
|
|
|
12
12
|
await (0, test_1.expect)(loginPage.usernameInput).toHaveValue(process.env.C8_USERNAME);
|
|
13
13
|
await (0, test_1.expect)(loginPage.loginMessage).toBeVisible();
|
|
14
14
|
await loginPage.clickContinueButton();
|
|
15
|
-
await (0, test_1.expect)(loginPage.passwordInput).toBeVisible({ timeout:
|
|
15
|
+
await (0, test_1.expect)(loginPage.passwordInput).toBeVisible({ timeout: 90000 });
|
|
16
16
|
await loginPage.fillPassword(process.env.C8_PASSWORD);
|
|
17
|
-
await (0, test_1.expect)(loginPage.passwordHeading).toBeVisible();
|
|
17
|
+
await (0, test_1.expect)(loginPage.passwordHeading).toBeVisible({ timeout: 90000 });
|
|
18
18
|
await loginPage.clickLoginButton();
|
|
19
19
|
await page.waitForURL((url) => url.toString().startsWith(appName), {
|
|
20
20
|
timeout: 60000,
|