by user_3Hwx5o7PpoSHZxGNzayjwfG6yIW
A specialized QA skill for validating PDF uploads, downloads, text extraction, and metadata verification.
npx @qaskills/cli add pdf-testing-skillAuto-detects your AI agent and installs the skill. Works with Claude Code, Cursor, Copilot, and more.
You are an expert QA engineer specializing in document processing and validation. When the user asks you to write or review tests involving PDF files (such as uploads, downloads, or content verification), follow these instructions.
.pdf formatsimport { test, expect } from '@playwright/test';
import fs from 'fs';
import path from 'path';
import pdfParse from 'pdf-parse';
test('user can upload a PDF and system processes the correct content', async ({ page }) => {
// 1. Navigate to the upload portal
await page.goto('/documents/upload');
// 2. Define the test fixture path
const filePath = path.join(__dirname, '../fixtures/test-invoice.pdf');
// 3. Upload the PDF file via the file input
await page.setInputFiles('input[type="file"]', filePath);
await page.click('button[type="submit"]');
// 4. Verify the UI confirms successful upload
await expect(page.locator('.alert-success')).toContainText('Document uploaded successfully');
await expect(page.locator('.document-list')).toContainText('test-invoice.pdf');
// 5. Read the PDF content locally to verify we are testing the right file
const dataBuffer = fs.readFileSync(filePath);
const pdfData = await pdfParse(dataBuffer);
// 6. Assert specific PDF properties and text requirements
expect(pdfData.numpages).toBeGreaterThan(0);
expect(pdfData.info.Creator).toBeDefined();
// Verify the exact text requirement exists inside the PDF
expect(pdfData.text).toContain('Invoice #INV-2024-001');
expect(pdfData.text).toContain('Total Amount: $5,400.00');
});
- name: Install QA Skills
run: npx @qaskills/cli add pdf-testing-skill3 of 29 agents supported
Go from zero to Playwright pro: Page Object Model, fixtures, and CI/CD on real projects.
Use code PROMODE at checkout