@supatest/playwright-reporter 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,12 +19,6 @@ export default defineConfig({
19
19
  ['@supatest/playwright-reporter', {
20
20
  apiKey: process.env.SUPATEST_API_KEY,
21
21
  projectId: process.env.SUPATEST_PROJECT_ID,
22
- apiUrl: process.env.SUPATEST_API_URL, // optional, defaults to https://api.supatest.dev
23
- uploadAssets: true, // optional, default true
24
- maxConcurrentUploads: 5, // optional
25
- retryAttempts: 3, // optional
26
- timeoutMs: 30000, // optional
27
- dryRun: false, // optional, for testing
28
22
  }]
29
23
  ]
30
24
  });
@@ -32,12 +26,12 @@ export default defineConfig({
32
26
 
33
27
  ## Environment Variables
34
28
 
35
- ```bash
36
- SUPATEST_API_KEY=sk_live_... # Required: API authentication key
37
- SUPATEST_PROJECT_ID=proj_123 # Required: Project identifier
38
- SUPATEST_API_URL=https://api.supatest.dev # Optional: Custom API endpoint
39
- SUPATEST_DRY_RUN=true # Optional: Test mode (no actual uploads)
40
- ```
29
+ | Variable | Description |
30
+ |----------|-------------|
31
+ | `SUPATEST_API_KEY` | **Required.** Your Supatest API key |
32
+ | `SUPATEST_PROJECT_ID` | **Required.** Your project identifier for organizing test runs |
33
+ | `SUPATEST_API_URL` | Optional. Custom API endpoint |
34
+ | `SUPATEST_DRY_RUN` | Optional. Set to `true` to enable dry-run mode |
41
35
 
42
36
  ## Features
43
37
 
@@ -63,3 +57,65 @@ SUPATEST_DRY_RUN=true # Optional: Test mode (no actual uploads)
63
57
  - **Retry Logic**: Exponential backoff with configurable attempts
64
58
  - **Error Handling**: Graceful degradation—reporting failures don't block tests
65
59
  - **Signed URL Uploads**: Direct S3 uploads via signed URLs from API
60
+
61
+ ## Development
62
+
63
+ ### Running Tests
64
+
65
+ **Unit Tests:**
66
+ ```bash
67
+ pnpm test # Run tests in watch mode
68
+ pnpm test:run # Run tests once
69
+ pnpm test:coverage # Run tests with coverage
70
+ ```
71
+
72
+ **Integration Tests (local build):**
73
+ ```bash
74
+ pnpm test:integration # Build reporter and run full E2E test suite
75
+ ```
76
+
77
+ This will:
78
+ 1. Build the reporter package (`pnpm build`)
79
+ 2. Run the Playwright test suite in `reporter-test-suites/playwright-saucedemo/`
80
+ 3. Verify data flows to your local API (requires API running on `http://localhost:9090`)
81
+
82
+ The test suite uses a `file:` reference (`file:../../playwright-reporter`) to install from the local build output. This simulates how end users install from npm and catches packaging issues that workspace symlinks would hide.
83
+
84
+ **Testing a published version:**
85
+
86
+ To verify the published npm package works, temporarily update `reporter-test-suites/playwright-saucedemo/package.json`:
87
+ ```json
88
+ "@supatest/playwright-reporter": "^0.0.7"
89
+ ```
90
+ Then run `cd reporter-test-suites/playwright-saucedemo && pnpm install && pnpm test`. Revert to the `file:` reference afterward.
91
+
92
+ **Quick Development Loop:**
93
+ ```bash
94
+ # Terminal 1: Start local API
95
+ cd api && pnpm dev
96
+
97
+ # Terminal 2: Build reporter, run integration tests
98
+ cd playwright-reporter
99
+ pnpm test:integration
100
+ ```
101
+
102
+ ### Test Suite Configuration
103
+
104
+ The integration test suite uses `.env` configuration:
105
+
106
+ ```bash
107
+ # reporter-test-suites/playwright-saucedemo/.env
108
+ SUPATEST_API_URL=http://localhost:9090
109
+ SUPATEST_API_KEY=sk_test_...
110
+ SUPATEST_PROJECT_ID=proj_local_swaglabs
111
+ SUPATEST_DRY_RUN=false
112
+ ```
113
+
114
+ ### Verifying Integration Tests
115
+
116
+ After running `pnpm test:integration`, you should see:
117
+ - `[supatest] Run <run-id> started (X tests across Y files, Z projects)`
118
+ - `[supatest] Waiting for N pending uploads...`
119
+ - `[supatest] Run <run-id> completed: passed/failed`
120
+
121
+ Check your local API dashboard at `http://localhost:3000` to see the test results.