@camunda/e2e-test-suite 0.0.1653 → 0.0.1654
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.
|
@@ -66,28 +66,48 @@ class ConnectorTemplatePage {
|
|
|
66
66
|
.first()
|
|
67
67
|
.waitFor({ state: 'visible', timeout: 5000 })
|
|
68
68
|
.catch(() => { });
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
const readConflictingFile = async () => (await dialog
|
|
70
|
+
.locator('a[href*="/connector-templates/"]')
|
|
71
|
+
.first()
|
|
72
|
+
.innerText({ timeout: 30000 })).trim();
|
|
73
|
+
const cancel = async () => {
|
|
74
74
|
await dialog
|
|
75
75
|
.getByRole('button', { name: 'Cancel', exact: true })
|
|
76
76
|
.click({ timeout: 30000 });
|
|
77
77
|
await (0, test_1.expect)(dialog).toBeHidden({ timeout: 30000 });
|
|
78
|
+
};
|
|
79
|
+
if (await idConflictText.isVisible()) {
|
|
80
|
+
const conflictingFile = await readConflictingFile();
|
|
81
|
+
await cancel();
|
|
78
82
|
return conflictingFile;
|
|
79
83
|
}
|
|
80
84
|
if (await alreadyPublishedText.isVisible()) {
|
|
81
|
-
await
|
|
82
|
-
.getByRole('button', { name: 'Cancel', exact: true })
|
|
83
|
-
.click({ timeout: 30000 });
|
|
84
|
-
await (0, test_1.expect)(dialog).toBeHidden({ timeout: 30000 });
|
|
85
|
+
await cancel();
|
|
85
86
|
return null;
|
|
86
87
|
}
|
|
87
88
|
await dialog
|
|
88
89
|
.getByRole('button', { name: 'Publish', exact: true })
|
|
89
90
|
.click({ timeout: 30000 });
|
|
90
|
-
|
|
91
|
+
// The publish dry run that detects an ID conflict (or an already published
|
|
92
|
+
// version) is asynchronous. When it only resolves after Publish was
|
|
93
|
+
// clicked, the submit handler refuses silently and the dialog stays open
|
|
94
|
+
// showing the reason, so wait for either outcome instead of only for the
|
|
95
|
+
// dialog to close.
|
|
96
|
+
await (0, test_1.expect)(async () => {
|
|
97
|
+
if ((await idConflictText.isVisible()) ||
|
|
98
|
+
(await alreadyPublishedText.isVisible())) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
await (0, test_1.expect)(dialog).toBeHidden({ timeout: 2000 });
|
|
102
|
+
}).toPass({ timeout: 60000 });
|
|
103
|
+
if (await idConflictText.isVisible()) {
|
|
104
|
+
const conflictingFile = await readConflictingFile();
|
|
105
|
+
await cancel();
|
|
106
|
+
return conflictingFile;
|
|
107
|
+
}
|
|
108
|
+
if (await alreadyPublishedText.isVisible()) {
|
|
109
|
+
await cancel();
|
|
110
|
+
}
|
|
91
111
|
return null;
|
|
92
112
|
}
|
|
93
113
|
// Replace the whole content of the open template file. Web Modeler's Monaco
|
|
@@ -175,6 +175,14 @@ async function publishRestConnectorTemplateFile(page, modelerHomePage) {
|
|
|
175
175
|
if (!conflictingFile) {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
+
// Parallel workers that all find no REST template in the project each
|
|
179
|
+
// upload their own copy, so several files share this name. Only one of them
|
|
180
|
+
// can publish the ID; for every other copy the owner is a sibling holding
|
|
181
|
+
// the same pinned v13 content, which already makes the template available.
|
|
182
|
+
// Replacing "it" by name would just reopen a copy that cannot publish.
|
|
183
|
+
if (conflictingFile === REST_CONNECTOR_TEMPLATE_RESOURCE) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
178
186
|
const template = JSON.parse((await fetchRestConnectorTemplateV13(page)).toString('utf-8'));
|
|
179
187
|
await modelerHomePage.clickProjectBreadcrumb();
|
|
180
188
|
await page.getByPlaceholder('Filter table').fill(conflictingFile);
|