@camunda/e2e-test-suite 0.0.1325 → 0.0.1327
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/.github/c8_versions.json +2 -1
- package/README.md +3 -0
- package/dist/fixtures/c8Run-8.11.d.ts +20 -0
- package/dist/fixtures/c8Run-8.11.js +56 -0
- package/dist/pages/c8Run-8.11/OperateHomePage.d.ts +22 -0
- package/dist/pages/c8Run-8.11/OperateHomePage.js +154 -0
- package/dist/pages/c8Run-8.11/OperateLoginPage.d.ts +14 -0
- package/dist/pages/c8Run-8.11/OperateLoginPage.js +37 -0
- package/dist/pages/c8Run-8.11/OperateProcessInstancePage.d.ts +28 -0
- package/dist/pages/c8Run-8.11/OperateProcessInstancePage.js +122 -0
- package/dist/pages/c8Run-8.11/OperateProcessesPage.d.ts +22 -0
- package/dist/pages/c8Run-8.11/OperateProcessesPage.js +109 -0
- package/dist/pages/c8Run-8.11/TaskDetailsPage.d.ts +65 -0
- package/dist/pages/c8Run-8.11/TaskDetailsPage.js +246 -0
- package/dist/pages/c8Run-8.11/TaskListLoginPage.d.ts +16 -0
- package/dist/pages/c8Run-8.11/TaskListLoginPage.js +52 -0
- package/dist/pages/c8Run-8.11/TaskPanelPage.d.ts +23 -0
- package/dist/pages/c8Run-8.11/TaskPanelPage.js +167 -0
- package/dist/pages/c8Run-8.11/UtilitiesPage.d.ts +8 -0
- package/dist/pages/c8Run-8.11/UtilitiesPage.js +114 -0
- package/dist/tests/c8Run-8.11/api-tests-v2.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/api-tests-v2.spec.js +57 -0
- package/dist/tests/c8Run-8.11/connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/connectors-user-flows.spec.js +120 -0
- package/dist/tests/c8Run-8.11/hto-user-flows.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/hto-user-flows.spec.js +166 -0
- package/dist/tests/c8Run-8.11/login.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/login.spec.js +21 -0
- package/dist/tests/c8Run-8.11/mcp-connector-authentication.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/mcp-connector-authentication.spec.js +75 -0
- package/dist/tests/c8Run-8.11/mcp-meta.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/mcp-meta.spec.js +73 -0
- package/dist/tests/c8Run-8.11/mcp-user-flows.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/mcp-user-flows.spec.js +110 -0
- package/package.json +1 -1
- package/playwright.config.ts +13 -0
package/.github/c8_versions.json
CHANGED
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ For the Camunda C8Run offering, the test suite supports following versions:
|
|
|
43
43
|
- 8.8.X
|
|
44
44
|
- 8.9.X
|
|
45
45
|
- 8.10.X
|
|
46
|
+
- 8.11.X
|
|
46
47
|
|
|
47
48
|
**Java runtime version coverage (nightly and release workflows):**
|
|
48
49
|
|
|
@@ -54,6 +55,7 @@ Packaging always uses Java 25. The runtime JDK is varied per version to ensure c
|
|
|
54
55
|
| 8.8.X | 21 |
|
|
55
56
|
| 8.9.X | 21, 25 |
|
|
56
57
|
| 8.10.X | 21, 25 |
|
|
58
|
+
| 8.11.X | 21, 25 |
|
|
57
59
|
|
|
58
60
|
Only LTS Java releases (21, 25) are included. Non-LTS versions (22, 23, 24) are intentionally excluded as they have a 6-month lifetime and are not supported long-term.
|
|
59
61
|
|
|
@@ -509,6 +511,7 @@ By following this convention, we ensure **clarity, consistency, and alignment wi
|
|
|
509
511
|
| 8.8 | Yes | ubuntu-latest only | ubuntu, macOS, windows | chromium-v1 (ES) + chromium-v2 (ES) | chromium-v2 (ES) | 21 |
|
|
510
512
|
| 8.9 | No | — | — | chromium-v2 (RDBMS) | — | 21, 25 |
|
|
511
513
|
| 8.10 | No | — | — | chromium-v2 (RDBMS) | — | 21, 25 |
|
|
514
|
+
| 8.11 | No | — | — | chromium-v2 (RDBMS) | — | 21, 25 |
|
|
512
515
|
|
|
513
516
|
## Viewing Test Results
|
|
514
517
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import AxeBuilder from '@axe-core/playwright';
|
|
2
|
+
import { OperateLoginPage } from '../pages/c8Run-8.11/OperateLoginPage';
|
|
3
|
+
import { OperateHomePage } from '../pages/c8Run-8.11/OperateHomePage';
|
|
4
|
+
import { TaskPanelPage } from '../pages/c8Run-8.11/TaskPanelPage';
|
|
5
|
+
import { TaskListLoginPage } from '../pages/c8Run-8.11/TaskListLoginPage';
|
|
6
|
+
import { OperateProcessesPage } from '../pages/c8Run-8.11/OperateProcessesPage';
|
|
7
|
+
import { OperateProcessInstancePage } from '../pages/c8Run-8.11/OperateProcessInstancePage';
|
|
8
|
+
import { TaskDetailsPage } from '../pages/c8Run-8.11/TaskDetailsPage';
|
|
9
|
+
type PlaywrightFixtures = {
|
|
10
|
+
makeAxeBuilder: () => AxeBuilder;
|
|
11
|
+
operateLoginPage: OperateLoginPage;
|
|
12
|
+
operateHomePage: OperateHomePage;
|
|
13
|
+
taskListLoginPage: TaskListLoginPage;
|
|
14
|
+
taskPanelPage: TaskPanelPage;
|
|
15
|
+
operateProcessesPage: OperateProcessesPage;
|
|
16
|
+
operateProcessInstancePage: OperateProcessInstancePage;
|
|
17
|
+
taskDetailsPage: TaskDetailsPage;
|
|
18
|
+
};
|
|
19
|
+
declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & PlaywrightFixtures, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
20
|
+
export { test };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
|
|
4
|
+
* one or more contributor license agreements. See the NOTICE file distributed
|
|
5
|
+
* with this work for additional information regarding copyright ownership.
|
|
6
|
+
* Licensed under the Camunda License 1.0. You may not use this file
|
|
7
|
+
* except in compliance with the Camunda License 1.0.
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.test = void 0;
|
|
14
|
+
const test_1 = require("@playwright/test");
|
|
15
|
+
const playwright_1 = __importDefault(require("@axe-core/playwright"));
|
|
16
|
+
const OperateLoginPage_1 = require("../pages/c8Run-8.11/OperateLoginPage");
|
|
17
|
+
const OperateHomePage_1 = require("../pages/c8Run-8.11/OperateHomePage");
|
|
18
|
+
const TaskPanelPage_1 = require("../pages/c8Run-8.11/TaskPanelPage");
|
|
19
|
+
const TaskListLoginPage_1 = require("../pages/c8Run-8.11/TaskListLoginPage");
|
|
20
|
+
const OperateProcessesPage_1 = require("../pages/c8Run-8.11/OperateProcessesPage");
|
|
21
|
+
const OperateProcessInstancePage_1 = require("../pages/c8Run-8.11/OperateProcessInstancePage");
|
|
22
|
+
const TaskDetailsPage_1 = require("../pages/c8Run-8.11/TaskDetailsPage");
|
|
23
|
+
const test = test_1.test.extend({
|
|
24
|
+
makeAxeBuilder: async ({ page }, use) => {
|
|
25
|
+
const makeAxeBuilder = () => new playwright_1.default({ page }).withTags([
|
|
26
|
+
'best-practice',
|
|
27
|
+
'wcag2a',
|
|
28
|
+
'wcag2aa',
|
|
29
|
+
'cat.semantics',
|
|
30
|
+
'cat.forms',
|
|
31
|
+
]);
|
|
32
|
+
await use(makeAxeBuilder);
|
|
33
|
+
},
|
|
34
|
+
operateLoginPage: async ({ page }, use) => {
|
|
35
|
+
await use(new OperateLoginPage_1.OperateLoginPage(page));
|
|
36
|
+
},
|
|
37
|
+
operateHomePage: async ({ page }, use) => {
|
|
38
|
+
await use(new OperateHomePage_1.OperateHomePage(page));
|
|
39
|
+
},
|
|
40
|
+
taskListLoginPage: async ({ page }, use) => {
|
|
41
|
+
await use(new TaskListLoginPage_1.TaskListLoginPage(page));
|
|
42
|
+
},
|
|
43
|
+
taskPanelPage: async ({ page }, use) => {
|
|
44
|
+
await use(new TaskPanelPage_1.TaskPanelPage(page));
|
|
45
|
+
},
|
|
46
|
+
operateProcessesPage: async ({ page }, use) => {
|
|
47
|
+
await use(new OperateProcessesPage_1.OperateProcessesPage(page));
|
|
48
|
+
},
|
|
49
|
+
operateProcessInstancePage: async ({ page }, use) => {
|
|
50
|
+
await use(new OperateProcessInstancePage_1.OperateProcessInstancePage(page));
|
|
51
|
+
},
|
|
52
|
+
taskDetailsPage: async ({ page }, use) => {
|
|
53
|
+
await use(new TaskDetailsPage_1.TaskDetailsPage(page));
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
exports.test = test;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class OperateHomePage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly operateBanner: Locator;
|
|
5
|
+
readonly processesTab: Locator;
|
|
6
|
+
readonly informationDialog: Locator;
|
|
7
|
+
readonly editVariableButton: Locator;
|
|
8
|
+
readonly variableValueInput: Locator;
|
|
9
|
+
readonly variableValueEditor: Locator;
|
|
10
|
+
readonly variableValueContent: Locator;
|
|
11
|
+
readonly saveVariableButton: Locator;
|
|
12
|
+
readonly editVariableSpinner: Locator;
|
|
13
|
+
constructor(page: Page);
|
|
14
|
+
operateBannerIsVisible(): Promise<void>;
|
|
15
|
+
clickProcessesTab(): Promise<void>;
|
|
16
|
+
clickEditVariableButton(variableName: string): Promise<void>;
|
|
17
|
+
clickVariableValueInput(): Promise<void>;
|
|
18
|
+
clearVariableValueInput(): Promise<void>;
|
|
19
|
+
fillVariableValueInput(newValue: string): Promise<void>;
|
|
20
|
+
clickSaveVariableButton(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export { OperateHomePage };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperateHomePage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
class OperateHomePage {
|
|
6
|
+
page;
|
|
7
|
+
operateBanner;
|
|
8
|
+
processesTab;
|
|
9
|
+
informationDialog;
|
|
10
|
+
editVariableButton;
|
|
11
|
+
variableValueInput;
|
|
12
|
+
variableValueEditor;
|
|
13
|
+
variableValueContent;
|
|
14
|
+
saveVariableButton;
|
|
15
|
+
editVariableSpinner;
|
|
16
|
+
constructor(page) {
|
|
17
|
+
this.page = page;
|
|
18
|
+
// Operate renders the Design System header (AppHeaderV2) whenever the
|
|
19
|
+
// `navV2Enabled` client config is on -- its home link is
|
|
20
|
+
// aria-label="Camunda Operate" instead of the legacy shell's
|
|
21
|
+
// "Camunda logo Operate" text. Match either so the banner resolves with
|
|
22
|
+
// the flag on or off.
|
|
23
|
+
this.operateBanner = page
|
|
24
|
+
.getByRole('link', { name: 'Camunda logo Operate' })
|
|
25
|
+
.or(page.getByRole('link', { name: 'Camunda Operate', exact: true }))
|
|
26
|
+
.first();
|
|
27
|
+
this.processesTab = page.getByRole('link', { name: 'Processes' });
|
|
28
|
+
this.informationDialog = page.getByRole('button', {
|
|
29
|
+
name: 'Close this dialog',
|
|
30
|
+
});
|
|
31
|
+
this.editVariableButton = page.getByTestId('edit-variable-button');
|
|
32
|
+
this.variableValueInput = page.getByTestId('edit-variable-value');
|
|
33
|
+
// "The row is in write mode." InlineJsonEditor renders a CodeMirror
|
|
34
|
+
// instance carrying this test id only on its editable branch; the
|
|
35
|
+
// read-only branch renders ReadOnlyEditor instead, with no CodeMirror
|
|
36
|
+
// at all. The product's own suite resolves the editor the same way --
|
|
37
|
+
// see camunda/camunda
|
|
38
|
+
// qa/c8-orchestration-cluster-e2e-test-suite/pages/OperateHomePage.ts.
|
|
39
|
+
this.variableValueEditor = page.getByTestId('code-mirror-editor');
|
|
40
|
+
// The editable node *inside* that container. CodeMirror puts its
|
|
41
|
+
// contenteditable on `.cm-content`, so that -- not the container -- is
|
|
42
|
+
// what takes focus and what holds the text. Asserting focus on the
|
|
43
|
+
// container reports `inactive` even when the caret is correctly placed,
|
|
44
|
+
// because clicking the container focuses its contenteditable child.
|
|
45
|
+
this.variableValueContent = this.variableValueEditor
|
|
46
|
+
.locator('.cm-content')
|
|
47
|
+
.first();
|
|
48
|
+
// Carbon icon-only buttons expose their accessible name via aria-labelledby
|
|
49
|
+
// (tooltip text "Save") which overrides aria-label for computed accessible name.
|
|
50
|
+
// Use a CSS attribute selector to match the raw aria-label attribute directly.
|
|
51
|
+
this.saveVariableButton = page.locator('[aria-label="Save variable"]');
|
|
52
|
+
this.editVariableSpinner = page
|
|
53
|
+
.getByTestId('variable-operation-spinner')
|
|
54
|
+
.locator('circle')
|
|
55
|
+
.nth(1);
|
|
56
|
+
}
|
|
57
|
+
async operateBannerIsVisible() {
|
|
58
|
+
await (0, test_1.expect)(this.operateBanner).toBeVisible({ timeout: 30000 });
|
|
59
|
+
}
|
|
60
|
+
async clickProcessesTab() {
|
|
61
|
+
const maxRetries = 3;
|
|
62
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
63
|
+
try {
|
|
64
|
+
await (0, test_1.expect)(this.processesTab).toBeVisible({ timeout: 30000 });
|
|
65
|
+
await this.processesTab.click({ timeout: 30000 });
|
|
66
|
+
await (0, test_1.expect)(this.page.locator('label').filter({ hasText: 'Completed' }).first()).toBeVisible();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
throw new Error(`Failed to click the processes tab after ${maxRetries} attempts.`);
|
|
74
|
+
}
|
|
75
|
+
async clickEditVariableButton(variableName) {
|
|
76
|
+
const editVariableButton = this.page
|
|
77
|
+
.getByTestId('variable-' + variableName)
|
|
78
|
+
.getByLabel('Edit');
|
|
79
|
+
await (0, test_1.expect)(editVariableButton).toBeVisible({ timeout: 30000 });
|
|
80
|
+
// The caller reaches this straight out of activeIconAssertion, which
|
|
81
|
+
// reloads the page while it polls for the status icon, so the variables
|
|
82
|
+
// panel is usually still mounting when the click lands. A click during
|
|
83
|
+
// that render resolves without raising and without effect: the row stays
|
|
84
|
+
// read-only, InlineJsonEditor keeps rendering ReadOnlyEditor, and the
|
|
85
|
+
// editor the next step needs is never created. Retry until write mode is
|
|
86
|
+
// actually active rather than asserting on the editor afterwards and
|
|
87
|
+
// reporting the dropped click as a missing element.
|
|
88
|
+
//
|
|
89
|
+
// Only click while the row is still read-only. Entering write mode
|
|
90
|
+
// replaces the Edit control, so once the click has taken, clicking again
|
|
91
|
+
// just waits out its timeout against an element that is gone or still
|
|
92
|
+
// being replaced -- which is what the retry did on the slower macOS and
|
|
93
|
+
// Windows runners, where the editor needs longer to mount than one
|
|
94
|
+
// iteration allowed: it re-clicked, exhausted the budget, and raised the
|
|
95
|
+
// click timeout instead of the state the row was actually in. Probing
|
|
96
|
+
// first keeps the retry for a genuinely dropped click and turns the slow
|
|
97
|
+
// case into what it should be, a wait.
|
|
98
|
+
await (0, test_1.expect)(async () => {
|
|
99
|
+
if (await editVariableButton.isVisible()) {
|
|
100
|
+
await editVariableButton.click({ timeout: 10000 });
|
|
101
|
+
}
|
|
102
|
+
await (0, test_1.expect)(this.variableValueEditor).toBeVisible({ timeout: 15000 });
|
|
103
|
+
}).toPass({ timeout: 90000 });
|
|
104
|
+
}
|
|
105
|
+
async clickVariableValueInput() {
|
|
106
|
+
await this.variableValueInput.click();
|
|
107
|
+
}
|
|
108
|
+
async clearVariableValueInput() {
|
|
109
|
+
await this.variableValueInput.clear();
|
|
110
|
+
}
|
|
111
|
+
async fillVariableValueInput(newValue) {
|
|
112
|
+
// Operate migrated this editor from Monaco to CodeMirror
|
|
113
|
+
// (@uiw/react-codemirror; see camunda/camunda#62782) -- the editable
|
|
114
|
+
// region is now a div.cm-content, not .monaco-editor, and it no longer
|
|
115
|
+
// exposes a Monaco-style .cursor element.
|
|
116
|
+
//
|
|
117
|
+
// clickEditVariableButton has already established that the editor exists
|
|
118
|
+
// -- it retries the Edit click until it does -- so this only has to put
|
|
119
|
+
// the caret in it. Do not wait on focus arriving by itself: autoFocus
|
|
120
|
+
// fires when the editor mounts, which is before this runs, so a wait for
|
|
121
|
+
// `:focus` can only ever observe focus that has already been placed
|
|
122
|
+
// elsewhere. Click to focus, then confirm. Both act on the
|
|
123
|
+
// contenteditable rather than its container, which cannot hold focus.
|
|
124
|
+
await (0, test_1.expect)(this.variableValueContent).toBeVisible({ timeout: 30000 });
|
|
125
|
+
await this.variableValueContent.click();
|
|
126
|
+
await (0, test_1.expect)(this.variableValueContent).toBeFocused({ timeout: 10000 });
|
|
127
|
+
// Insert the COMPLETE JSON value, both quotes included. Monaco used to
|
|
128
|
+
// auto-close a lone opening quote, so the old recipe inserted only
|
|
129
|
+
// `"value`; CodeMirror's closeBrackets extension ignores insertions
|
|
130
|
+
// longer than two characters, which left the string unterminated. That
|
|
131
|
+
// is invalid JSON, and EditButtons.tsx keeps "Save variable" disabled
|
|
132
|
+
// while hasValidationErrors -- the nightly timed out clicking a button
|
|
133
|
+
// that could never become enabled. Same recipe as
|
|
134
|
+
// pages/8.10/OperateHomePage.ts: select all, clear, insert the whole
|
|
135
|
+
// value in a single input event (no intermediate state to race, and
|
|
136
|
+
// multi-character insertText is not subject to auto-close), then
|
|
137
|
+
// confirm the editor actually holds it.
|
|
138
|
+
// ControlOrMeta+A (not Control+A) so select-all also works on Mac --
|
|
139
|
+
// same cross-platform shortcut the sibling page objects use for this
|
|
140
|
+
// exact operation (pages/SM-8.10/OperateHomePage.ts,
|
|
141
|
+
// pages/8.9/OCIdentityClusterVariablesPage.ts).
|
|
142
|
+
await this.page.keyboard.press('ControlOrMeta+A');
|
|
143
|
+
await this.page.keyboard.press('Backspace');
|
|
144
|
+
const jsonValue = JSON.stringify(newValue);
|
|
145
|
+
await this.page.keyboard.insertText(jsonValue);
|
|
146
|
+
await (0, test_1.expect)(this.variableValueContent).toContainText(jsonValue, {
|
|
147
|
+
timeout: 10000,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async clickSaveVariableButton() {
|
|
151
|
+
await this.saveVariableButton.click({ timeout: 30000 });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.OperateHomePage = OperateHomePage;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class OperateLoginPage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly usernameInput: Locator;
|
|
5
|
+
readonly passwordInput: Locator;
|
|
6
|
+
readonly loginButton: Locator;
|
|
7
|
+
constructor(page: Page);
|
|
8
|
+
fillUsername(username: string): Promise<void>;
|
|
9
|
+
clickUsername(): Promise<void>;
|
|
10
|
+
fillPassword(password: string): Promise<void>;
|
|
11
|
+
clickLoginButton(): Promise<void>;
|
|
12
|
+
login(username: string, password: string): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export { OperateLoginPage };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperateLoginPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
class OperateLoginPage {
|
|
6
|
+
page;
|
|
7
|
+
usernameInput;
|
|
8
|
+
passwordInput;
|
|
9
|
+
loginButton;
|
|
10
|
+
constructor(page) {
|
|
11
|
+
this.page = page;
|
|
12
|
+
this.usernameInput = page.getByLabel('Username');
|
|
13
|
+
this.passwordInput = page.getByRole('textbox', { name: 'password' });
|
|
14
|
+
this.loginButton = page.getByRole('button', { name: 'Login' });
|
|
15
|
+
}
|
|
16
|
+
async fillUsername(username) {
|
|
17
|
+
await this.usernameInput.fill(username);
|
|
18
|
+
}
|
|
19
|
+
async clickUsername() {
|
|
20
|
+
await this.usernameInput.click({ timeout: 60000 });
|
|
21
|
+
}
|
|
22
|
+
async fillPassword(password) {
|
|
23
|
+
await this.passwordInput.fill(password);
|
|
24
|
+
}
|
|
25
|
+
async clickLoginButton() {
|
|
26
|
+
await this.loginButton.click({ timeout: 60000 });
|
|
27
|
+
}
|
|
28
|
+
async login(username, password) {
|
|
29
|
+
await (0, test_1.expect)(this.usernameInput).toBeVisible({ timeout: 180000 });
|
|
30
|
+
await this.clickUsername();
|
|
31
|
+
await this.fillUsername(username);
|
|
32
|
+
await this.fillPassword(password);
|
|
33
|
+
await (0, test_1.expect)(this.loginButton).toBeVisible({ timeout: 120000 });
|
|
34
|
+
await this.clickLoginButton();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.OperateLoginPage = OperateLoginPage;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class OperateProcessInstancePage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly diagram: Locator;
|
|
5
|
+
readonly completedIcon: Locator;
|
|
6
|
+
readonly diagramSpinner: Locator;
|
|
7
|
+
readonly activeIcon: Locator;
|
|
8
|
+
readonly variablesList: Locator;
|
|
9
|
+
readonly messageVariable: Locator;
|
|
10
|
+
readonly statusVariable: Locator;
|
|
11
|
+
constructor(page: Page);
|
|
12
|
+
connectorResultVariableName(name: string): Promise<Locator>;
|
|
13
|
+
connectorResultVariableValue(variableName: string): Promise<Locator>;
|
|
14
|
+
private assertInstanceStatusIcon;
|
|
15
|
+
completedIconAssertion(): Promise<void>;
|
|
16
|
+
activeIconAssertion(): Promise<void>;
|
|
17
|
+
getProcessVariableValue(variableName: string): Promise<Locator>;
|
|
18
|
+
assertProcessVariableContainsText(variableName: string, text: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the JSON value of a variable by name
|
|
21
|
+
*/
|
|
22
|
+
getVariableJsonValue(variableName: string): Promise<unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Verifies that a variable exists and contains expected JSON content
|
|
25
|
+
*/
|
|
26
|
+
verifyVariableJsonContent(variableName: string, assertions: (value: unknown) => void | Promise<void>): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export { OperateProcessInstancePage };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperateProcessInstancePage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const sleep_1 = require("../../utils/sleep");
|
|
6
|
+
class OperateProcessInstancePage {
|
|
7
|
+
page;
|
|
8
|
+
diagram;
|
|
9
|
+
completedIcon;
|
|
10
|
+
diagramSpinner;
|
|
11
|
+
activeIcon;
|
|
12
|
+
variablesList;
|
|
13
|
+
messageVariable;
|
|
14
|
+
statusVariable;
|
|
15
|
+
constructor(page) {
|
|
16
|
+
this.page = page;
|
|
17
|
+
this.diagram = page.getByTestId('diagram');
|
|
18
|
+
this.completedIcon = page
|
|
19
|
+
.getByTestId('instance-header')
|
|
20
|
+
.getByTestId('COMPLETED-icon');
|
|
21
|
+
this.diagramSpinner = page.getByTestId('diagram-spinner');
|
|
22
|
+
this.activeIcon = page
|
|
23
|
+
.getByTestId('instance-header')
|
|
24
|
+
.getByTestId('ACTIVE-icon');
|
|
25
|
+
this.variablesList = page.getByTestId('variables-list');
|
|
26
|
+
this.messageVariable = page.getByTestId('variable-message');
|
|
27
|
+
this.statusVariable = page.getByTestId('variable-status');
|
|
28
|
+
}
|
|
29
|
+
async connectorResultVariableName(name) {
|
|
30
|
+
return await this.page.getByTestId(name);
|
|
31
|
+
}
|
|
32
|
+
async connectorResultVariableValue(variableName) {
|
|
33
|
+
return await this.page.getByTestId(variableName).locator('td').last();
|
|
34
|
+
}
|
|
35
|
+
// The instance header renders the status the instance had when the page was
|
|
36
|
+
// loaded, so a status that flips afterwards -- ACTIVE once the instance is
|
|
37
|
+
// exported, COMPLETED once the last task finishes -- only becomes visible on
|
|
38
|
+
// a reload. Sitting out a 60-90s per-attempt timeout before reloading
|
|
39
|
+
// therefore buys nothing: the page under the wait can no longer change. Poll
|
|
40
|
+
// on a short cadence and reload between polls instead, so the status is
|
|
41
|
+
// picked up shortly after it lands rather than at the next minute boundary.
|
|
42
|
+
//
|
|
43
|
+
// The per-attempt timeout escalates rather than staying at its opening
|
|
44
|
+
// value: on a loaded c8Run runner the instance page itself can take longer
|
|
45
|
+
// than the first interval to render, and a fixed short interval would keep
|
|
46
|
+
// reloading a page that was about to show the icon. `deadlineMs` bounds the
|
|
47
|
+
// whole assertion, so a status that never arrives still fails after at least
|
|
48
|
+
// as long as the retry loop this replaces waited.
|
|
49
|
+
async assertInstanceStatusIcon(icon, status, deadlineMs) {
|
|
50
|
+
const attemptTimeouts = [15000, 15000, 30000, 30000, 60000];
|
|
51
|
+
const deadline = Date.now() + deadlineMs;
|
|
52
|
+
let attempt = 0;
|
|
53
|
+
let lastError;
|
|
54
|
+
while (Date.now() < deadline) {
|
|
55
|
+
try {
|
|
56
|
+
await (0, test_1.expect)(icon).toBeVisible({
|
|
57
|
+
timeout: attemptTimeouts[Math.min(attempt, attemptTimeouts.length - 1)],
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
lastError = error;
|
|
63
|
+
attempt++;
|
|
64
|
+
console.log(`${status} icon not visible yet (attempt ${attempt}). Reloading...`);
|
|
65
|
+
await this.page.reload();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
throw new Error(`${status} icon not visible after ${deadlineMs}ms and ${attempt} ` +
|
|
69
|
+
`reload(s): ${String(lastError)}`);
|
|
70
|
+
}
|
|
71
|
+
async completedIconAssertion() {
|
|
72
|
+
await this.assertInstanceStatusIcon(this.completedIcon, 'COMPLETED', 420000);
|
|
73
|
+
}
|
|
74
|
+
async activeIconAssertion() {
|
|
75
|
+
await this.assertInstanceStatusIcon(this.activeIcon, 'ACTIVE', 300000);
|
|
76
|
+
}
|
|
77
|
+
async getProcessVariableValue(variableName) {
|
|
78
|
+
return await this.page
|
|
79
|
+
.getByTestId(`variable-${variableName}`)
|
|
80
|
+
.getByRole('cell')
|
|
81
|
+
.nth(1);
|
|
82
|
+
}
|
|
83
|
+
async assertProcessVariableContainsText(variableName, text) {
|
|
84
|
+
const maxRetries = 3;
|
|
85
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
86
|
+
try {
|
|
87
|
+
const valueCell = await this.getProcessVariableValue(variableName);
|
|
88
|
+
await (0, test_1.expect)(valueCell).toContainText(text, { timeout: 30000 });
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
console.log(`Failed to assert variable ${variableName}: ${error}`);
|
|
93
|
+
await this.page.reload();
|
|
94
|
+
await (0, sleep_1.sleep)(10000);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
throw new Error(`Failed to assert variable ${variableName} contains ${text} after ${maxRetries} attempts.`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Gets the JSON value of a variable by name
|
|
101
|
+
*/
|
|
102
|
+
async getVariableJsonValue(variableName) {
|
|
103
|
+
const variable = await this.getProcessVariableValue(variableName);
|
|
104
|
+
await (0, test_1.expect)(variable).toBeVisible();
|
|
105
|
+
const valueText = (await variable.textContent()) || '{}';
|
|
106
|
+
try {
|
|
107
|
+
return JSON.parse(valueText);
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
throw new Error(`Failed to parse JSON for variable "${variableName}". ` +
|
|
111
|
+
`Raw value: ${valueText}. Original error: ${String(error)}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Verifies that a variable exists and contains expected JSON content
|
|
116
|
+
*/
|
|
117
|
+
async verifyVariableJsonContent(variableName, assertions) {
|
|
118
|
+
const value = await this.getVariableJsonValue(variableName);
|
|
119
|
+
await assertions(value);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.OperateProcessInstancePage = OperateProcessInstancePage;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class OperateProcessesPage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly processResultCount: Locator;
|
|
5
|
+
readonly processActiveCheckbox: Locator;
|
|
6
|
+
readonly processCompletedCheckbox: Locator;
|
|
7
|
+
readonly processRunningInstancesCheckbox: Locator;
|
|
8
|
+
readonly processIncidentsCheckbox: Locator;
|
|
9
|
+
readonly processPageHeading: Locator;
|
|
10
|
+
readonly noMatchingInstancesMessage: Locator;
|
|
11
|
+
readonly processFinishedInstancesCheckbox: Locator;
|
|
12
|
+
readonly whatsNewPopUp: Locator;
|
|
13
|
+
readonly gotItButton: Locator;
|
|
14
|
+
constructor(page: Page);
|
|
15
|
+
clickProcessActiveCheckbox(): Promise<void>;
|
|
16
|
+
clickProcessCompletedCheckbox(): Promise<void>;
|
|
17
|
+
clickProcessIncidentsCheckbox(): Promise<void>;
|
|
18
|
+
clickRunningProcessInstancesCheckbox(): Promise<void>;
|
|
19
|
+
clickFinishedProcessInstancesCheckbox(): Promise<void>;
|
|
20
|
+
clickProcessInstanceLink(processName: string, processInstanceKey?: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export { OperateProcessesPage };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperateProcessesPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const sleep_1 = require("../../utils/sleep");
|
|
6
|
+
class OperateProcessesPage {
|
|
7
|
+
page;
|
|
8
|
+
processResultCount;
|
|
9
|
+
processActiveCheckbox;
|
|
10
|
+
processCompletedCheckbox;
|
|
11
|
+
processRunningInstancesCheckbox;
|
|
12
|
+
processIncidentsCheckbox;
|
|
13
|
+
processPageHeading;
|
|
14
|
+
noMatchingInstancesMessage;
|
|
15
|
+
processFinishedInstancesCheckbox;
|
|
16
|
+
whatsNewPopUp;
|
|
17
|
+
gotItButton;
|
|
18
|
+
constructor(page) {
|
|
19
|
+
this.page = page;
|
|
20
|
+
this.processResultCount = page.getByTestId('result-count');
|
|
21
|
+
this.processActiveCheckbox = page
|
|
22
|
+
.locator('label')
|
|
23
|
+
.filter({ hasText: 'Active' });
|
|
24
|
+
this.processCompletedCheckbox = page
|
|
25
|
+
.locator('label')
|
|
26
|
+
.filter({ hasText: 'Completed' });
|
|
27
|
+
this.processRunningInstancesCheckbox = page
|
|
28
|
+
.locator('label')
|
|
29
|
+
.filter({ hasText: 'Running Instances' });
|
|
30
|
+
this.processIncidentsCheckbox = page
|
|
31
|
+
.locator('label')
|
|
32
|
+
.filter({ hasText: 'Incidents' });
|
|
33
|
+
this.processPageHeading = page
|
|
34
|
+
.getByTestId('expanded-panel')
|
|
35
|
+
.getByRole('heading', { name: 'Process' });
|
|
36
|
+
this.noMatchingInstancesMessage = page.getByText('There are no Instances matching this filter set');
|
|
37
|
+
this.processFinishedInstancesCheckbox = page
|
|
38
|
+
.getByTestId('filter-finished-instances')
|
|
39
|
+
.getByRole('checkbox');
|
|
40
|
+
this.whatsNewPopUp = page.getByRole('heading', {
|
|
41
|
+
name: "Here's what moved in Operate",
|
|
42
|
+
});
|
|
43
|
+
this.gotItButton = page.getByRole('button', { name: 'Got it' });
|
|
44
|
+
}
|
|
45
|
+
async clickProcessActiveCheckbox() {
|
|
46
|
+
await this.processActiveCheckbox.click();
|
|
47
|
+
}
|
|
48
|
+
async clickProcessCompletedCheckbox() {
|
|
49
|
+
await (0, sleep_1.sleep)(5000);
|
|
50
|
+
if (!(await this.processCompletedCheckbox.isChecked({ timeout: 60000 }))) {
|
|
51
|
+
await this.processCompletedCheckbox.click({ timeout: 120000 });
|
|
52
|
+
await (0, sleep_1.sleep)(1000);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async clickProcessIncidentsCheckbox() {
|
|
56
|
+
await this.processIncidentsCheckbox.click({ timeout: 90000 });
|
|
57
|
+
}
|
|
58
|
+
async clickRunningProcessInstancesCheckbox() {
|
|
59
|
+
await this.processRunningInstancesCheckbox.click({ timeout: 90000 });
|
|
60
|
+
}
|
|
61
|
+
async clickFinishedProcessInstancesCheckbox() {
|
|
62
|
+
await this.processFinishedInstancesCheckbox.click({ timeout: 90000 });
|
|
63
|
+
}
|
|
64
|
+
async clickProcessInstanceLink(processName, processInstanceKey) {
|
|
65
|
+
// Both Operate frontends label the instance-key cell link
|
|
66
|
+
// "View instance <key>" -- the aria-label in operate/client's
|
|
67
|
+
// InstancesTable, the operate.processes.instancesTable.viewInstance string
|
|
68
|
+
// in the orchestration-cluster webapp -- so passing a key pins the click
|
|
69
|
+
// to one instance. Without a key every row carrying the process name is a
|
|
70
|
+
// candidate and `.first()` opens an arbitrary instance of that process.
|
|
71
|
+
// Both frontends sort the list by start date descending, so a
|
|
72
|
+
// just-created instance is on the first page.
|
|
73
|
+
const instanceLink = processInstanceKey === undefined
|
|
74
|
+
? this.page
|
|
75
|
+
.getByRole('row')
|
|
76
|
+
.filter({ hasText: new RegExp(`^(?:Select row)?${processName}\\d+`) })
|
|
77
|
+
.first()
|
|
78
|
+
.getByRole('link')
|
|
79
|
+
: this.page.getByRole('link', {
|
|
80
|
+
name: `View instance ${processInstanceKey}`,
|
|
81
|
+
exact: true,
|
|
82
|
+
});
|
|
83
|
+
let retryCount = 0;
|
|
84
|
+
const maxRetries = 4;
|
|
85
|
+
while (retryCount < maxRetries) {
|
|
86
|
+
try {
|
|
87
|
+
await (0, sleep_1.sleep)(1000);
|
|
88
|
+
await this.page.reload();
|
|
89
|
+
await (0, sleep_1.sleep)(1000);
|
|
90
|
+
await instanceLink.click({ timeout: 30000 });
|
|
91
|
+
await (0, test_1.expect)(this.page.getByText('Instance History').first()).toBeVisible({
|
|
92
|
+
timeout: 10000,
|
|
93
|
+
});
|
|
94
|
+
if (await this.whatsNewPopUp.isVisible()) {
|
|
95
|
+
await this.gotItButton.click();
|
|
96
|
+
}
|
|
97
|
+
return; // Exit the function if the click is successful
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
// The next iteration opens with its own reload, so reloading and
|
|
101
|
+
// sleeping here only parks the worker for 10s on top of it.
|
|
102
|
+
retryCount++;
|
|
103
|
+
console.log(`Attempt ${retryCount} failed. Retrying...`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
throw new Error(`Failed to click on process instance link after ${maxRetries} attempts.`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.OperateProcessesPage = OperateProcessesPage;
|