@testdino/playwright 1.0.1
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/LICENSE +71 -0
- package/README.md +307 -0
- package/bin/tdpw.js +12 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +759 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/index.mjs +751 -0
- package/dist/cli/index.mjs.map +1 -0
- package/dist/index.d.mts +779 -0
- package/dist/index.d.ts +779 -0
- package/dist/index.js +2695 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2688 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
PROPRIETARY SOFTWARE LICENSE AGREEMENT
|
|
2
|
+
|
|
3
|
+
Copyright © 2025 TestDino. All rights reserved.
|
|
4
|
+
|
|
5
|
+
IMPORTANT: READ CAREFULLY BEFORE INSTALLING OR USING THIS SOFTWARE
|
|
6
|
+
|
|
7
|
+
This software and associated documentation files (the "Software") are proprietary
|
|
8
|
+
to TestDino ("Licensor"). By installing, copying, or otherwise using the Software,
|
|
9
|
+
you agree to be bound by the terms of this Agreement.
|
|
10
|
+
|
|
11
|
+
1. LICENSE GRANT
|
|
12
|
+
Subject to your compliance with this Agreement, Licensor grants you a limited,
|
|
13
|
+
non-exclusive, non-transferable, revocable license to use the Software solely
|
|
14
|
+
for the purpose of integrating with TestDino's services.
|
|
15
|
+
|
|
16
|
+
2. RESTRICTIONS
|
|
17
|
+
You may NOT:
|
|
18
|
+
a) Copy, modify, or create derivative works of the Software
|
|
19
|
+
b) Reverse engineer, decompile, or disassemble the Software
|
|
20
|
+
c) Distribute, sublicense, rent, lease, or lend the Software
|
|
21
|
+
d) Remove or alter any proprietary notices or labels on the Software
|
|
22
|
+
e) Use the Software in any way that violates applicable laws or regulations
|
|
23
|
+
f) Use the Software to develop competing products or services
|
|
24
|
+
|
|
25
|
+
3. OWNERSHIP
|
|
26
|
+
The Software is licensed, not sold. Licensor retains all right, title, and
|
|
27
|
+
interest in and to the Software, including all intellectual property rights.
|
|
28
|
+
|
|
29
|
+
4. TERMINATION
|
|
30
|
+
This license is effective until terminated. Your rights under this license
|
|
31
|
+
will terminate automatically without notice if you fail to comply with any
|
|
32
|
+
term of this Agreement. Upon termination, you must cease all use of the
|
|
33
|
+
Software and destroy all copies.
|
|
34
|
+
|
|
35
|
+
5. WARRANTY DISCLAIMER
|
|
36
|
+
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
37
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
38
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
39
|
+
|
|
40
|
+
6. LIMITATION OF LIABILITY
|
|
41
|
+
IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
42
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING
|
|
43
|
+
FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
44
|
+
DEALINGS IN THE SOFTWARE.
|
|
45
|
+
|
|
46
|
+
7. DATA COLLECTION AND PRIVACY
|
|
47
|
+
By using this Software, you acknowledge that test execution data and metadata
|
|
48
|
+
will be transmitted to TestDino's servers as described in the documentation.
|
|
49
|
+
Please review TestDino's Privacy Policy at https://www.testdino.com/privacy
|
|
50
|
+
|
|
51
|
+
8. UPDATES AND SUPPORT
|
|
52
|
+
Licensor may provide updates, patches, or new versions of the Software at
|
|
53
|
+
its sole discretion. Support is provided as described in your TestDino
|
|
54
|
+
service agreement.
|
|
55
|
+
|
|
56
|
+
9. GOVERNING LAW
|
|
57
|
+
This Agreement shall be governed by and construed in accordance with the
|
|
58
|
+
laws of the jurisdiction in which Licensor is registered, without regard
|
|
59
|
+
to its conflict of law provisions.
|
|
60
|
+
|
|
61
|
+
10. ENTIRE AGREEMENT
|
|
62
|
+
This Agreement constitutes the entire agreement between you and Licensor
|
|
63
|
+
regarding the Software and supersedes all prior or contemporaneous
|
|
64
|
+
understandings.
|
|
65
|
+
|
|
66
|
+
For licensing inquiries or questions:
|
|
67
|
+
- Email: license@testdino.com
|
|
68
|
+
- Website: https://www.testdino.com/license
|
|
69
|
+
|
|
70
|
+
By using this Software, you acknowledge that you have read this Agreement,
|
|
71
|
+
understand it, and agree to be bound by its terms and conditions.
|
package/README.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# @testdino/playwright
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@testdino/playwright)
|
|
4
|
+
[](https://nodejs.org/)
|
|
5
|
+
|
|
6
|
+
Real-time streaming reporter and CLI for Playwright that captures comprehensive test execution data and streams it to [TestDino](https://www.testdino.com) for advanced analytics and insights.
|
|
7
|
+
|
|
8
|
+
**[Website](https://www.testdino.com)** | **[Documentation](https://www.testdino.com/docs)** | **[Get Your Token](https://www.testdino.com/docs/getting-started)**
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- **Real-time Streaming** - See your test results as they happen
|
|
13
|
+
- **Rich Metadata** - Automatic collection of Git, CI, System, and Playwright environment data
|
|
14
|
+
- **Distributed Testing** - Full support for sharded test execution across multiple machines
|
|
15
|
+
- **Production-Ready** - Built-in retry logic and graceful error handling
|
|
16
|
+
- **Zero Configuration** - Works out of the box with sensible defaults
|
|
17
|
+
- **Flexible Integration** - Use as a CLI wrapper or native Playwright reporter
|
|
18
|
+
- **Complete Visibility** - Captures test runs, individual tests, steps, errors, and console output
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install --save-dev @testdino/playwright
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Requirements:**
|
|
27
|
+
|
|
28
|
+
- Node.js >= 18.0.0
|
|
29
|
+
- @playwright/test >= 1.50.0
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
### Using the CLI (Recommended)
|
|
34
|
+
|
|
35
|
+
The `tdpw` CLI wraps Playwright's test runner, automatically configuring the TestDino reporter while passing all other options directly to Playwright.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx tdpw test [testdino-options] [playwright-options] [test-files]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Basic usage:**
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Set your token (get one at testdino.com)
|
|
45
|
+
export TESTDINO_TOKEN=your_token
|
|
46
|
+
|
|
47
|
+
# Run all tests
|
|
48
|
+
npx tdpw test
|
|
49
|
+
|
|
50
|
+
# Or pass token directly
|
|
51
|
+
npx tdpw test --token YOUR_TOKEN
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**With Playwright options:**
|
|
55
|
+
|
|
56
|
+
Any option not recognized by TestDino is passed through to Playwright:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Run specific test file
|
|
60
|
+
npx tdpw test tests/login.spec.ts
|
|
61
|
+
|
|
62
|
+
# Run in headed mode with specific browser
|
|
63
|
+
npx tdpw test --headed --project=chromium
|
|
64
|
+
|
|
65
|
+
# Run tests matching a pattern
|
|
66
|
+
npx tdpw test --grep "authentication"
|
|
67
|
+
|
|
68
|
+
# Run with multiple workers
|
|
69
|
+
npx tdpw test --workers=4
|
|
70
|
+
|
|
71
|
+
# Run in Playwright UI mode
|
|
72
|
+
npx tdpw test --ui
|
|
73
|
+
|
|
74
|
+
# Run with retries
|
|
75
|
+
npx tdpw test --retries=2
|
|
76
|
+
|
|
77
|
+
# Sharded execution
|
|
78
|
+
npx tdpw test --shard=1/3
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Common Playwright options:**
|
|
82
|
+
|
|
83
|
+
| Option | Description |
|
|
84
|
+
| ------------------- | ----------------------------- |
|
|
85
|
+
| `--headed` | Run in headed browser mode |
|
|
86
|
+
| `--ui` | Open Playwright UI mode |
|
|
87
|
+
| `--debug` | Run with Playwright Inspector |
|
|
88
|
+
| `--project=<name>` | Run specific project |
|
|
89
|
+
| `--grep=<pattern>` | Filter tests by title |
|
|
90
|
+
| `--workers=<n>` | Number of parallel workers |
|
|
91
|
+
| `--retries=<n>` | Retry failed tests |
|
|
92
|
+
| `--shard=<x/y>` | Shard tests across machines |
|
|
93
|
+
| `--timeout=<ms>` | Test timeout |
|
|
94
|
+
| `--reporter=<name>` | Add additional reporters |
|
|
95
|
+
|
|
96
|
+
For all Playwright options, see the [Playwright CLI documentation](https://playwright.dev/docs/test-cli).
|
|
97
|
+
|
|
98
|
+
### Using as a Playwright Reporter
|
|
99
|
+
|
|
100
|
+
Alternatively, add TestDino directly to your Playwright configuration:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
// playwright.config.ts
|
|
104
|
+
import { defineConfig } from '@playwright/test';
|
|
105
|
+
|
|
106
|
+
export default defineConfig({
|
|
107
|
+
reporter: [
|
|
108
|
+
['@testdino/playwright', { token: process.env.TESTDINO_TOKEN }],
|
|
109
|
+
['html'], // Combine with other reporters
|
|
110
|
+
],
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Then run tests with standard Playwright command:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npx playwright test
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Configuration
|
|
121
|
+
|
|
122
|
+
### TestDino Options
|
|
123
|
+
|
|
124
|
+
| Option | CLI Flag | Environment Variable | Description |
|
|
125
|
+
| --------- | --------------- | -------------------- | ------------------------------- |
|
|
126
|
+
| `token` | `--token`, `-t` | `TESTDINO_TOKEN` | Authentication token (required) |
|
|
127
|
+
| `debug` | `--debug` | `TESTDINO_DEBUG` | Enable debug logging |
|
|
128
|
+
| `ciRunId` | `--ci-run-id` | - | Group sharded test runs |
|
|
129
|
+
|
|
130
|
+
### Configuration File
|
|
131
|
+
|
|
132
|
+
Create `testdino.config.ts` (or `.js`) in your project root for persistent settings:
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
// testdino.config.ts
|
|
136
|
+
export default {
|
|
137
|
+
token: process.env.TESTDINO_TOKEN,
|
|
138
|
+
debug: false,
|
|
139
|
+
};
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
```javascript
|
|
143
|
+
// testdino.config.js
|
|
144
|
+
module.exports = {
|
|
145
|
+
token: process.env.TESTDINO_TOKEN,
|
|
146
|
+
};
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Dynamic configuration:**
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
export default function () {
|
|
153
|
+
return {
|
|
154
|
+
token: process.env.TESTDINO_TOKEN,
|
|
155
|
+
debug: !process.env.CI,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Configuration Priority
|
|
161
|
+
|
|
162
|
+
Settings are applied in this order (highest to lowest):
|
|
163
|
+
|
|
164
|
+
1. CLI flags (`--token`)
|
|
165
|
+
2. Config file (`testdino.config.ts`)
|
|
166
|
+
3. Playwright config (reporter options)
|
|
167
|
+
4. Environment variables (`TESTDINO_TOKEN`)
|
|
168
|
+
|
|
169
|
+
## CI/CD Integration
|
|
170
|
+
|
|
171
|
+
### GitHub Actions
|
|
172
|
+
|
|
173
|
+
```yaml
|
|
174
|
+
name: E2E Tests
|
|
175
|
+
on: [push, pull_request]
|
|
176
|
+
|
|
177
|
+
jobs:
|
|
178
|
+
test:
|
|
179
|
+
runs-on: ubuntu-latest
|
|
180
|
+
steps:
|
|
181
|
+
- uses: actions/checkout@v4
|
|
182
|
+
- uses: actions/setup-node@v4
|
|
183
|
+
with:
|
|
184
|
+
node-version: '20'
|
|
185
|
+
|
|
186
|
+
- run: npm ci
|
|
187
|
+
- run: npx playwright install --with-deps
|
|
188
|
+
|
|
189
|
+
- name: Run tests
|
|
190
|
+
env:
|
|
191
|
+
TESTDINO_TOKEN: ${{ secrets.TESTDINO_TOKEN }}
|
|
192
|
+
run: npx tdpw test
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### GitLab CI
|
|
196
|
+
|
|
197
|
+
```yaml
|
|
198
|
+
e2e-tests:
|
|
199
|
+
image: mcr.microsoft.com/playwright:v1.50.0-jammy
|
|
200
|
+
script:
|
|
201
|
+
- npm ci
|
|
202
|
+
- npx tdpw test
|
|
203
|
+
variables:
|
|
204
|
+
TESTDINO_TOKEN: $TESTDINO_TOKEN
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Sharded Execution
|
|
208
|
+
|
|
209
|
+
TestDino automatically detects shard information:
|
|
210
|
+
|
|
211
|
+
```yaml
|
|
212
|
+
# GitHub Actions matrix example
|
|
213
|
+
jobs:
|
|
214
|
+
test:
|
|
215
|
+
strategy:
|
|
216
|
+
matrix:
|
|
217
|
+
shard: [1/3, 2/3, 3/3]
|
|
218
|
+
steps:
|
|
219
|
+
- run: npx tdpw test --shard=${{ matrix.shard }}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Metadata Collection
|
|
223
|
+
|
|
224
|
+
TestDino automatically collects environment metadata at the start of each test run:
|
|
225
|
+
|
|
226
|
+
| Category | Information Collected |
|
|
227
|
+
| ---------- | ----------------------------------------------- |
|
|
228
|
+
| Git | Branch, commit, author, message, repository URL |
|
|
229
|
+
| CI | Provider, build ID, PR details (GitHub Actions) |
|
|
230
|
+
| System | OS, CPU, memory, Node.js version |
|
|
231
|
+
| Playwright | Version, workers, projects, shard info |
|
|
232
|
+
|
|
233
|
+
Metadata collection is non-blocking. Tests continue even if some metadata is unavailable.
|
|
234
|
+
|
|
235
|
+
## Troubleshooting
|
|
236
|
+
|
|
237
|
+
### Token Error
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
Token is required but not provided
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Set your token via CLI flag, environment variable, or config file.
|
|
244
|
+
|
|
245
|
+
### Quota Limit Reached
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
❌ TestDino Execution Limit Reached
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
You've reached your monthly test execution quota. The error message shows:
|
|
252
|
+
|
|
253
|
+
- Your current plan and monthly limit
|
|
254
|
+
- How many executions you've used
|
|
255
|
+
- Remaining executions available
|
|
256
|
+
- When your quota resets
|
|
257
|
+
|
|
258
|
+
**Solutions:**
|
|
259
|
+
|
|
260
|
+
1. Upgrade your plan at [testdino.com/pricing](https://www.testdino.com/pricing)
|
|
261
|
+
2. Wait for your monthly quota to reset
|
|
262
|
+
3. Contact support if you need immediate assistance
|
|
263
|
+
|
|
264
|
+
Note: Tests will still run; only streaming to TestDino is affected.
|
|
265
|
+
|
|
266
|
+
### Connection Warnings
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
WebSocket connection failed, using HTTP fallback
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
This is normal. TestDino automatically uses HTTP fallback. Tests are not affected.
|
|
273
|
+
|
|
274
|
+
### Debug Mode
|
|
275
|
+
|
|
276
|
+
Enable detailed logging:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
npx tdpw test --debug
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## FAQ
|
|
283
|
+
|
|
284
|
+
**Q: How do I get a token?**
|
|
285
|
+
Sign up at [testdino.com](https://www.testdino.com) and follow the [Getting Started Guide](https://www.testdino.com/docs/getting-started).
|
|
286
|
+
|
|
287
|
+
**Q: Can I use TestDino with other Playwright reporters?**
|
|
288
|
+
Yes. TestDino works alongside HTML, JUnit, or any other reporter.
|
|
289
|
+
|
|
290
|
+
**Q: What happens if I reach my quota limit?**
|
|
291
|
+
Your tests continue to run as normal. TestDino will display a detailed message showing your usage and provide upgrade options. Only streaming to TestDino is paused until your quota resets.
|
|
292
|
+
|
|
293
|
+
**Q: What if TestDino server is unavailable?**
|
|
294
|
+
Tests run normally. Only event streaming is affected.
|
|
295
|
+
|
|
296
|
+
**Q: Does this work with Playwright VSCode extension?**
|
|
297
|
+
Yes. Configure TestDino in `playwright.config.ts` for VSCode integration.
|
|
298
|
+
|
|
299
|
+
## Support
|
|
300
|
+
|
|
301
|
+
- [Documentation](https://www.testdino.com/docs)
|
|
302
|
+
- [Getting Started](https://www.testdino.com/docs/getting-started)
|
|
303
|
+
- [Email Support](mailto:support@testdino.com)
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
Copyright 2025 TestDino. All rights reserved.
|
package/bin/tdpw.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TestDino Playwright CLI Entry Point
|
|
5
|
+
* Imports and runs the CLI from the built dist directory
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Import the CLI from the built distribution (CommonJS)
|
|
9
|
+
import('../dist/cli/index.js').catch((error) => {
|
|
10
|
+
console.error('Failed to load CLI:', error.message);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|