API accepts a JSON payload (Playwright)
Generated output
Section titled “Generated output”### ✅ API accepts a JSON payload
- **Given** the client has the following JSON payload **Payload** ```json { "password": "secret", "rememberMe": true } ```- **When** the client sends the request- **Then** the response status should be 200- **And** the response body should include "token"Playwright code
Section titled “Playwright code”import { test } from '@playwright/test';import { story } from 'executable-stories-playwright';
test.describe('API', () => { test('API accepts a JSON payload', async ({}, testInfo) => { story.init(testInfo); story.given('the client has the following JSON payload'); story.json({ label: 'Payload', value: { password: 'secret', rememberMe: true, }, }); story.when('the client sends the request'); story.then('the response status should be 200'); story.then('the response body should include "token"'); });});