@camunda/e2e-test-suite 0.0.1481 → 0.0.1482
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/dist/pages/8.9/ClusterPage.js +44 -13
- package/package.json +1 -1
|
@@ -268,9 +268,11 @@ class ClusterPage {
|
|
|
268
268
|
const currentUrl = this.page.url();
|
|
269
269
|
const clusterId = this.extractClusterIdFromUrl(currentUrl);
|
|
270
270
|
console.log(`🎉 Cluster "${clusterName}" created successfully with ID: ${clusterId || 'Unknown'} at ${new Date().toISOString()}`);
|
|
271
|
+
return true;
|
|
271
272
|
}
|
|
272
273
|
catch (error) {
|
|
273
274
|
console.warn(`⚠️ Could not extract cluster info for "${clusterName}": ${error}`);
|
|
275
|
+
return false;
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
278
|
async createCluster(name, region = 'GCP', tasklistV1Api) {
|
|
@@ -282,19 +284,48 @@ class ClusterPage {
|
|
|
282
284
|
await this.page.waitForTimeout(3000);
|
|
283
285
|
await this.page.reload({ waitUntil: 'domcontentloaded' }).catch(() => { });
|
|
284
286
|
await this.deleteCluster(name);
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
287
|
+
// The create request goes to the Console API, which Hub's other Console
|
|
288
|
+
// calls show being CORS-blocked (net::ERR_FAILED) in bursts. When the
|
|
289
|
+
// POST itself is blocked, the page never moves to the new cluster and no
|
|
290
|
+
// cluster exists, so waiting for its row can never succeed. Resubmit the
|
|
291
|
+
// form, but only once the list (reloaded, as its fetch can fail too)
|
|
292
|
+
// confirms the cluster really is missing, so a slow navigation does not
|
|
293
|
+
// produce a duplicate.
|
|
294
|
+
const maxSubmitAttempts = 3;
|
|
295
|
+
for (let attempt = 1; attempt <= maxSubmitAttempts; attempt++) {
|
|
296
|
+
await this.clickCreateNewClusterButton();
|
|
297
|
+
await this.clickClusterNameInput();
|
|
298
|
+
await this.fillClusterNameInput(name);
|
|
299
|
+
await this.clickClusterType();
|
|
300
|
+
await this.page
|
|
301
|
+
.getByRole('tab', { name: region })
|
|
302
|
+
.or(this.page.getByRole('radio', { name: region, exact: true }))
|
|
303
|
+
.click();
|
|
304
|
+
await this.selectSubRegion(region);
|
|
305
|
+
await this.clickClusterOption();
|
|
306
|
+
await this.determineTasklistAPI(tasklistV1Api);
|
|
307
|
+
await this.clickCreateClusterButton();
|
|
308
|
+
if ((await this.logClusterCreationInfo(name)) ||
|
|
309
|
+
attempt === maxSubmitAttempts) {
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
await this.clickClusterBanner().catch(() => { });
|
|
313
|
+
const listed = await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.clusterLink(name), {
|
|
314
|
+
postAction: async () => {
|
|
315
|
+
await this.page.reload({ waitUntil: 'domcontentloaded' });
|
|
316
|
+
await this.clickClusterBanner();
|
|
317
|
+
},
|
|
318
|
+
totalTimeout: 150000,
|
|
319
|
+
visibilityTimeout: 30000,
|
|
320
|
+
maxRetries: 3,
|
|
321
|
+
})
|
|
322
|
+
.then(() => true)
|
|
323
|
+
.catch(() => false);
|
|
324
|
+
if (listed) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
console.warn(`createCluster: "${name}" was not created (attempt ${attempt}/${maxSubmitAttempts}); resubmitting the form`);
|
|
328
|
+
}
|
|
298
329
|
await this.clickClustersBreadcrumb(name);
|
|
299
330
|
}
|
|
300
331
|
async determineTasklistAPI(tasklistV1Api) {
|