@camunda/e2e-test-suite 0.0.1771 → 0.0.1772

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.
@@ -520,15 +520,75 @@ async function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePage, modele
520
520
  // a longer one widens the overflow tooltip until it covers the Rename item.
521
521
  await (0, fileUpload_1.uploadFile)(page, 'SM-8.10/SM_Document_Handling_Connectors_User_Flow.bpmn');
522
522
  await modelerHomePage.clickProcessDiagram('SM_Document_Handling_Connectors_User_Flow');
523
+ // A content autosave racing the file rename gets a 409, and Web Modeler's
524
+ // re-sync drops unsaved property edits, so wait for a save carrying them.
525
+ const fileSaveBody = (response) => {
526
+ const request = response.request();
527
+ if (request.method() !== 'PATCH' ||
528
+ !response.ok() ||
529
+ !/\/api\/internal\/files\/[^/]+$/.test(new URL(response.url()).pathname)) {
530
+ return null;
531
+ }
532
+ return request.postData();
533
+ };
534
+ let processRenameSaved = false;
535
+ const trackProcessRename = (response) => {
536
+ const body = fileSaveBody(response);
537
+ if (!body) {
538
+ return;
539
+ }
540
+ try {
541
+ const content = JSON.parse(body).content;
542
+ const processTag = typeof content === 'string'
543
+ ? content.match(/<bpmn:process\b[^>]*>/)?.[0]
544
+ : undefined;
545
+ if (processTag?.includes(`id="${processName}"`) &&
546
+ processTag.includes(`name="${processName}"`)) {
547
+ processRenameSaved = true;
548
+ }
549
+ }
550
+ catch {
551
+ // Non-JSON body: not a content save.
552
+ }
553
+ };
523
554
  await modelerCreatePage.clickDiagramBreadcrumb();
524
555
  await modelerCreatePage.clickEditDiagramNameButton();
525
- await modelerCreatePage.enterDiagramName(processName);
526
- await modelerCreatePage.clickGeneralPropertiesPanel();
527
- await modelerCreatePage.clickNameInput();
528
- await modelerCreatePage.fillNameInput(processName);
529
- await modelerCreatePage.clickIdInput();
530
- await modelerCreatePage.fillIdInput(processName);
531
- await (0, sleep_1.sleep)(10000);
556
+ let fileRenameSaved = false;
557
+ const trackFileRename = (response) => {
558
+ const body = fileSaveBody(response);
559
+ try {
560
+ if (body && JSON.parse(body).name === processName) {
561
+ fileRenameSaved = true;
562
+ }
563
+ }
564
+ catch {
565
+ // Non-JSON body: not a rename.
566
+ }
567
+ };
568
+ page.on('response', trackFileRename);
569
+ try {
570
+ await modelerCreatePage.enterDiagramName(processName);
571
+ await test_1.expect.poll(() => fileRenameSaved, { timeout: 30000 }).toBe(true);
572
+ }
573
+ finally {
574
+ page.off('response', trackFileRename);
575
+ }
576
+ page.on('response', trackProcessRename);
577
+ try {
578
+ await (0, test_1.expect)(async () => {
579
+ if (!processRenameSaved) {
580
+ await modelerCreatePage.clickGeneralPropertiesPanel();
581
+ await modelerCreatePage.clickNameInput();
582
+ await modelerCreatePage.fillNameInput(processName);
583
+ await modelerCreatePage.clickIdInput();
584
+ await modelerCreatePage.fillIdInput(processName);
585
+ }
586
+ await test_1.expect.poll(() => processRenameSaved, { timeout: 20000 }).toBe(true);
587
+ }).toPass({ timeout: 120000 });
588
+ }
589
+ finally {
590
+ page.off('response', trackProcessRename);
591
+ }
532
592
  await modelerCreatePage.clickFirstPlaceRESTConnector();
533
593
  await modelerCreatePage.clickChangeTypeButton();
534
594
  await modelerCreatePage.clickMarketPlaceButton();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1771",
3
+ "version": "0.0.1772",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",