@camunda/e2e-test-suite 0.0.768 → 0.0.770
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.
|
@@ -193,6 +193,7 @@ declare class ModelerCreatePage {
|
|
|
193
193
|
fillZeebeRestValue(zeebeUrl: string): Promise<void>;
|
|
194
194
|
embedForm(formName: string): Promise<void>;
|
|
195
195
|
clickFirstPlaceRESTConnector(): Promise<void>;
|
|
196
|
+
dismissCreatePad(): Promise<void>;
|
|
196
197
|
setOAuthTokenEndpoint(elementToClick: Locator, endpoint: string, options?: {
|
|
197
198
|
retries?: number;
|
|
198
199
|
settleMs?: number;
|
|
@@ -1168,11 +1168,39 @@ class ModelerCreatePage {
|
|
|
1168
1168
|
async clickFirstPlaceRESTConnector() {
|
|
1169
1169
|
await this.firstPlaceRESTConnector.click({ timeout: 60000 });
|
|
1170
1170
|
}
|
|
1171
|
+
async dismissCreatePad() {
|
|
1172
|
+
// Hovering or selecting a bpmn element renders a floating create-pad next
|
|
1173
|
+
// to it. When the next task to click sits under that pad, the pad's
|
|
1174
|
+
// "Append task" entry intercepts the pointer event and the click never
|
|
1175
|
+
// lands. Move the pointer off the canvas so the pad collapses and detaches
|
|
1176
|
+
// before the next click.
|
|
1177
|
+
const createPad = this.page.locator('.djs-create-pad.open').first();
|
|
1178
|
+
await this.page.mouse.move(0, 0);
|
|
1179
|
+
await createPad
|
|
1180
|
+
.waitFor({ state: 'hidden', timeout: 10000 })
|
|
1181
|
+
.catch(() => false);
|
|
1182
|
+
}
|
|
1171
1183
|
async setOAuthTokenEndpoint(elementToClick, endpoint, options) {
|
|
1172
1184
|
const retries = options?.retries ?? 2;
|
|
1173
1185
|
const settleMs = options?.settleMs ?? 250;
|
|
1174
1186
|
const openPanel = options?.openPanel ?? false;
|
|
1175
|
-
|
|
1187
|
+
// The create-pad can reappear when Playwright hovers the target to click
|
|
1188
|
+
// it, so dismiss it and retry rather than relying on a single dismissal.
|
|
1189
|
+
let clickError;
|
|
1190
|
+
for (let attempt = 1; attempt <= 3; attempt++) {
|
|
1191
|
+
await this.dismissCreatePad();
|
|
1192
|
+
try {
|
|
1193
|
+
await elementToClick.click({ timeout: 20000 });
|
|
1194
|
+
clickError = undefined;
|
|
1195
|
+
break;
|
|
1196
|
+
}
|
|
1197
|
+
catch (err) {
|
|
1198
|
+
clickError = err;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
if (clickError) {
|
|
1202
|
+
throw clickError;
|
|
1203
|
+
}
|
|
1176
1204
|
if (openPanel) {
|
|
1177
1205
|
await this.clickOpenDetailsPanel();
|
|
1178
1206
|
}
|
|
@@ -691,29 +691,50 @@ class ModelerCreatePage {
|
|
|
691
691
|
await this.continueToPlayButton.click({ timeout: 30000 });
|
|
692
692
|
}
|
|
693
693
|
async clickWebhookStartEventConnectorOption() {
|
|
694
|
-
const maxRetries =
|
|
694
|
+
const maxRetries = 4;
|
|
695
695
|
for (let retries = 0; retries < maxRetries; retries++) {
|
|
696
696
|
try {
|
|
697
697
|
if (retries === 0) {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
698
|
+
// If the change type panel is not showing the connector (e.g. after
|
|
699
|
+
// visiting the marketplace), reopen it before waiting for the option.
|
|
700
|
+
const isAlreadyVisible = await this.webhookMessageStartEventConnectorOption.isVisible();
|
|
701
|
+
if (!isAlreadyVisible) {
|
|
702
|
+
await this.changeTypeButton.click({ force: true, timeout: 30000 });
|
|
703
|
+
}
|
|
701
704
|
}
|
|
702
705
|
else {
|
|
706
|
+
// Reload to pick up newly-downloaded connector templates, then
|
|
707
|
+
// re-select the start event element and open the type picker.
|
|
703
708
|
await this.page.reload();
|
|
704
|
-
await this.
|
|
705
|
-
await this.
|
|
706
|
-
|
|
709
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
710
|
+
await this.firstElement.waitFor({
|
|
711
|
+
state: 'visible',
|
|
712
|
+
timeout: 30000,
|
|
707
713
|
});
|
|
714
|
+
await this.firstElement.click({ timeout: 30000 });
|
|
715
|
+
await this.changeTypeButton.click({ force: true, timeout: 30000 });
|
|
708
716
|
}
|
|
717
|
+
// Use a longer timeout to allow the connector to finish registering
|
|
718
|
+
// after a marketplace download before giving up.
|
|
719
|
+
await (0, test_1.expect)(this.webhookMessageStartEventConnectorOption).toBeVisible({
|
|
720
|
+
timeout: 60000,
|
|
721
|
+
});
|
|
722
|
+
await this.webhookMessageStartEventConnectorOption.scrollIntoViewIfNeeded();
|
|
723
|
+
// force: true bypasses context-pad overlays that can intercept clicks
|
|
724
|
+
await this.webhookMessageStartEventConnectorOption.click({
|
|
725
|
+
timeout: 60000,
|
|
726
|
+
force: true,
|
|
727
|
+
});
|
|
709
728
|
return;
|
|
710
729
|
}
|
|
711
730
|
catch (error) {
|
|
712
|
-
console.error(`
|
|
713
|
-
|
|
731
|
+
console.error(`Attempt ${retries + 1} failed to click webhook start event connector option: ${error}`);
|
|
732
|
+
if (retries < maxRetries - 1) {
|
|
733
|
+
await new Promise((resolve) => setTimeout(resolve, 5000));
|
|
734
|
+
}
|
|
714
735
|
}
|
|
715
736
|
}
|
|
716
|
-
throw new Error(`Failed to click
|
|
737
|
+
throw new Error(`Failed to click webhook start event connector option after ${maxRetries} attempts.`);
|
|
717
738
|
}
|
|
718
739
|
async clickWebhookIdInput() {
|
|
719
740
|
await this.webhookIdInput.click();
|