@camunda/e2e-test-suite 0.0.1578 → 0.0.1580

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.
@@ -44,25 +44,46 @@ class ConnectorTemplatePage {
44
44
  }
45
45
  const dialog = this.page.getByRole('dialog');
46
46
  await dialog.waitFor({ state: 'visible', timeout: 30000 });
47
- // The version field is prefilled with the template's own version. When that
48
- // version is already published, the form rejects it, so there is nothing
49
- // left to publish.
50
- const alreadyPublished = await dialog
47
+ // Web Modeler refuses to publish, and keeps this dialog open, when its
48
+ // dry run reports that v12 is already published (invalid version number)
49
+ // or that another file in the project already published this template ID
50
+ // (ID conflict). Both mean the REST template is already available in the
51
+ // project. Workers share the project and upload/publish the template
52
+ // concurrently, so either can appear before or only after clicking Publish.
53
+ const alreadyPublished = dialog
51
54
  .getByText(/Enter a version number greater than/)
55
+ .or(dialog.getByText(/is already (used in|in use)/))
56
+ .first();
57
+ const refused = await alreadyPublished
52
58
  .waitFor({ state: 'visible', timeout: 5000 })
53
59
  .then(() => true)
54
60
  .catch(() => false);
55
- if (alreadyPublished) {
61
+ if (!refused) {
56
62
  await dialog
57
- .getByRole('button', { name: 'Cancel', exact: true })
63
+ .getByRole('button', { name: 'Publish', exact: true })
58
64
  .click({ timeout: 30000 });
59
- await (0, test_1.expect)(dialog).toBeHidden({ timeout: 30000 });
60
- return;
65
+ const outcome = await Promise.race([
66
+ dialog
67
+ .waitFor({ state: 'hidden', timeout: 60000 })
68
+ .then(() => 'published')
69
+ .catch(() => 'timeout'),
70
+ alreadyPublished
71
+ .waitFor({ state: 'visible', timeout: 60000 })
72
+ .then(() => 'refused')
73
+ .catch(() => 'timeout'),
74
+ ]);
75
+ if (outcome === 'published') {
76
+ return;
77
+ }
78
+ if (outcome === 'timeout') {
79
+ // Neither published nor refused: fail with the dialog still open.
80
+ await (0, test_1.expect)(dialog).toBeHidden({ timeout: 1000 });
81
+ }
61
82
  }
62
83
  await dialog
63
- .getByRole('button', { name: 'Publish', exact: true })
84
+ .getByRole('button', { name: 'Cancel', exact: true })
64
85
  .click({ timeout: 30000 });
65
- await (0, test_1.expect)(dialog).toBeHidden({ timeout: 60000 });
86
+ await (0, test_1.expect)(dialog).toBeHidden({ timeout: 30000 });
66
87
  }
67
88
  async publishConnector() {
68
89
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1578",
3
+ "version": "0.0.1580",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",