test: Migrate Cypress webhook tests to Playwright (#19491)

This commit is contained in:
Declan Carroll
2025-09-15 10:40:19 +01:00
committed by GitHub
parent 87d79c9efb
commit b5adcc8f9f
4 changed files with 274 additions and 262 deletions

View File

@@ -473,6 +473,10 @@ export class NodeDetailsViewPage extends BasePage {
return this.getNodeParameters().locator('input[placeholder*="Add Value"]');
}
getCollectionAddOptionSelect() {
return this.getNodeParameters().getByTestId('collection-add-option-select');
}
getParameterSwitch(parameterName: string) {
return this.getParameterInput(parameterName).locator('.el-switch');
}
@@ -846,4 +850,31 @@ export class NodeDetailsViewPage extends BasePage {
getCredentialLabel(credentialType: string) {
return this.page.getByText(credentialType);
}
getWebhookTestEvent() {
return this.page.getByText('Listening for test event');
}
getAddOptionDropdown() {
return this.page.getByRole('combobox', { name: 'Add option' });
}
/**
* Adds an optional parameter from a collection dropdown
* @param optionDisplayName - The display name of the option to add (e.g., 'Response Code')
* @param parameterName - The parameter name to set after adding (e.g., 'responseCode')
* @param parameterValue - The value to set for the parameter
*/
async setOptionalParameter(
optionDisplayName: string,
parameterName: string,
parameterValue: string | boolean,
): Promise<void> {
await this.getAddOptionDropdown().click();
// Step 2: Select the option by display name
await this.page.getByRole('option', { name: optionDisplayName }).click();
// Step 3: Set the parameter value
await this.setupHelper.setParameter(parameterName, parameterValue);
}
}