Merge pull request #2027 from automatisch/harden-webhook-tests
test: harden webhook tests
This commit is contained in:
@@ -11,7 +11,6 @@ export class FlowEditorPage extends AuthenticatedPage {
|
||||
constructor(page) {
|
||||
super(page);
|
||||
|
||||
this.page = page;
|
||||
this.appAutocomplete = this.page.getByTestId('choose-app-autocomplete');
|
||||
this.eventAutocomplete = this.page.getByTestId('choose-event-autocomplete');
|
||||
this.continueButton = this.page.getByTestId('flow-substep-continue-button');
|
||||
@@ -77,7 +76,8 @@ export class FlowEditorPage extends AuthenticatedPage {
|
||||
}
|
||||
|
||||
async testAndContinue() {
|
||||
await this.continueButton.last().click();
|
||||
await expect(this.continueButton).toHaveCount(1);
|
||||
await this.continueButton.click();
|
||||
await expect(this.testOutput).toBeVisible();
|
||||
await this.continueButton.click();
|
||||
}
|
||||
|
@@ -20,14 +20,16 @@ test.describe('Webhook flow', () => {
|
||||
|
||||
await flowEditorPage.chooseAppAndEvent('Webhook', 'Respond with');
|
||||
|
||||
await expect(flowEditorPage.continueButton.last()).not.toBeEnabled();
|
||||
await expect(flowEditorPage.continueButton).toHaveCount(1);
|
||||
await expect(flowEditorPage.continueButton).not.toBeEnabled();
|
||||
|
||||
await page
|
||||
.getByTestId('parameters.statusCode-power-input')
|
||||
.locator('[contenteditable]')
|
||||
.fill('200');
|
||||
await flowEditorPage.clickAway();
|
||||
await expect(flowEditorPage.continueButton.last()).not.toBeEnabled();
|
||||
await expect(flowEditorPage.continueButton).toHaveCount(1);
|
||||
await expect(flowEditorPage.continueButton).not.toBeEnabled();
|
||||
|
||||
await page
|
||||
.getByTestId('parameters.body-power-input')
|
||||
@@ -54,15 +56,16 @@ test.describe('Webhook flow', () => {
|
||||
const asyncWebhookUrl = await flowEditorPage.createWebhookTrigger(false);
|
||||
|
||||
await flowEditorPage.chooseAppAndEvent('Webhook', 'Respond with');
|
||||
|
||||
await expect(flowEditorPage.continueButton.last()).not.toBeEnabled();
|
||||
await expect(flowEditorPage.continueButton).toHaveCount(1);
|
||||
await expect(flowEditorPage.continueButton).not.toBeEnabled();
|
||||
|
||||
await page
|
||||
.getByTestId('parameters.statusCode-power-input')
|
||||
.locator('[contenteditable]')
|
||||
.fill('200');
|
||||
await flowEditorPage.clickAway();
|
||||
await expect(flowEditorPage.continueButton.last()).not.toBeEnabled();
|
||||
await expect(flowEditorPage.continueButton).toHaveCount(1);
|
||||
await expect(flowEditorPage.continueButton).not.toBeEnabled();
|
||||
|
||||
await page
|
||||
.getByTestId('parameters.body-power-input')
|
||||
|
Reference in New Issue
Block a user