@camunda/e2e-test-suite 0.0.915 → 0.0.916
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.
|
@@ -2,12 +2,14 @@ import { IdentityPage } from '../SM-8.7/IdentityPage';
|
|
|
2
2
|
import { NavigationPage } from '../SM-8.7/NavigationPage';
|
|
3
3
|
import { ModelerHomePage } from './ModelerHomePage';
|
|
4
4
|
import { ModelerCreatePage } from './ModelerCreatePage';
|
|
5
|
-
import { Locator, Page } from '@playwright/test';
|
|
5
|
+
import { BrowserContext, Locator, Page } from '@playwright/test';
|
|
6
6
|
import { TaskDetailsPage } from '../SM-8.7/TaskDetailsPage';
|
|
7
7
|
import { TaskPanelPage } from '../SM-8.7/TaskPanelPage';
|
|
8
|
+
import { LoginPage } from '../SM-8.7/LoginPage';
|
|
8
9
|
import { ConnectorSettingsPage } from '../SM-8.7/ConnectorSettingsPage';
|
|
9
10
|
import { ConnectorMarketplacePage } from '../SM-8.7/ConnectorMarketplacePage';
|
|
10
11
|
import { ConnectorTemplatePage } from './ConnectorTemplatePage';
|
|
12
|
+
export declare function loginToTasklistWithRetry(page: Page, context: BrowserContext, loginPage: LoginPage, taskPanelPage: TaskPanelPage, username: string, password: string, maxAttempts?: number, attemptTimeout?: number): Promise<void>;
|
|
11
13
|
export declare function deleteAllUserGroups(navigationPage: NavigationPage, identityPage: IdentityPage): Promise<void>;
|
|
12
14
|
export declare function runMultipleProcesses(modelerHomePage: ModelerHomePage, modelerCreatePage: ModelerCreatePage, numberOfProcesses: number, processName: string, processId?: string): Promise<void>;
|
|
13
15
|
export declare function createAndRunProcess(modelerHomePage: ModelerHomePage, modelerCreatePage: ModelerCreatePage, processName: string, processId?: string): Promise<void>;
|
|
@@ -1,9 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.modelDiagramFromFile = exports.modelAndRunConnectorsTimerEventDiagram = exports.assertPageTextWithRetry = exports.assertLocatorVisibleWithRetry = exports.modelWebhookConnector = exports.modelIntermediateWebhookConnector = exports.modelRestConnector = exports.completeTaskWithRetry = exports.createAndRunProcess = exports.runMultipleProcesses = exports.deleteAllUserGroups = void 0;
|
|
3
|
+
exports.modelDiagramFromFile = exports.modelAndRunConnectorsTimerEventDiagram = exports.assertPageTextWithRetry = exports.assertLocatorVisibleWithRetry = exports.modelWebhookConnector = exports.modelIntermediateWebhookConnector = exports.modelRestConnector = exports.completeTaskWithRetry = exports.createAndRunProcess = exports.runMultipleProcesses = exports.deleteAllUserGroups = exports.loginToTasklistWithRetry = void 0;
|
|
4
4
|
const test_1 = require("@playwright/test");
|
|
5
5
|
const fileUpload_1 = require("../../utils/fileUpload");
|
|
6
6
|
const sleep_1 = require("../../utils/sleep");
|
|
7
|
+
// Tasklist renders "No permission for Tasklist" as a terminal page: it reads the
|
|
8
|
+
// permissions off the token minted at login and never re-evaluates them, so a
|
|
9
|
+
// user whose Identity role assignment has not propagated yet stays stuck there.
|
|
10
|
+
// Recovering therefore needs a fresh authentication, not a longer wait.
|
|
11
|
+
async function loginToTasklistWithRetry(page, context, loginPage, taskPanelPage, username, password, maxAttempts = 3, attemptTimeout = 60000) {
|
|
12
|
+
const noTasklistPermission = page.getByText('No permission for Tasklist - Please check your configuration.');
|
|
13
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
14
|
+
await loginPage.fillUsername(username);
|
|
15
|
+
await (0, test_1.expect)(loginPage.usernameInput).toHaveValue(username);
|
|
16
|
+
await loginPage.fillPassword(password);
|
|
17
|
+
await loginPage.clickLoginButton();
|
|
18
|
+
if (attempt === maxAttempts) {
|
|
19
|
+
await (0, test_1.expect)(taskPanelPage.tasklistBanner).toBeVisible({
|
|
20
|
+
timeout: attemptTimeout,
|
|
21
|
+
});
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const reachedTasklist = await taskPanelPage.tasklistBanner
|
|
25
|
+
.waitFor({ state: 'visible', timeout: attemptTimeout })
|
|
26
|
+
.then(() => true)
|
|
27
|
+
.catch(() => false);
|
|
28
|
+
if (reachedTasklist) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const permissionDenied = await noTasklistPermission
|
|
32
|
+
.isVisible()
|
|
33
|
+
.catch(() => false);
|
|
34
|
+
console.warn(`loginToTasklistWithRetry: attempt ${attempt} for "${username}" did not ` +
|
|
35
|
+
`reach Tasklist${permissionDenied ? ' (no-permission page)' : ''}. ` +
|
|
36
|
+
're-authenticating to obtain a freshly minted token.');
|
|
37
|
+
await context.clearCookies();
|
|
38
|
+
await page.goto('/tasklist', { waitUntil: 'domcontentloaded' });
|
|
39
|
+
await loginPage.detectLoginForm();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.loginToTasklistWithRetry = loginToTasklistWithRetry;
|
|
7
43
|
async function deleteAllUserGroups(navigationPage, identityPage) {
|
|
8
44
|
await navigationPage.goToIdentity();
|
|
9
45
|
await identityPage.clickGroupsTab();
|
package/dist/test-setup.js
CHANGED
|
@@ -10,11 +10,25 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
10
10
|
const constants_1 = require("./utils/constants");
|
|
11
11
|
async function captureScreenshot(page, testInfo) {
|
|
12
12
|
const screenshotPath = `test-results/screenshots/screenshot-${(0, crypto_1.randomUUID)()}.png`;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
try {
|
|
14
|
+
await page.screenshot({
|
|
15
|
+
path: screenshotPath,
|
|
16
|
+
fullPage: true,
|
|
17
|
+
timeout: 60000,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch (fullPageError) {
|
|
21
|
+
console.warn(`captureScreenshot: full-page capture failed (${fullPageError}). ` +
|
|
22
|
+
'Falling back to a viewport-only screenshot.');
|
|
23
|
+
try {
|
|
24
|
+
await page.screenshot({ path: screenshotPath, timeout: 30000 });
|
|
25
|
+
}
|
|
26
|
+
catch (viewportError) {
|
|
27
|
+
console.warn(`captureScreenshot: viewport capture also failed (${viewportError}). ` +
|
|
28
|
+
'Continuing without a screenshot; the test verdict is unaffected.');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
18
32
|
await testInfo.attach('screenshot', {
|
|
19
33
|
path: screenshotPath,
|
|
20
34
|
contentType: 'image/png',
|
|
@@ -335,11 +335,7 @@ SM_8_7_1.test.describe.parallel('HTO User Flow Tests', () => {
|
|
|
335
335
|
await SM_8_7_1.test.step('Logout and Login with "lisa" User and Check Tasks in Tasklist', async () => {
|
|
336
336
|
await settingsPage.clickOpenSettingsButton();
|
|
337
337
|
await settingsPage.clickLogoutButton();
|
|
338
|
-
await
|
|
339
|
-
await (0, test_1.expect)(loginPage.usernameInput).toHaveValue(navigationPage.user1);
|
|
340
|
-
await loginPage.fillPassword('lisa');
|
|
341
|
-
await loginPage.clickLoginButton();
|
|
342
|
-
await (0, test_1.expect)(taskPanelPage.tasklistBanner).toBeVisible({ timeout: 120000 });
|
|
338
|
+
await (0, UtlitiesPage_1.loginToTasklistWithRetry)(page, context, loginPage, taskPanelPage, navigationPage.user1, 'lisa');
|
|
343
339
|
});
|
|
344
340
|
await SM_8_7_1.test.step('Navigate to Tasklist and Assert User Tasks ', async () => {
|
|
345
341
|
await (0, test_1.expect)(page.getByText(`${userTaskName}1`)).toBeVisible({
|
|
@@ -352,11 +348,7 @@ SM_8_7_1.test.describe.parallel('HTO User Flow Tests', () => {
|
|
|
352
348
|
await SM_8_7_1.test.step('Logout and Login with "bart" User and Check Tasks in Tasklist', async () => {
|
|
353
349
|
await settingsPage.clickOpenSettingsButton();
|
|
354
350
|
await settingsPage.clickLogoutButton();
|
|
355
|
-
await
|
|
356
|
-
await (0, test_1.expect)(loginPage.usernameInput).toHaveValue(navigationPage.user2);
|
|
357
|
-
await loginPage.fillPassword('bart');
|
|
358
|
-
await loginPage.clickLoginButton();
|
|
359
|
-
await (0, test_1.expect)(taskPanelPage.tasklistBanner).toBeVisible({ timeout: 120000 });
|
|
351
|
+
await (0, UtlitiesPage_1.loginToTasklistWithRetry)(page, context, loginPage, taskPanelPage, navigationPage.user2, 'bart');
|
|
360
352
|
});
|
|
361
353
|
await SM_8_7_1.test.step('Navigate to Tasklist and Assert User Tasks ', async () => {
|
|
362
354
|
await (0, test_1.expect)(page.getByText(`${userTaskName}1`)).not.toBeVisible({
|