@camunda/e2e-test-suite 0.0.508 → 0.0.510

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.
@@ -74,9 +74,6 @@ class ClusterDetailsPage {
74
74
  .locator('label')
75
75
  .filter({ hasText: /^Administration API - Resource: Secrets$/ });
76
76
  this.createButton = page.getByRole('button', { name: 'Create', exact: true });
77
- this.closeModalButton = page
78
- .getByRole('dialog', { name: 'Client credentials', exact: true })
79
- .getByLabel('Close');
80
77
  this.createClientButton = page.getByRole('button', {
81
78
  name: 'Create new Client',
82
79
  });
@@ -91,10 +88,12 @@ class ClusterDetailsPage {
91
88
  this.createClientCredentialsDialog = page.getByRole('dialog', {
92
89
  name: 'Create new client credentials',
93
90
  });
94
- this.clientCredentialsDialog = page.getByRole('dialog', {
95
- name: 'Client credentials',
96
- exact: true,
91
+ // Use a content-based locator so the test stays robust if the dialog
92
+ // title is ever renamed in the Console UI.
93
+ this.clientCredentialsDialog = page.getByRole('dialog').filter({
94
+ has: page.getByText('The Client Secret will not be shown again.'),
97
95
  });
96
+ this.closeModalButton = this.clientCredentialsDialog.getByLabel('Close');
98
97
  this.clustersLink = page
99
98
  .getByRole('banner')
100
99
  .getByRole('link', { name: 'Clusters' });
@@ -429,7 +428,7 @@ class ClusterDetailsPage {
429
428
  await this.checkSecretsCheckbox();
430
429
  await this.clickCreateButton();
431
430
  await (0, test_1.expect)(this.clientCredentialsDialog).toBeVisible({
432
- timeout: 20000,
431
+ timeout: 60000,
433
432
  });
434
433
  await (0, test_1.expect)(this.clientCredentialsDialog
435
434
  .getByText('The Client Secret will not be shown again.')
@@ -64,6 +64,14 @@ class LoginPage {
64
64
  }
65
65
  async loginWithTestUser(credentials = {}) {
66
66
  const { username = process.env.C8_USERNAME_TEST, password = process.env.C8_PASSWORD_TEST, } = credentials;
67
+ // Navigate to app root to trigger auth redirect. The Console app (at
68
+ // console.* hostnames) embeds a hidden invite-user email input also labeled
69
+ // "Email address" that would otherwise satisfy the locator below before the
70
+ // auth0 redirect has had a chance to complete.
71
+ await this.page.goto('/');
72
+ await this.page
73
+ .waitForURL((url) => !url.hostname.includes('console'), { timeout: 60000 })
74
+ .catch(() => { });
67
75
  await (0, test_1.expect)(this.usernameInput.locator).toBeVisible({ timeout: 120000 });
68
76
  await this.fillUsername(username);
69
77
  await this.clickContinueButton();
@@ -23,6 +23,7 @@ declare class ModelerHomePage {
23
23
  readonly uploadFilesButton: Locator;
24
24
  readonly messageBanner: Locator;
25
25
  readonly closeButton: Locator;
26
+ readonly modalCloseButton: Locator;
26
27
  constructor(page: Page);
27
28
  clickCreateNewProjectButton(): Promise<void>;
28
29
  enterNewProjectName(name: string): Promise<void>;
@@ -27,6 +27,7 @@ class ModelerHomePage {
27
27
  uploadFilesButton;
28
28
  messageBanner;
29
29
  closeButton;
30
+ modalCloseButton;
30
31
  constructor(page) {
31
32
  this.page = page;
32
33
  this.modelerPageBanner = page
@@ -66,11 +67,18 @@ class ModelerHomePage {
66
67
  this.uploadFilesButton = page.getByRole('menuitem', { name: 'Upload files' });
67
68
  this.messageBanner = page.locator('[data-test="close-top-banner"]');
68
69
  this.closeButton = page.getByRole('button', { name: 'Got it - Dismiss' });
70
+ this.modalCloseButton = page.locator('.cds--modal.is-visible .cds--modal-close');
69
71
  }
70
72
  async clickCreateNewProjectButton() {
71
73
  await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.createNewProjectButton, {
72
74
  totalTimeout: 30000,
73
75
  });
76
+ // The WhatsNew modal renders lazily after page load and intercepts clicks.
77
+ // Wait up to 5s for its dismiss button; click it if it appears, then proceed.
78
+ await this.closeButton
79
+ .waitFor({ state: 'visible', timeout: 5000 })
80
+ .then(() => this.closeButton.click())
81
+ .catch(() => { });
74
82
  await this.createNewProjectButton.click();
75
83
  }
76
84
  async enterNewProjectName(name) {
@@ -168,7 +176,9 @@ class ModelerHomePage {
168
176
  }
169
177
  async clickMessageBanner() {
170
178
  try {
171
- const banner = this.messageBanner.or(this.closeButton);
179
+ const banner = this.messageBanner
180
+ .or(this.closeButton)
181
+ .or(this.modalCloseButton);
172
182
  if (await banner.isVisible({ timeout: 2000 })) {
173
183
  await banner.click();
174
184
  }
@@ -30,7 +30,7 @@ declare class NavigationPage {
30
30
  username: string;
31
31
  password: string;
32
32
  }): Promise<void>;
33
- goToKeycloak(): Promise<void>;
33
+ goToKeycloak(maxRetries?: number): Promise<void>;
34
34
  goToOCAdmin(sleepTimeout?: number, credentials?: {
35
35
  username: string;
36
36
  password: string;
@@ -124,12 +124,27 @@ class NavigationPage {
124
124
  async goToOptimize(sleepTimeout, credentials) {
125
125
  await this.goTo(OPTIMIZE_CONTEXT_PATH, this.optimizePageBanner, sleepTimeout, credentials);
126
126
  }
127
- async goToKeycloak() {
127
+ async goToKeycloak(maxRetries = 5) {
128
128
  const keycloakUrl = process.env.KEYCLOAK_URL
129
129
  ? `${process.env.KEYCLOAK_URL}/auth`
130
130
  : '/auth';
131
- await this.page.goto(keycloakUrl);
132
- await (0, test_1.expect)(this.keyboardPageBanner).toBeVisible({ timeout: 60000 });
131
+ let lastError;
132
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
133
+ try {
134
+ await this.page.goto(keycloakUrl);
135
+ await (0, test_1.expect)(this.keyboardPageBanner).toBeVisible({ timeout: 60000 });
136
+ return;
137
+ }
138
+ catch (error) {
139
+ lastError = error;
140
+ if (attempt < maxRetries - 1) {
141
+ await (0, sleep_1.sleep)(5000);
142
+ }
143
+ }
144
+ }
145
+ throw lastError instanceof Error
146
+ ? lastError
147
+ : new Error(`goToKeycloak failed after ${maxRetries} attempts`);
133
148
  }
134
149
  async goToOCAdmin(sleepTimeout, credentials) {
135
150
  await this.goTo(`${NORMALIZED_ORCHESTRATION_CONTEXT_PATH}/admin`, this.identityPageBanner, sleepTimeout, credentials);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.508",
3
+ "version": "0.0.510",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",