playwright-toolbox 1.0.0

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.
Files changed (44) hide show
  1. package/.changeset/README.md +9 -0
  2. package/.changeset/config.json +11 -0
  3. package/README.md +90 -0
  4. package/package.json +26 -0
  5. package/packages/playwright-config/CHANGELOG.md +21 -0
  6. package/packages/playwright-config/README.md +22 -0
  7. package/packages/playwright-config/package.json +47 -0
  8. package/packages/playwright-config/src/index.ts +21 -0
  9. package/packages/playwright-config/tsconfig.json +19 -0
  10. package/packages/playwright-history-dashboard/CHANGELOG.md +21 -0
  11. package/packages/playwright-history-dashboard/README.md +216 -0
  12. package/packages/playwright-history-dashboard/RELEASING.md +249 -0
  13. package/packages/playwright-history-dashboard/dashboard/index.html +2825 -0
  14. package/packages/playwright-history-dashboard/package-lock.json +105 -0
  15. package/packages/playwright-history-dashboard/package.json +56 -0
  16. package/packages/playwright-history-dashboard/pw-dashboard.config.js +22 -0
  17. package/packages/playwright-history-dashboard/scripts/init.ts +95 -0
  18. package/packages/playwright-history-dashboard/src/reporter.ts +376 -0
  19. package/packages/playwright-history-dashboard/tsconfig.json +19 -0
  20. package/packages/pw-standard/.eslintrc.js +23 -0
  21. package/packages/pw-standard/CHANGELOG.md +31 -0
  22. package/packages/pw-standard/README.md +50 -0
  23. package/packages/pw-standard/jest.config.js +28 -0
  24. package/packages/pw-standard/package.json +86 -0
  25. package/packages/pw-standard/src/base/index.ts +19 -0
  26. package/packages/pw-standard/src/eslint/index.ts +91 -0
  27. package/packages/pw-standard/src/eslint/rules/no-brittle-selectors.ts +53 -0
  28. package/packages/pw-standard/src/eslint/rules/no-focused-tests.ts +61 -0
  29. package/packages/pw-standard/src/eslint/rules/no-page-pause.ts +37 -0
  30. package/packages/pw-standard/src/eslint/rules/no-wait-for-timeout.ts +34 -0
  31. package/packages/pw-standard/src/eslint/rules/prefer-web-first-assertions.ts +90 -0
  32. package/packages/pw-standard/src/eslint/rules/require-test-description.ts +159 -0
  33. package/packages/pw-standard/src/eslint/types.ts +20 -0
  34. package/packages/pw-standard/src/eslint/utils/ast.ts +59 -0
  35. package/packages/pw-standard/src/index.ts +13 -0
  36. package/packages/pw-standard/src/playwright/index.ts +6 -0
  37. package/packages/pw-standard/src/tsconfig/base.json +21 -0
  38. package/packages/pw-standard/src/tsconfig/strict.json +11 -0
  39. package/packages/pw-standard/tests/eslint/no-brittle-selectors.test.ts +34 -0
  40. package/packages/pw-standard/tests/eslint/no-page-pause-and-focused.test.ts +41 -0
  41. package/packages/pw-standard/tests/eslint/no-wait-for-timeout.test.ts +30 -0
  42. package/packages/pw-standard/tests/eslint/prefer-web-first-assertions.test.ts +25 -0
  43. package/packages/pw-standard/tests/eslint/require-test-description.test.ts +49 -0
  44. package/packages/pw-standard/tsconfig.json +24 -0
@@ -0,0 +1,249 @@
1
+ # Releasing and Testing Guide
2
+
3
+ This guide explains how to:
4
+
5
+ 1. Publish updates to npmjs
6
+ 2. Test the package in `pw_ui_api` before publishing
7
+ 3. Push changes to GitHub
8
+ 4. Publish to GitHub Packages
9
+
10
+ ---
11
+
12
+ ## 1. Prerequisites
13
+
14
+ Before starting, make sure you have:
15
+
16
+ - Node.js 18+
17
+ - npm logged in for npmjs publishing (`npm login`)
18
+ - GitHub access to the repository
19
+ - A GitHub token (for GitHub Packages) with:
20
+ - `read:packages`
21
+ - `write:packages`
22
+ - `repo` (if repository is private)
23
+
24
+ Package location in this workspace:
25
+
26
+ - `package/packages/playwright-history-dashboard`
27
+
28
+ ---
29
+
30
+ ## 2. Recommended Release Flow (Safe)
31
+
32
+ Run all commands from:
33
+
34
+ ```bash
35
+ cd /Users/andersoncahet/Documents/studies/package/packages/playwright-history-dashboard
36
+ ```
37
+
38
+ ### Step A: Update version
39
+
40
+ Edit `package.json` and bump `version` (example `0.1.0` -> `0.1.1`).
41
+
42
+ Or use npm versioning:
43
+
44
+ ```bash
45
+ npm version patch
46
+ # or: npm version minor
47
+ # or: npm version major
48
+ ```
49
+
50
+ ### Step B: Build and package
51
+
52
+ ```bash
53
+ npm run build
54
+ npm pack
55
+ ```
56
+
57
+ This creates a tarball like:
58
+
59
+ - `acahet-playwright-history-dashboard-0.1.1.tgz`
60
+
61
+ ### Step C: Local test in consumer project (recommended)
62
+
63
+ Install tarball in `pw_ui_api`:
64
+
65
+ ```bash
66
+ cd /Users/andersoncahet/Documents/studies/pw_ui_api
67
+ npm i -D ../package/packages/playwright-history-dashboard/acahet-playwright-history-dashboard-0.1.1.tgz
68
+ ```
69
+
70
+ Update reporter in `playwright.config.ts` to use package reporter export:
71
+
72
+ ```ts
73
+ reporter: [
74
+ ['html', { outputFolder: playwrightReportDir }],
75
+ [
76
+ '@acahet/playwright-history-dashboard/reporter',
77
+ {
78
+ historyDir: 'tests/report/test-history',
79
+ maxRuns: 30,
80
+ },
81
+ ],
82
+ ['list'],
83
+ ['json', { outputFile: './tests/report/test-results.json' }],
84
+ ];
85
+ ```
86
+
87
+ Then run:
88
+
89
+ ```bash
90
+ npx pw-history-init
91
+ npx playwright test --project ui-tests
92
+ npm run report:history
93
+ ```
94
+
95
+ Validation checklist:
96
+
97
+ - `tests/report/test-history/index.html` exists
98
+ - `tests/report/test-history/history-index.json` is updated
99
+ - report history server opens dashboard successfully
100
+
101
+ ---
102
+
103
+ ## 3. Publish to npmjs
104
+
105
+ After local validation:
106
+
107
+ ```bash
108
+ cd /Users/andersoncahet/Documents/studies/package/packages/playwright-history-dashboard
109
+ npm publish --access public
110
+ ```
111
+
112
+ Verify:
113
+
114
+ ```bash
115
+ npm view @acahet/playwright-history-dashboard version
116
+ ```
117
+
118
+ ---
119
+
120
+ ## 4. Save to GitHub (Code Changes)
121
+
122
+ From package repository folder:
123
+
124
+ ```bash
125
+ cd /Users/andersoncahet/Documents/studies/package/packages/playwright-history-dashboard
126
+ git status
127
+ git add .
128
+ git commit -m "chore: release v0.1.1"
129
+ git push origin main
130
+ ```
131
+
132
+ Optional: add git tag matching version:
133
+
134
+ ```bash
135
+ git tag v0.1.1
136
+ git push origin v0.1.1
137
+ ```
138
+
139
+ ---
140
+
141
+ ## 5. Publish to GitHub Packages (npm.pkg.github.com)
142
+
143
+ You can publish to GitHub Packages in addition to npmjs.
144
+
145
+ ## 5.1 Confirm package scope
146
+
147
+ GitHub Packages requires package scope to match the owner namespace.
148
+
149
+ Examples:
150
+
151
+ - Owner `acahet` -> `@acahet/playwright-history-dashboard`
152
+ - Owner `acahet-automation-org` -> `@acahet-automation-org/playwright-history-dashboard`
153
+
154
+ If owner differs from current scope, update `name` in `package.json` before publishing to GitHub Packages.
155
+
156
+ ## 5.2 Configure `.npmrc`
157
+
158
+ Create or update `.npmrc` in package root:
159
+
160
+ ```ini
161
+ @acahet:registry=https://npm.pkg.github.com
162
+ //npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
163
+ ```
164
+
165
+ Replace `@acahet` with your actual scope if different.
166
+
167
+ ## 5.3 Publish to GitHub registry
168
+
169
+ ```bash
170
+ npm publish --registry https://npm.pkg.github.com
171
+ ```
172
+
173
+ ---
174
+
175
+ ## 6. Optional: Test Installed Package from npm Registry
176
+
177
+ After publishing, test by installing from registry in `pw_ui_api`:
178
+
179
+ ```bash
180
+ cd /Users/andersoncahet/Documents/studies/pw_ui_api
181
+ npm i -D @acahet/playwright-history-dashboard@latest
182
+ ```
183
+
184
+ Run:
185
+
186
+ ```bash
187
+ npx pw-history-init
188
+ npx playwright test --project ui-tests
189
+ npm run report:history
190
+ ```
191
+
192
+ ---
193
+
194
+ ## 7. Rollback / Recovery
195
+
196
+ If package integration causes issues in `pw_ui_api`, switch back to local reporter:
197
+
198
+ ```ts
199
+ ['./tests/reporters/history-reporter.ts'];
200
+ ```
201
+
202
+ Then reinstall dependencies cleanly:
203
+
204
+ ```bash
205
+ npm install
206
+ ```
207
+
208
+ ---
209
+
210
+ ## 8. Common Issues
211
+
212
+ ### `404` on npm publish
213
+
214
+ - Package name already used or access missing
215
+ - Ensure correct scope and npm account/org permissions
216
+
217
+ ### GitHub Packages `403` / auth errors
218
+
219
+ - Token missing scopes (`write:packages`, `read:packages`)
220
+ - Scope in package name does not match owner
221
+ - `.npmrc` points to wrong scope
222
+
223
+ ### `pw-history-init` not found
224
+
225
+ - Ensure package is installed in consumer project
226
+ - Run through `npx pw-history-init`
227
+
228
+ ### Reporter not loading
229
+
230
+ - Use export path: `@acahet/playwright-history-dashboard/reporter`
231
+ - Confirm `playwright.config.ts` reporter array syntax
232
+
233
+ ---
234
+
235
+ ## 9. One-Command Pre-Release Sanity Check
236
+
237
+ In package folder:
238
+
239
+ ```bash
240
+ npm run build && npm pack
241
+ ```
242
+
243
+ In consumer folder:
244
+
245
+ ```bash
246
+ npm i -D ../package/packages/playwright-history-dashboard/acahet-playwright-history-dashboard-0.1.1.tgz && npx pw-history-init && npx playwright test --project ui-tests
247
+ ```
248
+
249
+ If these pass, you are ready to publish.