Skip to content

Instantly share code, notes, and snippets.

@RF2023
RF2023 / smoke.yml
Created May 5, 2025 01:27
GitHub Actions pipeline for daily API smoke tests.
name: QA Smoke Tests
on:
schedule:
- cron: '0 7 * * *' # 7 AM EST
push:
branches: [main]
jobs:
smoke:
runs-on: ubuntu-latest
steps:
@RF2023
RF2023 / api-error.test.ts
Created May 5, 2025 01:26
Tests invalid or large payloads to ensure API stability.
import { test, expect } from '../fixtures';
test('API: Handle invalid or large payload', async ({ apiHelper }) => {
const result = await apiHelper.createUser({
name: 'Invalid User',
});
expect(result.status).toBe(201);
expect(result.body).not.toHaveProperty('email');
expect(result.body).toHaveProperty('name', 'Invalid User');
@RF2023
RF2023 / api-test.ts
Last active May 5, 2025 01:12
Playwright API test for GET POST validation with POM
import { test, expect } from '../fixtures';
test('API: GET user policy data and POST email validation', async ({ apiHelper }) => {
const getResult = await apiHelper.getUser('2');
expect(getResult.status).toBe(200);
expect(getResult.body.data).toHaveProperty('email', 'test.auto@reqres.in');
expect(getResult.body.data).toHaveProperty('first_name', 'test');
const postResult = await apiHelper.createUser({