@camunda/e2e-test-suite 0.0.1248 → 0.0.1250

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.
Files changed (35) hide show
  1. package/dist/pages/8.7/AppsPage.d.ts +7 -3
  2. package/dist/pages/8.7/AppsPage.js +187 -3
  3. package/dist/pages/8.7/ClusterPage.js +22 -2
  4. package/dist/pages/8.7/ClusterSecretsPage.js +22 -1
  5. package/dist/pages/8.7/HomePage.d.ts +2 -0
  6. package/dist/pages/8.7/HomePage.js +70 -6
  7. package/dist/pages/8.7/LoginPage.js +15 -0
  8. package/dist/pages/8.7/ModelerCreatePage.d.ts +4 -0
  9. package/dist/pages/8.7/ModelerCreatePage.js +59 -5
  10. package/dist/pages/8.7/ModelerHomePage.d.ts +11 -0
  11. package/dist/pages/8.7/ModelerHomePage.js +184 -10
  12. package/dist/pages/8.7/ProcessApplicationPage.js +27 -7
  13. package/dist/pages/8.7/UtilitiesPage.js +54 -1
  14. package/dist/pages/8.9/AppsPage.d.ts +2 -0
  15. package/dist/pages/8.9/AppsPage.js +114 -0
  16. package/dist/pages/8.9/ClusterDetailsPage.d.ts +3 -0
  17. package/dist/pages/8.9/ClusterDetailsPage.js +92 -25
  18. package/dist/pages/8.9/ClusterPage.js +49 -8
  19. package/dist/pages/8.9/ClusterSecretsPage.js +47 -2
  20. package/dist/pages/8.9/HomePage.d.ts +3 -0
  21. package/dist/pages/8.9/HomePage.js +44 -5
  22. package/dist/pages/8.9/LoginPage.d.ts +1 -0
  23. package/dist/pages/8.9/LoginPage.js +19 -0
  24. package/dist/pages/8.9/ModelerHomePage.d.ts +7 -0
  25. package/dist/pages/8.9/ModelerHomePage.js +122 -3
  26. package/dist/pages/8.9/UtilitiesPage.js +60 -2
  27. package/dist/tests/8.7/test-setup.spec.js +18 -5
  28. package/dist/tests/8.7/web-modeler-user-flows.spec.js +14 -14
  29. package/dist/tests/8.9/test-setup.spec.js +11 -4
  30. package/dist/utils/authErrorClassification.d.ts +5 -0
  31. package/dist/utils/authErrorClassification.js +49 -1
  32. package/dist/utils/consoleApiHelpers.d.ts +1 -0
  33. package/dist/utils/consoleApiHelpers.js +183 -30
  34. package/dist/utils/resetSession.js +7 -0
  35. package/package.json +1 -1
@@ -3,6 +3,7 @@ import { ClientCredentialsDetailsPage } from './ClientCredentialsDetailsPage';
3
3
  import { McpCredentials } from '../../utils/mcpSecrets';
4
4
  declare class ClusterDetailsPage {
5
5
  private page;
6
+ private pendingClientScopeCheck;
6
7
  readonly apiTab: Locator;
7
8
  readonly createFirstClientButton: Locator;
8
9
  readonly clientNameTextbox: Locator;
@@ -54,7 +55,9 @@ declare class ClusterDetailsPage {
54
55
  readonly updateButton: Locator;
55
56
  constructor(page: Page);
56
57
  clickAPITab(): Promise<void>;
58
+ dismissOopsIfPresent(): Promise<void>;
57
59
  clickCreateClientButton(): Promise<void>;
60
+ assertAPIClientScopes(name: string): Promise<void>;
58
61
  clickClientNameTextbox(): Promise<void>;
59
62
  fillClientNameTextbox(name: string): Promise<void>;
60
63
  clickTasklistCheckbox(): Promise<void>;
@@ -8,6 +8,9 @@ const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLoc
8
8
  const ClientCredentialsDetailsPage_1 = require("./ClientCredentialsDetailsPage");
9
9
  class ClusterDetailsPage {
10
10
  page;
11
+ // Name of a client whose scopes still have to be checked against the
12
+ // clients list — see createAPIClient() / clickCloseModalButton().
13
+ pendingClientScopeCheck = null;
11
14
  apiTab;
12
15
  createFirstClientButton;
13
16
  clientNameTextbox;
@@ -80,9 +83,6 @@ class ClusterDetailsPage {
80
83
  .locator('label')
81
84
  .filter({ hasText: /^Administration API - Resource: Secrets$/ });
82
85
  this.createButton = page.getByRole('button', { name: 'Create', exact: true });
83
- this.closeModalButton = page
84
- .getByRole('dialog', { name: 'Client credentials', exact: true })
85
- .getByLabel('Close');
86
86
  this.createClientButton = page.getByRole('button', {
87
87
  name: 'Create new Client',
88
88
  });
@@ -113,9 +113,18 @@ class ClusterDetailsPage {
113
113
  this.createClientCredentialsDialog = page.getByRole('dialog', {
114
114
  name: 'Create new client credentials',
115
115
  });
116
- this.clientCredentialsDialog = page.getByRole('dialog', {
117
- name: 'Client credentials',
118
- exact: true,
116
+ // Use a content-based locator so the test stays robust if the dialog
117
+ // title is ever renamed in the Console UI.
118
+ this.clientCredentialsDialog = page.getByRole('dialog').filter({
119
+ has: page.getByText('The Client Secret will not be shown again.'),
120
+ });
121
+ // Hub's client-credentials dialog (design-system Dialog, not the old
122
+ // Carbon one) exposes its close affix as an accessible button named
123
+ // "Close" rather than via an aria-label picked up by getByLabel -- see
124
+ // camunda-hub's own e2e suite, ConsoleClusterDetailsPage.ts
125
+ // (clientCredentialsDialogCloseButton), which already uses this pattern.
126
+ this.closeModalButton = this.clientCredentialsDialog.getByRole('button', {
127
+ name: 'Close',
119
128
  });
120
129
  this.clustersLink = page
121
130
  .getByRole('banner')
@@ -202,8 +211,68 @@ class ClusterDetailsPage {
202
211
  await (0, test_1.expect)(this.apiTab).toBeVisible({ timeout: 60000 });
203
212
  await this.apiTab.click({ timeout: 60000 });
204
213
  }
214
+ async dismissOopsIfPresent() {
215
+ // The clients list panel sometimes lands in a Carbon "Oops ... something
216
+ // went wrong." state when a background ClustersService request fails on
217
+ // SaaS INT. The panel replaces the create-client button, so any click
218
+ // attempt will time out until the user clicks the inline Reload button.
219
+ const oopsHeading = this.page.getByRole('heading', { name: /Oops/i });
220
+ if (!(await oopsHeading.isVisible({ timeout: 1000 }).catch(() => false))) {
221
+ return;
222
+ }
223
+ const reloadButton = this.page.getByRole('button', {
224
+ name: 'Reload',
225
+ exact: true,
226
+ });
227
+ if (await reloadButton.isVisible({ timeout: 1000 }).catch(() => false)) {
228
+ await reloadButton.click({ timeout: 15000 });
229
+ }
230
+ else {
231
+ await this.page.reload();
232
+ }
233
+ await this.page.waitForLoadState('domcontentloaded');
234
+ // The swallowed click error above let a failed Reload look like recovery,
235
+ // leaving the caller to burn its own timeout against the same Oops state
236
+ // and report an unrelated downstream failure. Verify the panel actually
237
+ // recovered instead of assuming either recovery path worked.
238
+ await (0, test_1.expect)(oopsHeading).not.toBeVisible({ timeout: 15000 });
239
+ }
205
240
  async clickCreateClientButton() {
206
- await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.createFirstClientButton.or(this.createNewClientButton));
241
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.createFirstClientButton.or(this.createNewClientButton), {
242
+ preAction: async () => {
243
+ await this.dismissOopsIfPresent();
244
+ },
245
+ });
246
+ }
247
+ // Asserts the scopes an API client was created with, read from its row in
248
+ // the clients list. Only meaningful once the credentials modal is closed:
249
+ // while it is open the panel behind it can still be showing its pre-create
250
+ // state and lists no row for the new client at all.
251
+ async assertAPIClientScopes(name) {
252
+ const row = this.clientsList.filter({ hasText: name });
253
+ const scopes = /(?=.*Orchestration)(?=.*Optimize)(?=.*Secrets)/;
254
+ const maxAttempts = 3;
255
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
256
+ try {
257
+ await (0, test_1.expect)(row).toContainText(scopes, { timeout: 60000 });
258
+ return;
259
+ }
260
+ catch (error) {
261
+ if (attempt === maxAttempts) {
262
+ throw error;
263
+ }
264
+ // A panel that rendered before the client existed — or that failed
265
+ // into the "Oops ... something went wrong." state — only picks the
266
+ // new client up on a refetch, which is what reloading the API tab
267
+ // forces. A single reload isn't always enough on a nightly cluster
268
+ // this suite reuses across parallel test workers, so retry more
269
+ // than once before failing the test.
270
+ console.warn(`assertAPIClientScopes: "${name}" is not listed yet (attempt ${attempt}/${maxAttempts}); reloading the API tab and retrying. ${error}`);
271
+ await this.dismissOopsIfPresent();
272
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
273
+ await this.clickAPITab();
274
+ }
275
+ }
207
276
  }
208
277
  async clickClientNameTextbox() {
209
278
  await this.clientNameTextbox.click({ timeout: 60000 });
@@ -253,6 +322,12 @@ class ClusterDetailsPage {
253
322
  }
254
323
  async clickCloseModalButton() {
255
324
  await this.closeModalButton.click({ timeout: 60000 });
325
+ const pendingClient = this.pendingClientScopeCheck;
326
+ if (pendingClient === null) {
327
+ return;
328
+ }
329
+ this.pendingClientScopeCheck = null;
330
+ await this.assertAPIClientScopes(pendingClient);
256
331
  }
257
332
  async clickSettingsTab() {
258
333
  await this.settingsTab.click({ timeout: 60000 });
@@ -582,24 +657,16 @@ class ClusterDetailsPage {
582
657
  await (0, test_1.expect)(this.clientCredentialsDialog
583
658
  .getByText('The Client Secret will not be shown again.')
584
659
  .first()).toBeVisible();
585
- try {
586
- await (0, test_1.expect)(this.clientsList.filter({ hasText: attemptName })).toContainText(/(?=.*Orchestration)(?=.*Optimize)(?=.*Secrets)/, {
587
- timeout: 10000,
588
- });
589
- }
590
- catch (err) {
591
- // The clients list panel can land in "Oops ... something went wrong."
592
- // while the post-create modal is still open. The modal blocks pointer
593
- // events so we can't click Reload here; the modal's "Client Secret will
594
- // not be shown again" message above already proves the client exists.
595
- const oopsVisible = await this.page
596
- .getByRole('heading', { name: /Oops/i })
597
- .isVisible({ timeout: 1000 })
598
- .catch(() => false);
599
- if (!oopsVisible)
600
- throw err;
601
- console.warn(`createAPIClient: clients list panel is in Oops state; skipping row scope assertion for "${attemptName}".`);
602
- }
660
+ // The client now exists — the modal above is proof — so the scopes it
661
+ // was created with are checked in clickCloseModalButton() rather than
662
+ // here. The clients list behind the open modal is not a reliable
663
+ // source for that check: it can still be rendering its pre-create
664
+ // state (no row for this client) or have failed into "Oops ...
665
+ // something went wrong.", and the modal blocks the pointer events a
666
+ // reload would need. Asserting it here instead sent a created client
667
+ // round the retry loop, which both left orphan clients behind and
668
+ // discarded the credentials the caller has yet to read.
669
+ this.pendingClientScopeCheck = attemptName;
603
670
  return;
604
671
  }
605
672
  catch (error) {
@@ -123,10 +123,30 @@ class ClusterPage {
123
123
  this.clusterVersion = (clusterName, versionText) => this.cluster(clusterName).getByText(versionText);
124
124
  }
125
125
  async clickClusterBanner() {
126
- await this.page
126
+ // Camunda Hub has no `banner` landmark; "Clusters" instead lives in its
127
+ // persistent "Main navigation" sidebar, and once the org has environments
128
+ // enabled that link is further renamed "Environments" (same rollout
129
+ // HomePage.clusterTab handles).
130
+ const clusterLink = this.page
127
131
  .getByRole('banner')
128
132
  .getByRole('link', { name: 'Clusters' })
129
- .click({ timeout: 60000 });
133
+ .or(this.page
134
+ .getByRole('navigation', { name: 'Main navigation' })
135
+ .getByRole('link', { name: 'Clusters', exact: true }))
136
+ .or(this.page
137
+ .getByRole('navigation', { name: 'Main navigation' })
138
+ .getByRole('link', { name: 'Environments', exact: true }));
139
+ await clusterLink.click({ timeout: 60000 });
140
+ // Landing on Hub's Environments overview (see above) renders clusters as
141
+ // cards, not the getByRole('row') table this page's own locators expect
142
+ // -- route through the page's own "Clusters" tab to reach the classic
143
+ // route. Same fix as HomePage.clickClusters().
144
+ const clustersPageTab = this.page
145
+ .getByRole('navigation', { name: 'Environments views' })
146
+ .getByRole('link', { name: 'Clusters', exact: true });
147
+ if (await clustersPageTab.isVisible({ timeout: 5000 }).catch(() => false)) {
148
+ await clustersPageTab.click({ timeout: 15000 });
149
+ }
130
150
  }
131
151
  async deleteCluster(name) {
132
152
  await this.page.waitForTimeout(1000);
@@ -302,12 +322,33 @@ class ClusterPage {
302
322
  });
303
323
  }
304
324
  async clickConnectorSecretsTab(clusterName) {
305
- await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.connectorSecretsTab, {
306
- postAction: async () => {
307
- await this.clickClusterBanner();
308
- await this.clickClusterLink(clusterName);
309
- },
310
- });
325
+ // clickLocatorWithRetry only reports whether the click itself threw --
326
+ // Radix's tab trigger always accepts the click, so a click that lands
327
+ // right before the panel re-renders (e.g. Hub's cluster-page background
328
+ // reauth reload) can report success while the "Connector Secrets" panel
329
+ // never actually activates. Verify aria-selected rather than trusting
330
+ // the click outcome, and redo the full navigate-and-click on a miss.
331
+ const maxAttempts = 3;
332
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
333
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.connectorSecretsTab, {
334
+ postAction: async () => {
335
+ await this.clickClusterBanner();
336
+ await this.clickClusterLink(clusterName);
337
+ },
338
+ });
339
+ const isSelected = (await this.connectorSecretsTab
340
+ .getAttribute('aria-selected')
341
+ .catch(() => null)) === 'true';
342
+ if (isSelected) {
343
+ return;
344
+ }
345
+ if (attempt === maxAttempts) {
346
+ throw new Error('clickConnectorSecretsTab: "Connector Secrets" tab click did not activate the tab after retries');
347
+ }
348
+ console.warn(`clickConnectorSecretsTab: click succeeded but the tab did not become active (attempt ${attempt}/${maxAttempts}); retrying`);
349
+ await this.clickClusterBanner();
350
+ await this.clickClusterLink(clusterName);
351
+ }
311
352
  }
312
353
  async clickLatestStableForMinorVersion() {
313
354
  const minorVersion = process.env.MINOR_VERSION;
@@ -55,10 +55,28 @@ class ClusterSecretsPage {
55
55
  this.dialogCancelButton = this.page
56
56
  .getByRole('dialog')
57
57
  .getByRole('button', { name: 'Cancel', exact: true });
58
- this.secretsSearchBox = page.getByRole('searchbox', { name: 'Filter table' });
58
+ // "Filter table" was Carbon's default TableToolbarSearch label. A live
59
+ // trace off this branch shows the panel now rendering a plain "Search"
60
+ // input instead (Camunda Hub's rebranded UI, not Carbon), so the old
61
+ // exact-name match never resolves and every lookup falls through to
62
+ // creating a secret that may already exist. Match either.
63
+ this.secretsSearchBox = page
64
+ .getByRole('searchbox', { name: 'Filter table' })
65
+ .or(page.getByRole('searchbox', { name: 'Search' }))
66
+ .or(page.getByPlaceholder('Search'));
67
+ // Camunda Hub has no `banner` landmark; "Clusters" instead lives in its
68
+ // persistent "Main navigation" sidebar, and once the org has environments
69
+ // enabled that link is further renamed "Environments" (same rollout
70
+ // HomePage.clusterTab handles).
59
71
  this.clusterBanner = this.page
60
72
  .getByRole('banner')
61
- .getByRole('link', { name: 'Clusters' });
73
+ .getByRole('link', { name: 'Clusters' })
74
+ .or(this.page
75
+ .getByRole('navigation', { name: 'Main navigation' })
76
+ .getByRole('link', { name: 'Clusters', exact: true }))
77
+ .or(this.page
78
+ .getByRole('navigation', { name: 'Main navigation' })
79
+ .getByRole('link', { name: 'Environments', exact: true }));
62
80
  this.clusterLink = (name) => page.getByRole('link', { name: name });
63
81
  this.clusterSecretTab = this.page.getByRole('tab', {
64
82
  name: 'Connector Secrets',
@@ -115,6 +133,17 @@ class ClusterSecretsPage {
115
133
  async clickClusterBanner() {
116
134
  await (0, test_1.expect)(this.clusterBanner).toBeVisible({ timeout: 30000 });
117
135
  await this.clusterBanner.click({ timeout: 60000 });
136
+ // Landing on Hub's Environments overview (see clusterBanner above) renders
137
+ // clusters as cards, not the getByRole('link') the clusterLink() locator
138
+ // below expects to find directly -- route through the page's own
139
+ // "Clusters" tab to reach the classic route. Same fix as
140
+ // HomePage.clickClusters().
141
+ const clustersPageTab = this.page
142
+ .getByRole('navigation', { name: 'Environments views' })
143
+ .getByRole('link', { name: 'Clusters', exact: true });
144
+ if (await clustersPageTab.isVisible({ timeout: 5000 }).catch(() => false)) {
145
+ await clustersPageTab.click({ timeout: 15000 });
146
+ }
118
147
  }
119
148
  async clickCluster(name) {
120
149
  await (0, test_1.expect)(this.clusterLink(name)).toBeVisible({ timeout: 30000 });
@@ -169,6 +198,22 @@ class ClusterSecretsPage {
169
198
  await (0, test_1.expect)(this.page.getByText('Creating...')).not.toBeVisible({
170
199
  timeout: 60000,
171
200
  });
201
+ // A live trace off this exact branch (test-setup.spec.ts, PR#3627) shows
202
+ // the panel taking the reload path for every one of 7 secrets created in
203
+ // a row, not "near-universally" -- so the 15s pre-reload probe this used
204
+ // to run first never once paid off and only burned 15s x N secrets.
205
+ // Reload unconditionally, matching the pattern createSetOfSecrets's own
206
+ // bulkImportSecrets() already uses after an import on this identical
207
+ // panel.
208
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
209
+ // The reload lands back on the cluster's default Overview tab, not
210
+ // Connector Secrets -- a CI failure screenshot confirmed the page stuck
211
+ // there with the secrets panel never reached, so createNewSecretButton
212
+ // was never going to reappear regardless of whether the reload fixed the
213
+ // underlying render issue. Re-navigate to the tab before waiting for it.
214
+ await this.clickClusterBanner();
215
+ await this.clickCluster(cluster);
216
+ await this.clusterSecretTab.click({ timeout: 30000 });
172
217
  await (0, test_1.expect)(this.createNewSecretButton).toBeVisible({
173
218
  timeout: 60000,
174
219
  });
@@ -12,11 +12,14 @@ declare class HomePage {
12
12
  readonly appSwitcher: Locator;
13
13
  readonly openOrganizationButton: Locator;
14
14
  readonly consoleBanner: Locator;
15
+ readonly hubHeader: Locator;
16
+ readonly hubSidebar: Locator;
15
17
  readonly modelerBanner: Locator;
16
18
  readonly gettingStartedHeading: Locator;
17
19
  readonly buttonSkipCustomization: Locator;
18
20
  constructor(page: Page);
19
21
  clickClusters(): Promise<void>;
22
+ private clickClustersPageTabIfPresent;
20
23
  clickClustersWithReloadRecovery(): Promise<void>;
21
24
  clickDashboard(): Promise<void>;
22
25
  clickOrganization(): Promise<void>;
@@ -16,16 +16,35 @@ class HomePage {
16
16
  appSwitcher;
17
17
  openOrganizationButton;
18
18
  consoleBanner;
19
+ hubHeader;
20
+ hubSidebar;
19
21
  modelerBanner;
20
22
  gettingStartedHeading;
21
23
  buttonSkipCustomization;
22
24
  constructor(page) {
23
25
  this.page = page;
26
+ // Camunda Hub replaces Console on SaaS: an app header (only carrying the
27
+ // user menu once authenticated) plus a sidebar whose Console section
28
+ // links to /org/<id>/clusters and /org/<id>/management.
29
+ this.hubHeader = page
30
+ .locator('header[data-slot="app-header"]')
31
+ .filter({ has: page.locator('[data-slot="user-menu-trigger"]') });
32
+ this.hubSidebar = page.locator('nav[data-slot="app-sidebar"]');
24
33
  this.dashboardTab = page.getByRole('link', { name: 'Dashboard' });
34
+ // Once an org has environmentsEnabled, camunda-hub's
35
+ // use-ds-sidebar-items.tsx replaces the sidebar's Clusters link with one
36
+ // labelled "Environments" whose href is '/environments', not
37
+ // '/clusters' -- accept both hrefs so this resolves either way.
25
38
  this.clusterTab = page
26
39
  .getByRole('banner')
27
- .getByRole('link', { name: 'Clusters' });
28
- this.organizationTab = page.getByRole('link', { name: 'Organization' });
40
+ .getByRole('link', { name: 'Clusters' })
41
+ .or(this.hubSidebar.locator('a[href$="/clusters"]'))
42
+ .or(this.hubSidebar.locator('a[href$="/environments"]'))
43
+ .first();
44
+ this.organizationTab = page
45
+ .getByRole('link', { name: 'Organization' })
46
+ .or(this.hubSidebar.locator('a[href$="/management"]'))
47
+ .first();
29
48
  this.organizationViewTitle = page.getByText('Organization Management');
30
49
  this.welcomeMessage = page.getByText('Welcome to Camunda!').first();
31
50
  this.informationDialog = page.getByRole('button', {
@@ -38,9 +57,14 @@ class HomePage {
38
57
  .or(this.camundaAppsButton)
39
58
  .or(this.appSwitcher);
40
59
  this.openOrganizationButton = page.getByLabel('Open Organizations');
41
- this.consoleBanner = page.getByRole('link', {
42
- name: 'Camunda logo Console',
43
- });
60
+ // "Camunda logo Console" was the old Carbon header's logo link. Camunda
61
+ // Hub has no equivalent link -- its post-login landing is `hubHeader`
62
+ // (see above) -- so callers that assert this banner as a login/Console
63
+ // arrival signal need the Hub fallback too (UtilitiesPage.ts already
64
+ // does this ad hoc at one call site; fold it in here instead).
65
+ this.consoleBanner = page
66
+ .getByRole('link', { name: 'Camunda logo Console' })
67
+ .or(this.hubHeader);
44
68
  this.gettingStartedHeading = page.getByText('start by creating a project');
45
69
  this.buttonSkipCustomization = page.getByRole('button', {
46
70
  name: 'Skip customization',
@@ -52,6 +76,20 @@ class HomePage {
52
76
  async clickClusters() {
53
77
  await (0, test_1.expect)(this.clusterTab).toBeVisible({ timeout: 30000 });
54
78
  await this.clusterTab.click({ timeout: 15000 });
79
+ await this.clickClustersPageTabIfPresent();
80
+ }
81
+ // Landing on Hub's Environments overview (see clusterTab above) doesn't put
82
+ // us on the classic row-based cluster list ClusterPage.ts expects -- that
83
+ // page renders clusters as cards. Its own header renders a separate
84
+ // "Clusters" tab (camunda-hub EnvironmentsPageHeader.tsx, href /clusters)
85
+ // that does.
86
+ async clickClustersPageTabIfPresent() {
87
+ const clustersPageTab = this.page
88
+ .getByRole('navigation', { name: 'Environments views' })
89
+ .getByRole('link', { name: 'Clusters', exact: true });
90
+ if (await clustersPageTab.isVisible({ timeout: 5000 }).catch(() => false)) {
91
+ await clustersPageTab.click({ timeout: 15000 });
92
+ }
55
93
  }
56
94
  // Same navigation as clickClusters(), but recovers from a Console SPA crash
57
95
  // by remounting the app. Toggling authorizations restarts the cluster, and
@@ -70,6 +108,7 @@ class HomePage {
70
108
  await this.page.reload();
71
109
  },
72
110
  });
111
+ await this.clickClustersPageTabIfPresent();
73
112
  }
74
113
  async clickDashboard() {
75
114
  await this.dashboardTab.click({ timeout: 90000 });
@@ -26,6 +26,7 @@ declare class LoginPage {
26
26
  clickContinueButton(): Promise<void>;
27
27
  fillPassword(password: string): Promise<void>;
28
28
  clickLoginButton(): Promise<void>;
29
+ private throwIfCredentialsRejected;
29
30
  login(credentials?: {
30
31
  username?: string;
31
32
  password?: string;
@@ -5,6 +5,7 @@ const test_1 = require("@playwright/test");
5
5
  const authErrorClassification_1 = require("../../utils/authErrorClassification");
6
6
  const UtilitiesPage_1 = require("./UtilitiesPage");
7
7
  const sessionRecovery_1 = require("../../utils/sessionRecovery");
8
+ const consoleApiHelpers_1 = require("../../utils/consoleApiHelpers");
8
9
  const userNameInputValidInputSchema = {
9
10
  _schema: {
10
11
  maxlength: 254,
@@ -66,9 +67,23 @@ class LoginPage {
66
67
  async clickLoginButton() {
67
68
  await this.loginButton.click({ timeout: 60000 });
68
69
  }
70
+ // Auth0 responds to a rejected password by re-rendering the same password
71
+ // step with an error message rather than navigating anywhere, so success
72
+ // and failure aren't told apart by a URL or element one side has and the
73
+ // other doesn't. Without this check, a permanently wrong password falls
74
+ // through into assertTestUsesCorrectOrganization's generic ~120s wait for a
75
+ // Console/Hub shell that is never coming, and loginWithRetry then spends
76
+ // its remaining attempts resubmitting the exact same doomed credentials.
77
+ async throwIfCredentialsRejected(username) {
78
+ const message = await (0, authErrorClassification_1.classifyLoginRejection)(this.page, username);
79
+ if (message) {
80
+ throw new Error(message);
81
+ }
82
+ }
69
83
  async login(credentials = {}) {
70
84
  const { username = process.env.C8_USERNAME, password = process.env.C8_PASSWORD, } = credentials;
71
85
  (0, sessionRecovery_1.trackSignedInUser)(this.page, username);
86
+ (0, consoleApiHelpers_1.resetHubBearerToken)(this.page);
72
87
  await (0, test_1.expect)(this.loginMessage).toBeVisible({ timeout: 120000 });
73
88
  await (0, test_1.expect)(this.usernameInput.locator).toBeVisible({ timeout: 30000 });
74
89
  await this.fillUsername(username);
@@ -76,11 +91,13 @@ class LoginPage {
76
91
  await this.fillPassword(password);
77
92
  await (0, test_1.expect)(this.loginButton).toBeVisible({ timeout: 120000 });
78
93
  await this.clickLoginButton();
94
+ await this.throwIfCredentialsRejected(username);
79
95
  await (0, UtilitiesPage_1.assertTestUsesCorrectOrganization)(this.page);
80
96
  }
81
97
  async loginWithTestUser(credentials = {}) {
82
98
  const { username = process.env.C8_USERNAME_TEST, password = process.env.C8_PASSWORD_TEST, } = credentials;
83
99
  (0, sessionRecovery_1.trackSignedInUser)(this.page, username);
100
+ (0, consoleApiHelpers_1.resetHubBearerToken)(this.page);
84
101
  // Navigate to app root to trigger auth redirect. The Console app (at
85
102
  // console.* hostnames) embeds a hidden invite-user email input also labeled
86
103
  // "Email address" that would otherwise satisfy the locator below before the
@@ -157,6 +174,7 @@ class LoginPage {
157
174
  await this.fillPassword(password);
158
175
  await (0, test_1.expect)(this.loginButton).toBeVisible({ timeout: 120000 });
159
176
  await this.clickLoginButton();
177
+ await this.throwIfCredentialsRejected(username);
160
178
  await (0, UtilitiesPage_1.assertTestUsesCorrectOrganization)(this.page);
161
179
  }
162
180
  async loginFailAssertion() {
@@ -170,6 +188,7 @@ class LoginPage {
170
188
  async loginWithoutOrgAssertion(credentials = {}) {
171
189
  const { username = process.env.C8_USERNAME, password = process.env.C8_PASSWORD, } = credentials;
172
190
  (0, sessionRecovery_1.trackSignedInUser)(this.page, username);
191
+ (0, consoleApiHelpers_1.resetHubBearerToken)(this.page);
173
192
  await (0, test_1.expect)(this.usernameInput.locator).toBeVisible({ timeout: 180000 });
174
193
  await this.fillUsername(username);
175
194
  await this.clickContinueButton();
@@ -1,12 +1,18 @@
1
1
  import { Page, Locator } from '@playwright/test';
2
2
  declare class ModelerHomePage {
3
3
  private defaultFolderName;
4
+ private defaultClusterName;
4
5
  private page;
5
6
  private processApplicationPage;
6
7
  private processApplicationUrl?;
7
8
  private processApplicationName?;
8
9
  readonly modelerPageBanner: Locator;
9
10
  readonly createNewProjectButton: Locator;
11
+ readonly createWorkspaceButton: Locator;
12
+ readonly workspaceWizardNameInput: Locator;
13
+ readonly workspaceWizardSubmitButton: Locator;
14
+ readonly workspaceWizardMembersStep: Locator;
15
+ readonly workspaceWizardEnvironmentsHeading: Locator;
10
16
  readonly projectNameInput: Locator;
11
17
  readonly formNameInput: Locator;
12
18
  readonly chooseBpmnTemplateButton: Locator;
@@ -57,6 +63,7 @@ declare class ModelerHomePage {
57
63
  returnToResourceContainer(): Promise<void>;
58
64
  startBlankBpmnDiagram(): Promise<void>;
59
65
  private becameVisible;
66
+ private createWorkspaceViaWizard;
60
67
  clickHomeBreadcrumb(): Promise<void>;
61
68
  clickOpenOrganizationsButton(): Promise<void>;
62
69
  createForm(formName: string): Promise<void>;