Skip to content
Skillv1.0.0

qa-testing

Best practices de testing para Spottruck — unit, integration, e2e, coverage, bug reporting

by Yigue(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from Yigue/Spotruck (skills/qa-testing/SKILL.md). Install upstream with npx skills add Yigue/Spotruck --skill qa-testing. Copyright stays with the author.

QA Testing — Spottruck

Strategy de Testing

Pyramid:
        /\
       /e2e\         ← Pocas, críticas, end-to-end
      /------\
     /integr. \       ← Medium, servicios + DB
    /  unit    \
   /------------\     ← Muchas, rápidas, aisladas

Unit Tests

Backend (Jest + Supertest)

// Estructura: __tests__/unit/<module>.test.ts
// Cobertura mínima: 80%

describe('AuthService', () => {
  describe('login', () => {
    it('returns token given valid credentials', async () => { ... })
    it('throws 401 given invalid password', async () => { ... })
    it('rate limits after 5 failed attempts', async () => { ... })
  })
})

Frontend (Vitest + Testing Library)

// Estructura: src/__tests__/<Component>.test.tsx

it('renders trip card with correct price', () => {
  render(<TripCard trip={mockTrip} />)
  expect(screen.getByText('$45.000')).toBeInTheDocument()
})

Naming Convention

test:    <acción> given <estado> returns <resultado>
feature: <lo que prueba>

Integration Tests

// tests/integration/trips.test.ts
// Usa DB real o test containers

it('POST /trips creates trip and returns 201', async () => {
  const res = await request(app)
    .post('/api/v1/trips')
    .set('Authorization', `Bearer ${token}`)
    .send({ origin: 'Buenos Aires', ... })

  expect(res.status).toBe(201)
  expect(res.body.data.id).toBeDefined()
})

E2E Tests (Playwright)

// tests/e2e/auction-flow.spec.ts

test('company creates trip and receives bids', async ({ page }) => {
  await page.goto('http://localhost:3000/trips/new')
  await page.fill('[data-testid=origin]', 'Rosario')
  await page.fill('[data-testid=destination]', 'Buenos Aires')
  await page.click('[data-testid=submit-trip]')
  
  expect(await page.locator('[data-testid=auction-live]')).toBeVisible()
})

Coverage Requirements

Layer Minimum Report
Backend 80% clover.xml → SonarQube
Frontend 70% coverage/
E2E happy path + 5 edge cases playwright-report/

Bug Reporting

## Bug Report

**Title:** <qué> cuando <acción> resulta en <bug>

**Severity:** P0(crash)|P1(critical)|P2(major)|P3(minor)

**Steps to Reproduce:**
1. Go to ...
2. Click on ...
3. See error

**Expected:** ...
**Actual:** ...

**Console errors:**

[paste error]


**Environment:** Chrome 125, macOS, localhost:3000

Pre-Merge Gates

  • Unit tests passing (>80% coverage)
  • Integration tests passing
  • E2E smoke passing
  • No console errors en critical paths
  • Lighthouse score >80 (Performance, Accessibility)
  • Security scan clean (no secrets hardcoded)

Test Data Fixtures

// tests/fixtures/
// Mock data para todos los modelos
// Usar factories, no datos hardcoded en tests

Continuous Testing (CI)

# GitHub Actions
- run: npm test:unit
- run: npm test:integration  
- run: npm run test:e2e
- run: npm run test:coverage
- run: npx playwright show-report

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/yigue-spotruck-qa-testing/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

yigue-spotruck-qa-testing.ocm.jsonjson
{
  "ocm": "1",
  "id": "yigue-spotruck-qa-testing",
  "kind": "skill",
  "name": "qa-testing",
  "description": "Best practices de testing para Spottruck — unit, integration, e2e, coverage, bug reporting",
  "publisher": "Yigue",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "testing",
      "qa",
      "jest",
      "playwright",
      "vitest",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Best practices de testing para Spottruck — unit, integration, e2e, coverage, bug reporting"
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/Yigue/Spotruck",
      "path": "skills/qa-testing/SKILL.md",
      "ref": "08101be615d214fbaad2e4bbc36dec82c51fa73b",
      "url": "https://github.com/Yigue/Spotruck/blob/08101be615d214fbaad2e4bbc36dec82c51fa73b/skills/qa-testing/SKILL.md",
      "key": "Yigue/Spotruck/skills/qa-testing/SKILL.md"
    }
  },
  "instructions": "# QA Testing — Spottruck\n\n## Strategy de Testing\n\n```\nPyramid:\n        /\\\n       /e2e\\         ← Pocas, críticas, end-to-end\n      /------\\\n     /integr. \\       ← Medium, servicios + DB\n    /  unit    \\\n   /------------\\     ← Muchas, rápidas, aisladas\n```\n\n---\n\n## Unit Tests\n\n### Backend (Jest + Supertest)\n```typescript\n// Estructura: __tests__/unit/<module>.test.ts\n// Cobertura mínima: 80%\n\ndescribe('AuthService', () => {\n  describe('login', () => {\n    it('returns token given valid credentials', async () => { ... })\n    it('throws 401 given invalid password', async () => { ... })\n    it('r",
  "cost": {
    "context_tokens": 772
  }
}

Fetch it by URL: GET /api/v1/registry/yigue-spotruck-qa-testing/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.