test: Add core entry points to allow easier test setup (#18597)

This commit is contained in:
shortstacked
2025-08-20 16:17:57 +01:00
committed by GitHub
parent cf76165457
commit 413b14b286
15 changed files with 311 additions and 197 deletions

View File

@@ -1,23 +1,22 @@
import { test, expect } from '../../fixtures/base';
import { importAndActivateWebhookWorkflow, triggerWebhook } from '../../services/webhook-helper';
test.describe('External Webhook Triggering @auth:owner', () => {
test.describe('External Webhook Triggering', () => {
test('should create workflow via API, activate it, trigger webhook externally, and verify execution', async ({
api,
}) => {
const { webhookPath, workflowId } = await importAndActivateWebhookWorkflow(
api,
const { webhookPath, workflowId } = await api.workflowApi.importWorkflow(
'simple-webhook-test.json',
);
const testPayload = { message: 'Hello from Playwright test' };
const webhookResponse = await triggerWebhook(api, webhookPath, {
const webhookResponse = await api.request.post(`/webhook/${webhookPath}`, {
data: testPayload,
});
expect(webhookResponse.ok()).toBe(true);
const execution = await api.workflowApi.waitForExecution(workflowId, 10000);
const execution = await api.workflowApi.waitForExecution(workflowId, 5000);
expect(execution.status).toBe('success');
const executionDetails = await api.workflowApi.getExecution(execution.id);