test-infrastructure_skill

This skill enables rapid test authoring with reusable 46 methods, base cases, and traits across unit, feature, and browser tests.
  • TypeScript

1

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill hackur/web-standards-playground-showcase --skill test-infrastructure

  • SKILL.md13.4 KB

Overview

This skill provides a reusable TypeScript-friendly test infrastructure port of PCR Card's test helpers: 46 methods across five traits and two base test cases to speed test authoring. It bundles user, submission, card creation helpers, state and payment assertions, plus Nova and API base test classes for consistent setup and authentication. Use it to write clear, expressive unit, feature, browser, and API tests faster.

How this skill works

The package exposes Traits for creating users, submissions, and cards and Traits for asserting submission/card states and payment conditions. Two base test cases (NovaTestCase and ApiTestCase) provide authenticated contexts and common assertion helpers. Tests call factory helpers to build objects, then use assertion helpers to verify states, payments, transitions, and API/Nova responses.

When to use it

  • Writing new PHPUnit unit or feature tests
  • Composing Laravel Dusk browser tests for payment or workflow flows
  • Creating submissions or cards in specific states for isolated tests
  • Asserting payment amounts, promo codes, and manual payment statuses
  • Testing Nova resources or authenticated API endpoints

Best practices

  • Use create* helpers to build minimal, deterministic fixtures instead of manual factory setup
  • Prefer assert* helpers for state and payment checks to keep tests readable and consistent
  • Use NovaTestCase/ApiTestCase for authentication and environment setup in resource/API tests
  • Group transitions and assertions to document workflows (create → submit → pay → complete)
  • Run lightweight unit suites during development, and use visible browser scripts for debugging UI flows

Example use cases

  • Unit test a submission workflow: create customer, draft submission, add cards, transition states, assert terminal status
  • Feature test payment logic: create submitted submission, simulate payment, assert totals and promo discounts
  • Browser test payment flow with Dusk: run visible-test to step through headed Chrome scenarios
  • API test endpoint validation with ApiTestCase and Sanctum tokens
  • Nova resource tests: authenticate as admin/technician and assert index/create responses

FAQ

There are 46 reusable methods across five Traits and two base test cases.

Where are the helpers located?

All helpers live under tests/Support/, organized into Base/ (NovaTestCase, ApiTestCase) and Traits/ (CreatesUsers, CreatesSubmissions, CreatesCards, AssertsStates, AssertsPayments).

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational