@camunda/e2e-test-suite 0.0.508 → 0.0.509

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.
@@ -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.509",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",