@camunda/e2e-test-suite 0.0.1713 → 0.0.1715

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.
@@ -24,12 +24,16 @@ class OperateProcessesPage {
24
24
  this.page = page;
25
25
  this.processResultCount = page.getByTestId('result-count');
26
26
  this.processesTabLink = page.getByRole('link', { name: 'Processes' });
27
- this.processActiveCheckbox = page.locator('input#active');
28
- this.processCompletedCheckbox = page.locator('input#completed');
27
+ // Operate 8.11 renamed the Instances States filter inputs from #active /
28
+ // #completed / #incidents to #filter-active / #filter-completed /
29
+ // #filter-incidents (labels follow via `for=`). Match either id so the
30
+ // page object works across Operate builds on both sides of the rename.
31
+ this.processActiveCheckbox = page.locator('input#filter-active, input#active');
32
+ this.processCompletedCheckbox = page.locator('input#filter-completed, input#completed');
29
33
  this.processRunningInstancesCheckbox = page
30
34
  .getByTestId('filter-running-instances')
31
35
  .getByRole('checkbox');
32
- this.processIncidentsCheckbox = page.locator('input#incidents');
36
+ this.processIncidentsCheckbox = page.locator('input#filter-incidents, input#incidents');
33
37
  this.processPageHeading = page
34
38
  .getByTestId('expanded-panel')
35
39
  .getByRole('heading', { name: 'Process' });
@@ -36,14 +36,25 @@ class OperateHomePage {
36
36
  // at all. The product's own suite resolves the editor the same way --
37
37
  // see camunda/camunda
38
38
  // qa/c8-orchestration-cluster-e2e-test-suite/pages/OperateHomePage.ts.
39
- this.variableValueEditor = page.getByTestId('code-mirror-editor');
39
+ //
40
+ // c8Run 8.11 serves Operate from the orchestration-cluster webapp, whose
41
+ // InlineJsonEditor (webapp/client/apps/orchestration-cluster-webapp/src/
42
+ // operate/shared/Editors/InlineJsonEditor.tsx) writes through a Monaco
43
+ // RichTextEditor instead -- no code-mirror-editor test id, just a
44
+ // `.monaco-editor` root with role="code". Match either write-mode editor.
45
+ this.variableValueEditor = page
46
+ .getByTestId('code-mirror-editor')
47
+ .or(page.locator('.monaco-editor[role="code"]'))
48
+ .first();
40
49
  // The editable node *inside* that container. CodeMirror puts its
41
50
  // contenteditable on `.cm-content`, so that -- not the container -- is
42
51
  // what takes focus and what holds the text. Asserting focus on the
43
52
  // container reports `inactive` even when the caret is correctly placed,
44
53
  // because clicking the container focuses its contenteditable child.
54
+ // Monaco's equivalent is its role="textbox" edit context, which carries
55
+ // aria-roledescription="editor".
45
56
  this.variableValueContent = this.variableValueEditor
46
- .locator('.cm-content')
57
+ .locator('.cm-content, [role="textbox"][aria-roledescription="editor"]')
47
58
  .first();
48
59
  // Carbon icon-only buttons expose their accessible name via aria-labelledby
49
60
  // (tooltip text "Save") which overrides aria-label for computed accessible name.
@@ -122,7 +133,11 @@ class OperateHomePage {
122
133
  // elsewhere. Click to focus, then confirm. Both act on the
123
134
  // contenteditable rather than its container, which cannot hold focus.
124
135
  await (0, test_1.expect)(this.variableValueContent).toBeVisible({ timeout: 30000 });
125
- await this.variableValueContent.click();
136
+ // Click the editor root, not the editable node: Monaco overlays its
137
+ // rendered text (.view-lines) on top of the edit context, which would
138
+ // intercept a direct click. Clicking either editor's root moves focus
139
+ // into its editable node, which the next line confirms.
140
+ await this.variableValueEditor.click();
126
141
  await (0, test_1.expect)(this.variableValueContent).toBeFocused({ timeout: 10000 });
127
142
  // Insert the COMPLETE JSON value, both quotes included. Monaco used to
128
143
  // auto-close a lone opening quote, so the old recipe inserted only
@@ -143,7 +158,10 @@ class OperateHomePage {
143
158
  await this.page.keyboard.press('Backspace');
144
159
  const jsonValue = JSON.stringify(newValue);
145
160
  await this.page.keyboard.insertText(jsonValue);
146
- await (0, test_1.expect)(this.variableValueContent).toContainText(jsonValue, {
161
+ // Asserted on the editor root: CodeMirror keeps the text inside
162
+ // .cm-content, but Monaco renders it in sibling .view-lines, not in the
163
+ // edit-context element that holds focus.
164
+ await (0, test_1.expect)(this.variableValueEditor).toContainText(jsonValue, {
147
165
  timeout: 10000,
148
166
  });
149
167
  }
@@ -4,11 +4,13 @@ declare class OperateLoginPage {
4
4
  readonly usernameInput: Locator;
5
5
  readonly passwordInput: Locator;
6
6
  readonly loginButton: Locator;
7
+ readonly operateBanner: Locator;
7
8
  constructor(page: Page);
8
9
  fillUsername(username: string): Promise<void>;
9
10
  clickUsername(): Promise<void>;
10
11
  fillPassword(password: string): Promise<void>;
11
12
  clickLoginButton(): Promise<void>;
13
+ isLoggedIn(): Promise<boolean>;
12
14
  login(username: string, password: string): Promise<void>;
13
15
  }
14
16
  export { OperateLoginPage };
@@ -7,11 +7,18 @@ class OperateLoginPage {
7
7
  usernameInput;
8
8
  passwordInput;
9
9
  loginButton;
10
+ operateBanner;
10
11
  constructor(page) {
11
12
  this.page = page;
12
13
  this.usernameInput = page.getByLabel('Username');
13
14
  this.passwordInput = page.getByRole('textbox', { name: 'password' });
14
15
  this.loginButton = page.getByRole('button', { name: 'Login' });
16
+ // Same header link OperateHomePage.operateBanner resolves (legacy shell or
17
+ // Design System AppHeaderV2).
18
+ this.operateBanner = page
19
+ .getByRole('link', { name: 'Camunda logo Operate' })
20
+ .or(page.getByRole('link', { name: 'Camunda Operate', exact: true }))
21
+ .first();
15
22
  }
16
23
  async fillUsername(username) {
17
24
  await this.usernameInput.fill(username);
@@ -25,8 +32,17 @@ class OperateLoginPage {
25
32
  async clickLoginButton() {
26
33
  await this.loginButton.click({ timeout: 60000 });
27
34
  }
35
+ async isLoggedIn() {
36
+ // The orchestration cluster shares one session across Operate and
37
+ // Tasklist, so after a Tasklist login /operate/login redirects straight
38
+ // to /operate and the form never renders.
39
+ await (0, test_1.expect)(this.usernameInput.or(this.operateBanner).first()).toBeVisible({ timeout: 180000 });
40
+ return this.operateBanner.isVisible();
41
+ }
28
42
  async login(username, password) {
29
- await (0, test_1.expect)(this.usernameInput).toBeVisible({ timeout: 180000 });
43
+ if (await this.isLoggedIn()) {
44
+ return;
45
+ }
30
46
  await this.clickUsername();
31
47
  await this.fillUsername(username);
32
48
  await this.fillPassword(password);
@@ -73,7 +73,12 @@ class OperateProcessesPage {
73
73
  const instanceLink = processInstanceKey === undefined
74
74
  ? this.page
75
75
  .getByRole('row')
76
- .filter({ hasText: new RegExp(`^(?:Select row)?${processName}\\d+`) })
76
+ // The row-selection checkbox label is part of the row text: the
77
+ // legacy table renders "Select row", the 8.11 orchestration-cluster
78
+ // table renders "Select instance <key>".
79
+ .filter({
80
+ hasText: new RegExp(`^(?:Select row|Select instance \\d+)?${processName}\\d+`),
81
+ })
77
82
  .first()
78
83
  .getByRole('link')
79
84
  : this.page.getByRole('link', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1713",
3
+ "version": "0.0.1715",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",