@camunda/e2e-test-suite 0.0.725 → 0.0.726
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.
|
@@ -7,7 +7,7 @@ declare class ConnectorMarketplacePage {
|
|
|
7
7
|
readonly closeButton: Locator;
|
|
8
8
|
readonly replaceResourceButton: Locator;
|
|
9
9
|
readonly addToProjectButton: Locator;
|
|
10
|
-
readonly
|
|
10
|
+
readonly saveAsCopyButton: Locator;
|
|
11
11
|
constructor(page: Page);
|
|
12
12
|
clickSearchForConnectorTextbox(): Promise<void>;
|
|
13
13
|
fillSearchForConnectorTextbox(connectorName: string): Promise<void>;
|
|
@@ -9,7 +9,7 @@ class ConnectorMarketplacePage {
|
|
|
9
9
|
closeButton;
|
|
10
10
|
replaceResourceButton;
|
|
11
11
|
addToProjectButton;
|
|
12
|
-
|
|
12
|
+
saveAsCopyButton;
|
|
13
13
|
constructor(page) {
|
|
14
14
|
this.page = page;
|
|
15
15
|
this.searchForConnectorTextbox = page.getByPlaceholder('Search for a connector');
|
|
@@ -24,7 +24,7 @@ class ConnectorMarketplacePage {
|
|
|
24
24
|
this.addToProjectButton = page.getByRole('button', {
|
|
25
25
|
name: 'Add to project',
|
|
26
26
|
});
|
|
27
|
-
this.
|
|
27
|
+
this.saveAsCopyButton = page.getByRole('button', { name: 'Save as copy' });
|
|
28
28
|
}
|
|
29
29
|
async clickSearchForConnectorTextbox() {
|
|
30
30
|
await this.searchForConnectorTextbox.click({ timeout: 60000 });
|
|
@@ -46,18 +46,30 @@ class ConnectorMarketplacePage {
|
|
|
46
46
|
}
|
|
47
47
|
async downloadConnectorToProject() {
|
|
48
48
|
await this.clickDownloadToProjectButton();
|
|
49
|
+
// "Download to project" opens Web Modeler's "Import resource" modal, which
|
|
50
|
+
// can take ~20s to appear. The import-confirming button depends on whether
|
|
51
|
+
// the connector template already exists in the project: an existing one
|
|
52
|
+
// shows "Save as copy" (the conflict view), a brand-new resource shows
|
|
53
|
+
// "Add to project", and older modeler builds used "Replace resource".
|
|
54
|
+
// Probe each with isVisible() and click the first that is present; never
|
|
55
|
+
// "Cancel", which aborts the import and leaves the connector out of the
|
|
56
|
+
// project, breaking the downstream change-element selection.
|
|
57
|
+
const importConfirmButtons = [
|
|
58
|
+
this.saveAsCopyButton,
|
|
59
|
+
this.addToProjectButton,
|
|
60
|
+
this.replaceResourceButton,
|
|
61
|
+
];
|
|
49
62
|
let imported = false;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (await this.cancelButton.isVisible({ timeout: 3000 }).catch(() => false)) {
|
|
59
|
-
await this.cancelButton.click({ timeout: 10000 });
|
|
63
|
+
// The first probe gets a long timeout to absorb the modal's slow (~20s)
|
|
64
|
+
// appearance; once the modal is up the remaining buttons resolve at once.
|
|
65
|
+
let probeTimeout = 60000;
|
|
66
|
+
for (const button of importConfirmButtons) {
|
|
67
|
+
if (await button.isVisible({ timeout: probeTimeout }).catch(() => false)) {
|
|
68
|
+
await button.click({ timeout: 30000 });
|
|
69
|
+
imported = true;
|
|
70
|
+
break;
|
|
60
71
|
}
|
|
72
|
+
probeTimeout = 5000;
|
|
61
73
|
}
|
|
62
74
|
// After a successful import, wait for the snackbar (confirms the connector
|
|
63
75
|
// template was received by the modeler) then close the marketplace panel so
|
|
@@ -801,11 +801,14 @@ class ModelerCreatePage {
|
|
|
801
801
|
.catch(() => false)) {
|
|
802
802
|
await changeElementSearch.pressSequentially('Worldwide Public Holiday', { delay: 50 });
|
|
803
803
|
}
|
|
804
|
-
|
|
804
|
+
// Importing via "Save as copy" can leave both the pre-existing and the
|
|
805
|
+
// newly imported template in the change-element list, so target the
|
|
806
|
+
// first match to avoid a strict-mode violation.
|
|
807
|
+
await this.publicHolidayConnectorOption.first().waitFor({
|
|
805
808
|
state: 'visible',
|
|
806
809
|
timeout: 60000,
|
|
807
810
|
});
|
|
808
|
-
await this.publicHolidayConnectorOption.click({ timeout: 30000 });
|
|
811
|
+
await this.publicHolidayConnectorOption.first().click({ timeout: 30000 });
|
|
809
812
|
return;
|
|
810
813
|
}
|
|
811
814
|
catch (error) {
|