playwright-performance-regression 0.1.0-next.4 → 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.
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { readTextFile, colorEnabled, painter, asciiTerminal, box, paint } from './chunk-CXE5IWZY.js';
3
- import { INIT_COMMAND, CONFIG_FILE_EXTENSIONS, CONFIG_FILE_BASENAME, readInitEnv, PACKAGE_NAME, REPOSITORY_URL, peerDependencies, parsePasses, writeModeState, DOCS_CONFIG_URL } from './chunk-RL27E3AB.js';
4
- import { DEFAULT_CONFIG, resolveConfig, MARGIN_PRESETS } from './chunk-CISGJCFW.js';
2
+ import { readTextFile, colorEnabled, painter, asciiTerminal, box, marks, paint, stringifyStable, SCHEMA_VERSIONS } from './chunk-B4XTLSRN.js';
3
+ import { INIT_COMMAND, CONFIG_FILE_EXTENSIONS, CONFIG_FILE_BASENAME, readInitEnv, PACKAGE_NAME, REPOSITORY_URL, peerDependencies, parsePasses, writeModeState, DOCS_CONFIG_URL } from './chunk-YKBX6SAT.js';
4
+ import { DEFAULT_CONFIG, resolveConfig, MARGIN_PRESETS } from './chunk-5Y34Q4DR.js';
5
5
  import { createInterface } from 'readline/promises';
6
6
  import { spawn } from 'child_process';
7
7
  import { readFileSync } from 'fs';
@@ -59,13 +59,11 @@ var en = {
59
59
  measureQuestion: "What to measure? [{all}/api/steps]",
60
60
  onlyStepsNoSteps: "Only steps, but no test.step was found: nothing is measured until you add test.step blocks.",
61
61
  stepCommand: "Test command",
62
- commandLesson1: "Type the command you usually run your tests with, e.g. npm run e2e:qa. The wizard puts PW_PERF_MODE in front of it in the commands below, writes it into the CI jobs and runs it for the check.",
62
+ commandLesson1: "Type the command you usually run your tests with, e.g. npm run e2e:qa. The wizard does not change anything in it: it uses it in the commands at the end and for the check.",
63
63
  commandLesson2: 'Enter keeps the suggested command; "skip" keeps it too and skips the check at the end.',
64
64
  commandQuestion: "Which command do you usually run your tests with?",
65
65
  commandVariable: "Type the command without PW_PERF_ variables: the wizard adds PW_PERF_MODE itself.",
66
66
  commandChain: "This command chains several commands: PW_PERF_MODE=... in front of it only reaches the first one. Put the chain in a package.json script and type npm run <script>.",
67
- stepCi: "CI",
68
- noCi: "No CI configuration found. Recipes for GitHub Actions, GitLab CI, Jenkins and Azure Pipelines: {url}",
69
67
  stepChanges: "Changes",
70
68
  nothingToChange: "Nothing to change: the project is already set up for these answers.",
71
69
  changesLesson: "Each change is shown as a diff before it is applied.",
@@ -82,8 +80,6 @@ var en = {
82
80
  plannedChanges: "Planned changes (not written):",
83
81
  manualSteps: "Manual steps: {count} (see the warnings above).",
84
82
  nextSteps: "Next steps:",
85
- nextJenkins: "Create a Pipeline job in Jenkins with the script path {path}.",
86
- nextAzure: "Create a pipeline in Azure DevOps from {path}.",
87
83
  nextApply: "Apply the changes above (run the setup again in a terminal).",
88
84
  originsNote: "Endpoint keys of the baseURL origin have no label and other hosts are labeled with their host; set shorter labels for them in keys.origins of {configFile}.",
89
85
  docs: "Docs: {links}",
@@ -100,11 +96,6 @@ var en = {
100
96
  manualConfigPattern: "{config} was not changed: its export is not a plain defineConfig({...}) or object (for example another wrapper).",
101
97
  configHintIntro: "Wrap the exported config in withPerf() as the outermost call (also around other wrappers):",
102
98
  configHintCjs: "In {path} with module.exports: {call}.",
103
- manualCiKept: "{file} exists and was not changed.",
104
- manualCiHint: "Compare it with examples/ci/ in the {pkg} repository.",
105
- manualGitlabInclude: ".gitlab-ci.yml was not changed: include the new job file in it.",
106
- manualNpmOne: "{files} installs the dependencies with npm.",
107
- manualNpmHint: 'This project uses {manager}: replace "npm ci" with "{install}" and "npx" with "{npx}".',
108
99
  declinedRun: "Run your test command with PW_PERF_MODE=thresholds and commit the pw-perf-thresholds*.json files, then PW_PERF_MODE=test runs the measurement (e.g. {example}).",
109
100
  about1: "{pkg} measures the response times of backend endpoints (and optionally your test.step blocks) in the e2e tests you already have, without changing them.",
110
101
  stepProject: "What it does and how to run it",
@@ -133,11 +124,6 @@ var en = {
133
124
  presetNormal: "normal: recommended to start with.",
134
125
  presetLoose: "loose: large headroom; only clear regressions, for shared or noisy environments.",
135
126
  presetQuestion: "How much headroom should derived thresholds have? [strict/normal/loose]",
136
- ci1: "Derive thresholds on the CI machines that will measure: times from a laptop do not carry over.",
137
- ci2: "A CI job you start by hand with PW_PERF_MODE=thresholds saves the thresholds files as an artifact.",
138
- ci3: "Download them and commit them to the repository.",
139
- ci4: "A scheduled job (once a week by default) with PW_PERF_MODE=test fails on a regression.",
140
- ciQuestion: "Add the CI jobs for thresholds and measurement runs ({platform})?",
141
127
  stepCheck: "Check",
142
128
  checkLesson: "The check runs your test command like the real runs, only with 2 passes: first PW_PERF_MODE=thresholds, then PW_PERF_MODE=test. Its thresholds go to a temporary folder that is deleted afterwards; your thresholds files are not touched.",
143
129
  checkQuestion: "Run a check now?",
@@ -153,14 +139,15 @@ var en = {
153
139
  boxDocs: "Other layouts (mergeTests, several test objects, playwright-bdd): {url}",
154
140
  runLine: "Run: {command}",
155
141
  runLesson: "A measurement is your usual test command with PW_PERF_MODE set.",
156
- nextCheck: "{command}: see what will be measured and how long a full run takes.",
157
- nextThresholds: "{command}: derive thresholds first, on the CI machines that will measure: run the manual thresholds CI job (or this command there) and download the thresholds files from its artifact. Until they exist, measurement runs use the loose default thresholds. {estimate}",
158
- nextThresholdsNoCi: "{command}: derive thresholds first, on the CI machines that will measure (see {url}). Until the thresholds files exist, measurement runs use the loose default thresholds. {estimate}",
159
- estimateUnknown: "(Run the check command for an estimate.)",
160
- estimateAbove: "(The start box of the run shows a time estimate from the last run.)",
161
- nextCommit: "Commit {files}.",
162
- nextTest: "{command}: a measurement run that fails on a regression. Results: {report}; exit code details: {outcome}.",
163
- nextCiJobs: "The measurement job in {path} runs once a week and can be started by hand.",
142
+ importantTitle: "IMPORTANT",
143
+ importantIntro: "What to do next, in this order:",
144
+ importantFixFirst: "First add the perf fixture (red box above): until then no endpoint is measured.",
145
+ importantThresholds: "Derive the thresholds on CI, on the environment where the tests will run (times from a laptop do not carry over). It can take several hours: your test command runs several times on 1 worker.",
146
+ importantDownload: "Download the thresholds files from the CI artifacts: the thresholds run also copies them to the report folder {dir}. CI recipes: docs/ci.md.",
147
+ importantCommit: "Commit them: {files}.",
148
+ importantTest: "From then on run the tests with this command; it fails on a regression:",
149
+ importantResults: "Results: {report}; exit code details: {outcome}.",
150
+ tryCheck: "Try it locally first: {command} shows what will be measured and how long a full run takes.",
164
151
  windowsNote: "PowerShell and cmd forms of these commands: docs/cli.md.",
165
152
  boxWrapThis: "Wrap the one your tests import: {file}",
166
153
  boxWorkspace: "{file} is in the workspace package {pkg}: install {self} in the workspace root (e.g. pnpm add -Dw) or in that package too.",
@@ -205,19 +192,17 @@ var pl = {
205
192
  stepMeasure: "Co mierzyć",
206
193
  measureApi: 'api: czasy odpowiedzi requestów backendu wysyłanych przez strony i wywołań request w testach API, pogrupowane w klucze endpointów, np. "GET /api/users/:id".',
207
194
  measureSteps: 'steps: czasy Twoich bloków test.step, bez zmian w testach; każdy krok staje się kluczem, np. "checkout › pay", z własnym plikiem progów.',
208
- stepsPrivacy: "Tytuły kroków są sanityzowane: identyfikatory, e-maile, adresy URL i sekrety nie trafiają do kluczy, także w cudzysłowach.",
195
+ stepsPrivacy: "Tytuły kroków są czyszczone: identyfikatory, e-maile, adresy URL i sekrety nie trafiają do kluczy, także w cudzysłowach.",
209
196
  stepFilesFound: "Pliki z test.step: {count}.",
210
197
  noStepsFound: "Nie znaleziono jeszcze test.step: kroki będą mierzone, gdy dodasz bloki test.step.",
211
198
  measureQuestion: "Co mierzyć? [{all}/api/steps]",
212
199
  onlyStepsNoSteps: "Tylko kroki, ale nie znaleziono test.step: nic nie będzie mierzone, dopóki nie dodasz bloków test.step.",
213
200
  stepCommand: "Polecenie testów",
214
- commandLesson1: "Wpisz polecenie, którym zwykle uruchamiasz testy, np. npm run e2e:qa. Kreator dopisze przed nim PW_PERF_MODE w poleceniach poniżej, wpisze je do jobów CI i uruchomi je w sprawdzeniu.",
201
+ commandLesson1: "Wpisz polecenie, którym zwykle uruchamiasz testy, np. npm run e2e:qa. Kreator niczego w nim nie zmienia: użyje go w poleceniach na końcu i do sprawdzenia.",
215
202
  commandLesson2: 'Enter zostawia proponowane polecenie; "skip" też je zostawia i pomija sprawdzenie na końcu.',
216
203
  commandQuestion: "Jakim poleceniem zwykle uruchamiasz testy?",
217
204
  commandVariable: "Wpisz polecenie bez zmiennych PW_PERF_: kreator sam dodaje PW_PERF_MODE.",
218
205
  commandChain: "To polecenie łączy kilka poleceń: PW_PERF_MODE=... przed nim dociera tylko do pierwszego. Zamknij łańcuch w skrypcie package.json i wpisz npm run <skrypt>.",
219
- stepCi: "CI",
220
- noCi: "Nie znaleziono konfiguracji CI. Gotowe konfiguracje dla GitHub Actions, GitLab CI, Jenkinsa i Azure Pipelines: {url}",
221
206
  stepChanges: "Zmiany",
222
207
  nothingToChange: "Nic do zmiany: projekt jest już skonfigurowany dla tych odpowiedzi.",
223
208
  changesLesson: "Każda zmiana jest najpierw pokazana jako diff, a dopiero potem zastosowana.",
@@ -234,8 +219,6 @@ var pl = {
234
219
  plannedChanges: "Planowane zmiany (niezapisane):",
235
220
  manualSteps: "Kroki ręczne: {count} (zobacz ostrzeżenia powyżej).",
236
221
  nextSteps: "Następne kroki:",
237
- nextJenkins: "Utwórz w Jenkinsie job typu Pipeline ze ścieżką skryptu {path}.",
238
- nextAzure: "Utwórz w Azure DevOps pipeline z pliku {path}.",
239
222
  nextApply: "Zastosuj powyższe zmiany (uruchom konfigurację ponownie w terminalu).",
240
223
  originsNote: "Klucze endpointów originu z baseURL nie mają etykiety, a inne hosty są oznaczone nazwą hosta; krótsze etykiety dla nich ustawisz w keys.origins w {configFile}.",
241
224
  docs: "Dokumentacja: {links}",
@@ -252,11 +235,6 @@ var pl = {
252
235
  manualConfigPattern: "Nie zmieniono {config}: eksportuje coś innego niż zwykłe defineConfig({...}) albo obiekt (np. inny wrapper).",
253
236
  configHintIntro: "Owiń eksportowaną konfigurację w withPerf() jako najbardziej zewnętrzne wywołanie (także wokół innych wrapperów):",
254
237
  configHintCjs: "W {path} z module.exports: {call}.",
255
- manualCiKept: "{file} już istnieje i nie został zmieniony.",
256
- manualCiHint: "Porównaj go z examples/ci/ w repozytorium {pkg}.",
257
- manualGitlabInclude: "Nie zmieniono .gitlab-ci.yml: dołącz do niego nowy plik joba.",
258
- manualNpmOne: "{files} instaluje zależności przez npm.",
259
- manualNpmHint: 'Ten projekt używa {manager}: zamień "npm ci" na "{install}", a "npx" na "{npx}".',
260
238
  declinedRun: "Uruchom swoje polecenie testów z PW_PERF_MODE=thresholds i zacommituj pliki pw-perf-thresholds*.json, potem PW_PERF_MODE=test wykonuje pomiar (np. {example}).",
261
239
  about1: "{pkg} mierzy czasy odpowiedzi endpointów backendu (i opcjonalnie bloków test.step) w Twoich istniejących testach e2e, bez zmian w testach.",
262
240
  stepProject: "Co robi paczka i jak ją uruchamiać",
@@ -265,7 +243,7 @@ var pl = {
265
243
  usageCommandPlaceholder: "<twoje polecenie testów>",
266
244
  usageThresholds: "wykonuje testy kilka razy na 1 workerze i zapisuje pliki progów;",
267
245
  usageCommit: "zacommituj pliki progów do repozytorium;",
268
- usageTest: "mierzy ponownie i kończy się błędem przy regresji; lokalnie i w CI.",
246
+ usageTest: "mierzy ponownie i kończy się błędem przy regresji; używaj go lokalnie i w CI.",
269
247
  usageCommand: "Polecenie testów to to, którego już używasz (np. npm run e2e albo npx playwright test). Mierzony jest każdy projekt playwright.config, który ono uruchamia: dodaj --project <nazwa>, aby mierzyć tylko jedną przeglądarkę.",
270
248
  variablesTitle: "Pozostałe zmienne:",
271
249
  varCheck: "szybkie sprawdzenie konfiguracji na kilku testach, bez plików progów",
@@ -285,11 +263,6 @@ var pl = {
285
263
  presetNormal: "normal: zalecany na start.",
286
264
  presetLoose: "loose: duży zapas; tylko wyraźne regresje, dla współdzielonych lub zaszumionych środowisk.",
287
265
  presetQuestion: "Jaki zapas mają mieć wyznaczone progi? [strict/normal/loose]",
288
- ci1: "Progi wyznaczaj na maszynach CI, które będą mierzyć: czasy z laptopa się nie przenoszą.",
289
- ci2: "Job CI uruchamiany ręcznie z PW_PERF_MODE=thresholds zapisuje pliki progów jako artefakt.",
290
- ci3: "Pobierz je i zacommituj do repozytorium.",
291
- ci4: "Job cykliczny (domyślnie raz w tygodniu) z PW_PERF_MODE=test kończy się błędem przy regresji.",
292
- ciQuestion: "Dodać joby CI dla runów progów i pomiarowych ({platform})?",
293
266
  stepCheck: "Sprawdzenie",
294
267
  checkLesson: "Sprawdzenie uruchamia Twoje polecenie testów jak prawdziwe runy, tylko z 2 przebiegami: najpierw PW_PERF_MODE=thresholds, potem PW_PERF_MODE=test. Jego progi trafiają do katalogu tymczasowego, usuwanego na końcu; Twoje pliki progów zostają nietknięte.",
295
268
  checkQuestion: "Uruchomić sprawdzenie teraz?",
@@ -303,17 +276,18 @@ var pl = {
303
276
  boxFixturesFiles: "Pliki z .extend() i liczba plików testów, które importują każdy z nich:",
304
277
  boxImports: "Jeśli testy importują test z @playwright/test (plików: {count}), zmień import w każdym z nich:",
305
278
  boxDocs: "Inne układy (mergeTests, kilka obiektów test, playwright-bdd): {url}",
306
- runLine: "Uruchomienie: {command}",
279
+ runLine: "Uruchom: {command}",
307
280
  runLesson: "Pomiar to Twoje zwykłe polecenie testów z ustawionym PW_PERF_MODE.",
308
- nextCheck: "{command}: zobacz, co zostanie zmierzone i ile potrwa pełny run.",
309
- nextThresholds: "{command}: najpierw wyznacz progi na maszynach CI, które będą mierzyć: uruchom ręczny job progów w CI (albo to polecenie tam) i pobierz pliki progów z jego artefaktu. Dopóki ich nie ma, runy pomiarowe używają luźnych progów domyślnych. {estimate}",
310
- nextThresholdsNoCi: "{command}: najpierw wyznacz progi na maszynach CI, które będą mierzyć (zobacz {url}). Dopóki plików progów nie ma, runy pomiarowe używają luźnych progów domyślnych. {estimate}",
311
- estimateUnknown: "(Szacunek czasu da polecenie sprawdzenia.)",
312
- estimateAbove: "(Ramka startowa runu podaje szacunek czasu z ostatniego runu.)",
313
- nextCommit: "Zacommituj {files}.",
314
- nextTest: "{command}: run pomiarowy, który kończy się błędem przy regresji. Wyniki: {report}; szczegóły kodu wyjścia: {outcome}.",
315
- nextCiJobs: "Job pomiarowy w {path} działa raz w tygodniu i można go uruchomić ręcznie.",
316
- windowsNote: "Postacie tych poleceń dla PowerShell i cmd: docs/cli.md.",
281
+ importantTitle: "WAŻNE",
282
+ importantIntro: "Co dalej, w tej kolejności:",
283
+ importantFixFirst: "Najpierw dodaj fixture perf (czerwona ramka wyżej): do tego czasu żaden endpoint nie jest mierzony.",
284
+ importantThresholds: "Wyznacz progi na CI, na tym środowisku, na którym będą uruchamiane testy (czasy z laptopa się nie przenoszą). Może to potrwać kilka godzin: polecenie testów wykonuje się kilka razy na 1 workerze.",
285
+ importantDownload: "Ściągnij pliki progów z artefaktów CI: run progów kopiuje je też do folderu raportu {dir}. Przykłady dla CI: docs/ci.md.",
286
+ importantCommit: "Zacommituj je: {files}.",
287
+ importantTest: "Od tej pory uruchamiaj testy tym poleceniem; kończy się błędem przy regresji:",
288
+ importantResults: "Wyniki: {report}; szczegóły kodu wyjścia: {outcome}.",
289
+ tryCheck: "Najpierw spróbuj lokalnie: {command} pokazuje, co zostanie zmierzone i ile potrwa pełny run.",
290
+ windowsNote: "Wersje tych poleceń dla PowerShell i cmd: docs/cli.md.",
317
291
  boxWrapThis: "Owiń ten, który importują Twoje testy: {file}",
318
292
  boxWorkspace: "{file} jest w pakiecie workspace {pkg}: zainstaluj {self} w korzeniu workspace (np. pnpm add -Dw) albo także w tym pakiecie.",
319
293
  manualDirectImports: "Pliki testów, które importują test prosto z @playwright/test, nie są mierzone ({count}): {files}.",
@@ -325,7 +299,7 @@ var pl = {
325
299
  noConfigFound: "Znaleziono playwright.config w podkatalogach; uruchom konfigurację w katalogu każdego, który chcesz mierzyć:",
326
300
  checkCause: "Najbardziej prawdopodobna przyczyna: {cause}",
327
301
  formatNote: "Sformatuj zmienione pliki swoim formatterem (np. prettier --write).",
328
- manualNewContext: "Requesty kontekstów tworzonych przez request.newContext() nie są mierzone, dopóki każdy kontekst nie jest śledzony ({count}): {files}.",
302
+ manualNewContext: "Requesty kontekstów tworzonych przez request.newContext() nie są mierzone, dopóki każdy kontekst nie będzie śledzony ({count}): {files}.",
329
303
  manualNewContextHint: "Śledź każdy kontekst zaraz po jego utworzeniu:"
330
304
  };
331
305
  var es = {
@@ -345,7 +319,7 @@ var es = {
345
319
  yesShort: "s",
346
320
  noShort: "n",
347
321
  stepTests: "Qué tests",
348
- testsLesson: "Una medición dura unas (tests × pasadas) ejecuciones de tests en 1 worker, así que mide los tests que llaman a los endpoints importantes del backend.",
322
+ testsLesson: "Una medición tarda lo que unas (tests × pasadas) ejecuciones de tests en 1 worker, así que mide los tests que llaman a los endpoints importantes del backend.",
349
323
  taggedFiles: "Archivos con tests etiquetados @perf: {count}.",
350
324
  noTaggedMessage: "Ningún test tiene aún la etiqueta @perf; se miden todos los tests.",
351
325
  noTaggedHint: "Para medir solo algunos tests, etiquétalos con test('título', { tag: '@perf' }, ...) y elige @perf.",
@@ -353,23 +327,21 @@ var es = {
353
327
  scopeAll: "todos",
354
328
  stepPasses: "Pasadas",
355
329
  passesLesson: "Cada regla necesita un mínimo de muestras por endpoint (minSamples), y las muestras son llamadas por test × tests × pasadas. Tu comando de tests, con sus pasos de preparación, se ejecuta una vez por pasada.",
356
- passesQuestion: "¿Pasadas del comando de tests en las mediciones?",
330
+ passesQuestion: "¿Cuántas pasadas del comando de tests por medición?",
357
331
  stepMeasure: "Qué medir",
358
332
  measureApi: 'api: tiempos de respuesta de las peticiones al backend que envían tus páginas y de las llamadas request en los tests de API, agrupados en claves de endpoint como "GET /api/users/:id".',
359
333
  measureSteps: 'steps: duración de tus bloques test.step, sin cambiar los tests; cada paso se convierte en una clave como "checkout › pay", con su propio archivo de umbrales.',
360
- stepsPrivacy: "Los títulos de los pasos se sanean: ids, correos, URL y secretos nunca llegan a las claves, tampoco entre comillas.",
334
+ stepsPrivacy: "Los títulos de los pasos se limpian: ids, correos, URL y secretos nunca llegan a las claves, tampoco entre comillas.",
361
335
  stepFilesFound: "Archivos con test.step: {count}.",
362
336
  noStepsFound: "Aún no se encontró ningún test.step: los pasos se medirán cuando añadas bloques test.step.",
363
337
  measureQuestion: "¿Qué medir? [{all}/api/steps]",
364
338
  onlyStepsNoSteps: "Solo pasos, pero no se encontró ningún test.step: no se mide nada hasta que añadas bloques test.step.",
365
339
  stepCommand: "Comando de tests",
366
- commandLesson1: "Escribe el comando con el que sueles ejecutar tus tests, p. ej. npm run e2e:qa. El asistente pone PW_PERF_MODE delante en los comandos de abajo, lo escribe en los jobs de CI y lo ejecuta en la comprobación.",
340
+ commandLesson1: "Escribe el comando con el que sueles ejecutar tus tests, p. ej. npm run e2e:qa. El asistente no lo modifica: lo usa en los comandos del final y para la comprobación.",
367
341
  commandLesson2: 'Enter mantiene el comando sugerido; "skip" también lo mantiene y omite la comprobación final.',
368
342
  commandQuestion: "¿Con qué comando sueles ejecutar tus tests?",
369
343
  commandVariable: "Escribe el comando sin variables PW_PERF_: el asistente añade PW_PERF_MODE por sí mismo.",
370
344
  commandChain: "Este comando encadena varios comandos: PW_PERF_MODE=... delante solo llega al primero. Pon la cadena en un script de package.json y escribe npm run <script>.",
371
- stepCi: "CI",
372
- noCi: "No se encontró configuración de CI. Recetas para GitHub Actions, GitLab CI, Jenkins y Azure Pipelines: {url}",
373
345
  stepChanges: "Cambios",
374
346
  nothingToChange: "Nada que cambiar: el proyecto ya está configurado para estas respuestas.",
375
347
  changesLesson: "Cada cambio se muestra como diff antes de aplicarlo.",
@@ -386,8 +358,6 @@ var es = {
386
358
  plannedChanges: "Cambios previstos (no escritos):",
387
359
  manualSteps: "Pasos manuales: {count} (ver las advertencias de arriba).",
388
360
  nextSteps: "Siguientes pasos:",
389
- nextJenkins: "Crea un job Pipeline en Jenkins con la ruta de script {path}.",
390
- nextAzure: "Crea un pipeline en Azure DevOps a partir de {path}.",
391
361
  nextApply: "Aplica los cambios de arriba (ejecuta la configuración de nuevo en un terminal).",
392
362
  originsNote: "Las claves de endpoint del origen de baseURL no llevan etiqueta y los demás hosts se etiquetan con su host; define etiquetas más cortas para ellos en keys.origins de {configFile}.",
393
363
  docs: "Documentación: {links}",
@@ -404,11 +374,6 @@ var es = {
404
374
  manualConfigPattern: "{config} no se modificó: su export no es un defineConfig({...}) simple ni un objeto (por ejemplo, hay otro wrapper).",
405
375
  configHintIntro: "Envuelve la configuración exportada en withPerf() como llamada más externa (también alrededor de otros wrappers):",
406
376
  configHintCjs: "En {path} con module.exports: {call}.",
407
- manualCiKept: "{file} ya existe y no se modificó.",
408
- manualCiHint: "Compáralo con examples/ci/ del repositorio de {pkg}.",
409
- manualGitlabInclude: ".gitlab-ci.yml no se modificó: incluye en él el nuevo archivo del job.",
410
- manualNpmOne: "{files} instala las dependencias con npm.",
411
- manualNpmHint: 'Este proyecto usa {manager}: sustituye "npm ci" por "{install}" y "npx" por "{npx}".',
412
377
  declinedRun: "Ejecuta tu comando de tests con PW_PERF_MODE=thresholds y haz commit de los archivos pw-perf-thresholds*.json; después PW_PERF_MODE=test ejecuta la medición (p. ej. {example}).",
413
378
  about1: "{pkg} mide los tiempos de respuesta de los endpoints del backend (y opcionalmente tus bloques test.step) en los tests e2e que ya tienes, sin cambiarlos.",
414
379
  stepProject: "Qué hace y cómo ejecutarlo",
@@ -417,7 +382,7 @@ var es = {
417
382
  usageCommandPlaceholder: "<tu comando de tests>",
418
383
  usageThresholds: "ejecuta tus tests varias veces en 1 worker y escribe los archivos de umbrales;",
419
384
  usageCommit: "haz commit de los archivos de umbrales en el repositorio;",
420
- usageTest: "vuelve a medir y falla ante una regresión; en local y en CI.",
385
+ usageTest: "vuelve a medir y falla ante una regresión; úsalo en local y en CI.",
421
386
  usageCommand: "Tu comando de tests es el que ya usas (p. ej. npm run e2e o npx playwright test). Se mide cada proyecto de playwright.config que ejecuta: añade --project <nombre> para medir un solo navegador.",
422
387
  variablesTitle: "Otras variables:",
423
388
  varCheck: "una comprobación rápida de la configuración con unos pocos tests, sin archivos de umbrales",
@@ -437,11 +402,6 @@ var es = {
437
402
  presetNormal: "normal: recomendado para empezar.",
438
403
  presetLoose: "loose: margen grande; solo regresiones claras, para entornos compartidos o ruidosos.",
439
404
  presetQuestion: "¿Cuánto margen deben tener los umbrales calculados? [strict/normal/loose]",
440
- ci1: "Calcula los umbrales en las máquinas de CI que van a medir: los tiempos de un portátil no sirven allí.",
441
- ci2: "Un job de CI lanzado a mano con PW_PERF_MODE=thresholds guarda los archivos de umbrales como artefacto.",
442
- ci3: "Descárgalos y haz commit en el repositorio.",
443
- ci4: "Un job programado (una vez por semana por defecto) con PW_PERF_MODE=test falla ante una regresión.",
444
- ciQuestion: "¿Añadir los jobs de CI para umbrales y mediciones ({platform})?",
445
405
  stepCheck: "Comprobación",
446
406
  checkLesson: "La comprobación ejecuta tu comando de tests como las ejecuciones reales, solo con 2 pasadas: primero PW_PERF_MODE=thresholds y luego PW_PERF_MODE=test. Sus umbrales van a una carpeta temporal que se borra al final; tus archivos de umbrales no se tocan.",
447
407
  checkQuestion: "¿Ejecutar la comprobación ahora?",
@@ -457,14 +417,15 @@ var es = {
457
417
  boxDocs: "Otras estructuras (mergeTests, varios objetos test, playwright-bdd): {url}",
458
418
  runLine: "Ejecutar: {command}",
459
419
  runLesson: "Una medición es tu comando de tests habitual con PW_PERF_MODE.",
460
- nextCheck: "{command}: mira qué se medirá y cuánto dura una ejecución completa.",
461
- nextThresholds: "{command}: primero calcula los umbrales en las máquinas de CI que van a medir: lanza el job manual de umbrales (o este comando allí) y descarga los archivos de umbrales de su artefacto. Mientras no existan, las mediciones usan los umbrales amplios por defecto. {estimate}",
462
- nextThresholdsNoCi: "{command}: primero calcula los umbrales en las máquinas de CI que van a medir (ver {url}). Mientras no existan los archivos de umbrales, las mediciones usan los umbrales amplios por defecto. {estimate}",
463
- estimateUnknown: "(El comando de comprobación da una estimación.)",
464
- estimateAbove: "(El recuadro de inicio de la ejecución muestra una estimación de tiempo según la última ejecución.)",
465
- nextCommit: "Haz commit de {files}.",
466
- nextTest: "{command}: una medición que falla ante una regresión. Resultados: {report}; detalles del código de salida: {outcome}.",
467
- nextCiJobs: "El job de medición en {path} se ejecuta una vez por semana y se puede lanzar a mano.",
420
+ importantTitle: "IMPORTANTE",
421
+ importantIntro: "Qué hacer ahora, en este orden:",
422
+ importantFixFirst: "Primero añade el fixture perf (recuadro rojo de arriba): hasta entonces no se mide ningún endpoint.",
423
+ importantThresholds: "Calcula los umbrales en CI, en el entorno donde se ejecutarán los tests (los tiempos medidos en un portátil no sirven). Puede tardar varias horas: tu comando de tests se ejecuta varias veces en 1 worker.",
424
+ importantDownload: "Descarga los archivos de umbrales de los artefactos de CI: la ejecución de umbrales también los copia a la carpeta del informe {dir}. Ejemplos de CI: docs/ci.md.",
425
+ importantCommit: "Haz commit de ellos: {files}.",
426
+ importantTest: "A partir de entonces ejecuta los tests con este comando; falla ante una regresión:",
427
+ importantResults: "Resultados: {report}; detalles del código de salida: {outcome}.",
428
+ tryCheck: "Pruébalo antes en local: {command} muestra qué se medirá y cuánto dura una ejecución completa.",
468
429
  windowsNote: "Formas de estos comandos para PowerShell y cmd: docs/cli.md.",
469
430
  boxWrapThis: "Envuelve el que importan tus tests: {file}",
470
431
  boxWorkspace: "{file} está en el paquete del workspace {pkg}: instala {self} en la raíz del workspace (p. ej. pnpm add -Dw) o también en ese paquete.",
@@ -473,7 +434,7 @@ var es = {
473
434
  manualDirectImportsModuleHint: "Importa en ellos test desde {module} o cambia el import en cada uno:",
474
435
  passesSetup: "globalSetup y los proyectos de setup también se ejecutan una vez por pasada y sus peticiones no se miden: haz que la carga de datos sea idempotente.",
475
436
  commandReporter: "Este comando o su script define --reporter: una ejecución de medición o de umbrales con él se detiene con RUN_REPORTER_FLAG. Usa un comando sin --reporter para la medición.",
476
- commandEveryPass: "El script ejecuta esto antes de playwright test, y se ejecuta en cada pasada: {prep}. Mueve la preparación larga a su propio script e indica aquí un script sin ella.",
437
+ commandEveryPass: "El script ejecuta esto antes de playwright test, así que se repite en cada pasada: {prep}. Mueve la preparación larga a su propio script e indica aquí un script sin ella.",
477
438
  noConfigFound: "Se encontró playwright.config en subcarpetas; ejecuta la configuración en la carpeta de cada uno que quieras medir:",
478
439
  checkCause: "Causa más probable: {cause}",
479
440
  formatNote: "Formatea los archivos cambiados con tu formateador (p. ej. prettier --write).",
@@ -497,15 +458,15 @@ var fr = {
497
458
  yesShort: "o",
498
459
  noShort: "n",
499
460
  stepTests: "Quels tests",
500
- testsLesson: "Une mesure prend environ (tests × passes) exécutions de tests sur 1 worker : mesurez donc les tests qui appellent les endpoints importants du backend.",
461
+ testsLesson: "Une mesure dure environ autant que (tests × passes) exécutions de tests sur 1 worker : mesurez donc les tests qui appellent les endpoints importants du backend.",
501
462
  taggedFiles: "Fichiers avec des tests marqués @perf : {count}.",
502
463
  noTaggedMessage: "Aucun test n’est encore marqué @perf ; tous les tests sont mesurés.",
503
464
  noTaggedHint: "Pour ne mesurer que certains tests, marquez-les avec test('titre', { tag: '@perf' }, ...) et choisissez @perf.",
504
465
  scopeQuestion: "Mesurer tous les tests ou seulement ceux marqués @perf ? [{all}/@perf]",
505
466
  scopeAll: "tous",
506
467
  stepPasses: "Passes",
507
- passesLesson: "Chaque règle demande un nombre minimal d’échantillons par endpoint (minSamples), et le nombre d’échantillons vaut : appels par test × tests × passes. Votre commande de tests, avec ses étapes de préparation, s’exécute une fois par passe.",
508
- passesQuestion: "Passes de la commande de tests dans les mesures ?",
468
+ passesLesson: "Chaque règle demande un nombre minimal d’échantillons par endpoint (minSamples), et chaque endpoint en obtient : appels par test × tests × passes. Votre commande de tests, avec ses étapes de préparation, s’exécute une fois par passe.",
469
+ passesQuestion: "Combien de passes de la commande de tests par mesure ?",
509
470
  stepMeasure: "Que mesurer",
510
471
  measureApi: 'api : temps de réponse des requêtes backend envoyées par vos pages et des appels request dans les tests d’API, regroupés en clés d’endpoint comme "GET /api/users/:id".',
511
472
  measureSteps: 'steps : durée de vos blocs test.step, sans modifier les tests ; chaque étape devient une clé comme "checkout › pay", avec son propre fichier de seuils.',
@@ -515,13 +476,11 @@ var fr = {
515
476
  measureQuestion: "Que mesurer ? [{all}/api/steps]",
516
477
  onlyStepsNoSteps: "Étapes seulement, mais aucun test.step trouvé : rien n’est mesuré tant que vous n’ajoutez pas de blocs test.step.",
517
478
  stepCommand: "Commande de tests",
518
- commandLesson1: "Saisissez la commande avec laquelle vous lancez d’habitude vos tests, p. ex. npm run e2e:qa. L’assistant ajoute PW_PERF_MODE devant dans les commandes ci-dessous, l’écrit dans les jobs de CI et l’exécute pour la vérification.",
479
+ commandLesson1: "Saisissez la commande avec laquelle vous lancez d’habitude vos tests, p. ex. npm run e2e:qa. L’assistant n’y change rien : il l’utilise dans les commandes à la fin et pour la vérification.",
519
480
  commandLesson2: 'Entrée garde la commande proposée ; "skip" la garde aussi et saute la vérification finale.',
520
481
  commandQuestion: "Avec quelle commande lancez-vous d’habitude vos tests ?",
521
482
  commandVariable: "Saisissez la commande sans variables PW_PERF_ : l’assistant ajoute PW_PERF_MODE lui-même.",
522
483
  commandChain: "Cette commande enchaîne plusieurs commandes : PW_PERF_MODE=... devant n’atteint que la première. Mettez la chaîne dans un script de package.json et saisissez npm run <script>.",
523
- stepCi: "CI",
524
- noCi: "Aucune configuration CI trouvée. Recettes pour GitHub Actions, GitLab CI, Jenkins et Azure Pipelines : {url}",
525
484
  stepChanges: "Modifications",
526
485
  nothingToChange: "Rien à modifier : le projet est déjà configuré pour ces réponses.",
527
486
  changesLesson: "Chaque modification est affichée sous forme de diff avant d’être appliquée.",
@@ -532,14 +491,12 @@ var fr = {
532
491
  applyQuestion: "Appliquer cette modification ?",
533
492
  fileWritten: "Écrit : {path}",
534
493
  skipped: "Ignoré.",
535
- stepSummary: "Résumé",
494
+ stepSummary: "Récapitulatif",
536
495
  changedFiles: "Fichiers modifiés :",
537
496
  noFilesChanged: "Aucun fichier n’a été modifié.",
538
497
  plannedChanges: "Modifications prévues (non écrites) :",
539
498
  manualSteps: "Étapes manuelles : {count} (voir les avertissements ci-dessus).",
540
499
  nextSteps: "Étapes suivantes :",
541
- nextJenkins: "Créez dans Jenkins un job Pipeline avec le chemin de script {path}.",
542
- nextAzure: "Créez un pipeline dans Azure DevOps à partir de {path}.",
543
500
  nextApply: "Appliquez les modifications ci-dessus (relancez la configuration dans un terminal).",
544
501
  originsNote: "Les clés d’endpoint de l’origine du baseURL n’ont pas de libellé et les autres hôtes sont libellés avec leur hôte ; définissez des libellés plus courts dans keys.origins de {configFile}.",
545
502
  docs: "Documentation : {links}",
@@ -556,11 +513,6 @@ var fr = {
556
513
  manualConfigPattern: "{config} n’a pas été modifié : son export n’est pas un simple defineConfig({...}) ni un objet (par exemple un autre wrapper).",
557
514
  configHintIntro: "Enveloppez la configuration exportée dans withPerf() comme appel le plus externe (aussi autour des autres wrappers) :",
558
515
  configHintCjs: "Dans {path} avec module.exports : {call}.",
559
- manualCiKept: "{file} existe déjà et n’a pas été modifié.",
560
- manualCiHint: "Comparez-le avec examples/ci/ dans le dépôt de {pkg}.",
561
- manualGitlabInclude: ".gitlab-ci.yml n’a pas été modifié : incluez-y le nouveau fichier de job.",
562
- manualNpmOne: "{files} installe les dépendances avec npm.",
563
- manualNpmHint: 'Ce projet utilise {manager} : remplacez "npm ci" par "{install}" et "npx" par "{npx}".',
564
516
  declinedRun: "Lancez votre commande de tests avec PW_PERF_MODE=thresholds et commitez les fichiers pw-perf-thresholds*.json, puis PW_PERF_MODE=test lance la mesure (par ex. {example}).",
565
517
  about1: "{pkg} mesure les temps de réponse des endpoints du backend (et, en option, vos blocs test.step) dans les tests e2e que vous avez déjà, sans les modifier.",
566
518
  stepProject: "Ce qu’il fait et comment le lancer",
@@ -569,7 +521,7 @@ var fr = {
569
521
  usageCommandPlaceholder: "<votre commande de tests>",
570
522
  usageThresholds: "lance vos tests plusieurs fois sur 1 worker et écrit les fichiers de seuils ;",
571
523
  usageCommit: "commitez les fichiers de seuils dans le dépôt ;",
572
- usageTest: "mesure à nouveau et échoue en cas de régression ; en local et en CI.",
524
+ usageTest: "mesure à nouveau et échoue en cas de régression ; à utiliser en local et en CI.",
573
525
  usageCommand: "Votre commande de tests est celle que vous utilisez déjà (par ex. npm run e2e ou npx playwright test). Chaque projet de playwright.config qu’elle lance est mesuré : ajoutez --project <nom> pour ne mesurer qu’un navigateur.",
574
526
  variablesTitle: "Autres variables :",
575
527
  varCheck: "une vérification rapide de la configuration sur quelques tests, sans fichiers de seuils",
@@ -589,11 +541,6 @@ var fr = {
589
541
  presetNormal: "normal : recommandé pour commencer.",
590
542
  presetLoose: "loose : grande marge ; seulement les régressions nettes, pour des environnements partagés ou bruyants.",
591
543
  presetQuestion: "Quelle marge pour les seuils calculés ? [strict/normal/loose]",
592
- ci1: "Calculez les seuils sur les machines de CI qui mesureront : les temps d’un portable ne s’y appliquent pas.",
593
- ci2: "Un job de CI lancé à la main avec PW_PERF_MODE=thresholds enregistre les fichiers de seuils comme artefact.",
594
- ci3: "Téléchargez-les et commitez-les dans le dépôt.",
595
- ci4: "Un job planifié (une fois par semaine par défaut) avec PW_PERF_MODE=test échoue en cas de régression.",
596
- ciQuestion: "Ajouter les jobs de CI pour les seuils et les mesures ({platform}) ?",
597
544
  stepCheck: "Vérification",
598
545
  checkLesson: "La vérification lance votre commande de tests comme les vraies exécutions, mais avec 2 passes : d’abord PW_PERF_MODE=thresholds, puis PW_PERF_MODE=test. Ses seuils vont dans un dossier temporaire supprimé à la fin ; vos fichiers de seuils ne sont pas touchés.",
599
546
  checkQuestion: "Lancer la vérification maintenant ?",
@@ -609,14 +556,15 @@ var fr = {
609
556
  boxDocs: "Autres structures (mergeTests, plusieurs objets test, playwright-bdd) : {url}",
610
557
  runLine: "Lancer : {command}",
611
558
  runLesson: "Une mesure est votre commande de tests habituelle avec PW_PERF_MODE.",
612
- nextCheck: "{command} : voyez ce qui sera mesuré et combien de temps dure une exécution complète.",
613
- nextThresholds: "{command} : calculez d’abord les seuils sur les machines de CI qui mesureront : lancez le job manuel de seuils (ou cette commande là-bas) et téléchargez les fichiers de seuils depuis son artefact. Tant qu’ils n’existent pas, les mesures utilisent les seuils larges par défaut. {estimate}",
614
- nextThresholdsNoCi: "{command} : calculez d’abord les seuils sur les machines de CI qui mesureront (voir {url}). Tant que les fichiers de seuils n’existent pas, les mesures utilisent les seuils larges par défaut. {estimate}",
615
- estimateUnknown: "(La commande de vérification donne une estimation.)",
616
- estimateAbove: "(Le cadre de démarrage de l’exécution donne une estimation du temps d’après la dernière exécution.)",
617
- nextCommit: "Commitez {files}.",
618
- nextTest: "{command} : une mesure qui échoue en cas de régression. Résultats : {report} ; détail du code de sortie : {outcome}.",
619
- nextCiJobs: "Le job de mesure dans {path} s’exécute une fois par semaine et peut être lancé à la main.",
559
+ importantTitle: "IMPORTANT",
560
+ importantIntro: "Que faire ensuite, dans cet ordre :",
561
+ importantFixFirst: "Ajoutez d’abord la fixture perf (cadre rouge ci-dessus) : jusque-là, aucun endpoint n’est mesuré.",
562
+ importantThresholds: "Calculez les seuils en CI, sur l’environnement où les tests seront lancés (les temps mesurés sur un portable ne sont pas transposables). Cela peut prendre plusieurs heures : votre commande de tests s’exécute plusieurs fois sur 1 worker.",
563
+ importantDownload: "Téléchargez les fichiers de seuils depuis les artefacts de CI : l’exécution des seuils les copie aussi dans le dossier du rapport {dir}. Exemples de CI : docs/ci.md.",
564
+ importantCommit: "Commitez-les : {files}.",
565
+ importantTest: "Ensuite, lancez les tests avec cette commande ; elle échoue en cas de régression :",
566
+ importantResults: "Résultats : {report} ; détail du code de sortie : {outcome}.",
567
+ tryCheck: "Essayez d’abord en local : {command} montre ce qui sera mesuré et combien de temps dure une exécution complète.",
620
568
  windowsNote: "Formes de ces commandes pour PowerShell et cmd : docs/cli.md.",
621
569
  boxWrapThis: "Enveloppez celui qu’importent vos tests : {file}",
622
570
  boxWorkspace: "{file} se trouve dans le paquet du workspace {pkg} : installez {self} à la racine du workspace (par ex. pnpm add -Dw) ou aussi dans ce paquet.",
@@ -625,7 +573,7 @@ var fr = {
625
573
  manualDirectImportsModuleHint: "Importez-y test depuis {module}, ou modifiez l’import dans chacun d’eux :",
626
574
  passesSetup: "globalSetup et les projets de setup s’exécutent aussi une fois par passe et leurs requêtes ne sont pas mesurées : rendez l’initialisation des données idempotente.",
627
575
  commandReporter: "Cette commande ou son script définit --reporter : une exécution de mesure ou de seuils s’arrête alors avec RUN_REPORTER_FLAG. Utilisez une commande sans --reporter pour la mesure.",
628
- commandEveryPass: "Le script exécute ceci avant playwright test, et cela s’exécute à chaque passe : {prep}. Déplacez une longue préparation dans son propre script et indiquez ici un script sans elle.",
576
+ commandEveryPass: "Le script exécute ceci avant playwright test, donc à chaque passe : {prep}. Déplacez une longue préparation dans son propre script et indiquez ici un script sans elle.",
629
577
  noConfigFound: "playwright.config trouvé dans des sous-dossiers ; lancez la configuration dans le dossier de chacun de ceux que vous voulez mesurer :",
630
578
  checkCause: "Cause la plus probable : {cause}",
631
579
  formatNote: "Formatez les fichiers modifiés avec votre formateur (par ex. prettier --write).",
@@ -649,15 +597,15 @@ var it = {
649
597
  yesShort: "s",
650
598
  noShort: "n",
651
599
  stepTests: "Quali test",
652
- testsLesson: "Una misurazione richiede circa (test × passaggi) esecuzioni di test su 1 worker, quindi misura i test che chiamano gli endpoint importanti del backend.",
600
+ testsLesson: "Una misurazione richiede circa (test × passate) esecuzioni di test su 1 worker, quindi misura i test che chiamano gli endpoint importanti del backend.",
653
601
  taggedFiles: "File con test contrassegnati @perf: {count}.",
654
602
  noTaggedMessage: "Nessun test ha ancora il tag @perf; vengono misurati tutti i test.",
655
603
  noTaggedHint: "Per misurare solo alcuni test, contrassegnali con test('titolo', { tag: '@perf' }, ...) e scegli @perf.",
656
604
  scopeQuestion: "Misurare tutti i test o solo quelli contrassegnati @perf? [{all}/@perf]",
657
605
  scopeAll: "tutti",
658
- stepPasses: "Passaggi",
659
- passesLesson: "Ogni regola richiede un numero minimo di campioni per endpoint (minSamples), e i campioni sono chiamate per test × test × passaggi. Il comando di test, con i suoi passi di preparazione, viene eseguito una volta per passaggio.",
660
- passesQuestion: "Passaggi del comando di test nelle misurazioni?",
606
+ stepPasses: "Passate",
607
+ passesLesson: "Ogni regola richiede un numero minimo di campioni per endpoint (minSamples), e i campioni sono chiamate per test × test × passate. Il comando di test, con i suoi passi di preparazione, viene eseguito una volta per passata.",
608
+ passesQuestion: "Quante passate del comando di test per misurazione?",
661
609
  stepMeasure: "Cosa misurare",
662
610
  measureApi: 'api: tempi di risposta delle richieste al backend inviate dalle pagine e delle chiamate request nei test API, raggruppati in chiavi di endpoint come "GET /api/users/:id".',
663
611
  measureSteps: 'steps: durata dei blocchi test.step, senza modificare i test; ogni step diventa una chiave come "checkout › pay", con il proprio file di soglie.',
@@ -667,13 +615,11 @@ var it = {
667
615
  measureQuestion: "Cosa misurare? [{all}/api/steps]",
668
616
  onlyStepsNoSteps: "Solo step, ma nessun test.step trovato: non viene misurato nulla finché non aggiungi blocchi test.step.",
669
617
  stepCommand: "Comando di test",
670
- commandLesson1: "Scrivi il comando con cui esegui di solito i test, ad es. npm run e2e:qa. La procedura mette PW_PERF_MODE davanti nei comandi qui sotto, lo scrive nei job di CI e lo esegue per la verifica.",
618
+ commandLesson1: "Scrivi il comando con cui esegui di solito i test, ad es. npm run e2e:qa. La procedura guidata non lo modifica: lo usa nei comandi alla fine e per la verifica.",
671
619
  commandLesson2: 'Invio mantiene il comando proposto; "skip" lo mantiene e salta la verifica finale.',
672
620
  commandQuestion: "Con quale comando esegui di solito i test?",
673
- commandVariable: "Scrivi il comando senza variabili PW_PERF_: la procedura aggiunge PW_PERF_MODE da sola.",
621
+ commandVariable: "Scrivi il comando senza variabili PW_PERF_: la procedura guidata aggiunge PW_PERF_MODE da sola.",
674
622
  commandChain: "Questo comando concatena più comandi: PW_PERF_MODE=... davanti raggiunge solo il primo. Metti la catena in uno script di package.json e scrivi npm run <script>.",
675
- stepCi: "CI",
676
- noCi: "Nessuna configurazione CI trovata. Ricette per GitHub Actions, GitLab CI, Jenkins e Azure Pipelines: {url}",
677
623
  stepChanges: "Modifiche",
678
624
  nothingToChange: "Niente da modificare: il progetto è già configurato per queste risposte.",
679
625
  changesLesson: "Ogni modifica viene mostrata come diff prima di essere applicata.",
@@ -690,8 +636,6 @@ var it = {
690
636
  plannedChanges: "Modifiche previste (non scritte):",
691
637
  manualSteps: "Passi manuali: {count} (vedi gli avvisi sopra).",
692
638
  nextSteps: "Prossimi passi:",
693
- nextJenkins: "Crea in Jenkins un job Pipeline con il percorso dello script {path}.",
694
- nextAzure: "Crea una pipeline in Azure DevOps da {path}.",
695
639
  nextApply: "Applica le modifiche sopra (esegui di nuovo la configurazione in un terminale).",
696
640
  originsNote: "Le chiavi di endpoint dell’origine di baseURL non hanno etichetta e gli altri host sono etichettati con il loro host; imposta etichette più brevi in keys.origins di {configFile}.",
697
641
  docs: "Documentazione: {links}",
@@ -708,11 +652,6 @@ var it = {
708
652
  manualConfigPattern: "{config} non è stato modificato: il suo export non è un semplice defineConfig({...}) né un oggetto (per esempio un altro wrapper).",
709
653
  configHintIntro: "Avvolgi la configurazione esportata in withPerf() come chiamata più esterna (anche attorno ad altri wrapper):",
710
654
  configHintCjs: "In {path} con module.exports: {call}.",
711
- manualCiKept: "{file} esiste già e non è stato modificato.",
712
- manualCiHint: "Confrontalo con examples/ci/ nel repository di {pkg}.",
713
- manualGitlabInclude: ".gitlab-ci.yml non è stato modificato: includi il nuovo file del job.",
714
- manualNpmOne: "{files} installa le dipendenze con npm.",
715
- manualNpmHint: 'Questo progetto usa {manager}: sostituisci "npm ci" con "{install}" e "npx" con "{npx}".',
716
655
  declinedRun: "Esegui il tuo comando di test con PW_PERF_MODE=thresholds e fai commit dei file pw-perf-thresholds*.json, poi PW_PERF_MODE=test esegue la misurazione (es. {example}).",
717
656
  about1: "{pkg} misura i tempi di risposta degli endpoint del backend (e, se vuoi, i tuoi blocchi test.step) nei test e2e che hai già, senza modificarli.",
718
657
  stepProject: "Cosa fa e come eseguirlo",
@@ -721,19 +660,19 @@ var it = {
721
660
  usageCommandPlaceholder: "<il tuo comando di test>",
722
661
  usageThresholds: "esegue i test più volte su 1 worker e scrive i file delle soglie;",
723
662
  usageCommit: "fai commit dei file delle soglie nel repository;",
724
- usageTest: "misura di nuovo e fallisce in caso di regressione; in locale e in CI.",
663
+ usageTest: "misura di nuovo e fallisce in caso di regressione; usalo in locale e in CI.",
725
664
  usageCommand: "Il comando di test è quello che usi già (es. npm run e2e o npx playwright test). Viene misurato ogni progetto di playwright.config che esegue: aggiungi --project <nome> per misurare un solo browser.",
726
665
  variablesTitle: "Altre variabili:",
727
666
  varCheck: "una verifica rapida della configurazione su pochi test, senza file delle soglie",
728
667
  varMaxTests: "test eseguiti da una verifica (predefinito 10)",
729
668
  varEnv: "etichetta di ambiente: file delle soglie separati per ogni ambiente",
730
- varPasses: "passaggi del comando di test in questa esecuzione",
669
+ varPasses: "passate del comando di test in questa esecuzione",
731
670
  varPrune: "in un’esecuzione delle soglie: rimuove le voci degli endpoint che questa esecuzione non ha visto",
732
671
  filesTitle: "File:",
733
672
  fileConfig: "impostazioni del pacchetto; da committare",
734
673
  fileThresholds: "soglie (step dei test in .steps.json); da committare",
735
674
  fileReport: "report HTML e dati dell’ultima esecuzione; da non committare (in .gitignore)",
736
- oldScripts: "Gli script perf:* di una procedura precedente ({names}) non funzionano più; rimuovili.",
675
+ oldScripts: "Gli script perf:* di una procedura guidata precedente ({names}) non funzionano più; rimuovili.",
737
676
  taggedSaved: "@perf viene salvato come run.grep in {configFile}; i tuoi comandi restano uguali.",
738
677
  stepPreset: "Margine delle soglie",
739
678
  presetLesson: "Le soglie sono i tempi di un’esecuzione delle soglie più un margine. Il preset imposta il margine di tutte le regole:",
@@ -741,43 +680,39 @@ var it = {
741
680
  presetNormal: "normal: consigliato per iniziare.",
742
681
  presetLoose: "loose: margine ampio; solo regressioni evidenti, per ambienti condivisi o rumorosi.",
743
682
  presetQuestion: "Quanto margine devono avere le soglie calcolate? [strict/normal/loose]",
744
- ci1: "Calcola le soglie sulle macchine di CI che misureranno: i tempi di un portatile non valgono lì.",
745
- ci2: "Un job di CI avviato a mano con PW_PERF_MODE=thresholds salva i file delle soglie come artefatto.",
746
- ci3: "Scaricali e fanne commit nel repository.",
747
- ci4: "Un job pianificato (una volta a settimana per impostazione predefinita) con PW_PERF_MODE=test fallisce in caso di regressione.",
748
- ciQuestion: "Aggiungere i job di CI per soglie e misure ({platform})?",
749
683
  stepCheck: "Verifica",
750
- checkLesson: "La verifica esegue il tuo comando di test come le esecuzioni reali, ma con 2 passaggi: prima PW_PERF_MODE=thresholds, poi PW_PERF_MODE=test. Le sue soglie vanno in una cartella temporanea eliminata alla fine; i tuoi file di soglie non vengono toccati.",
684
+ checkLesson: "La verifica esegue il tuo comando di test come le esecuzioni reali, ma con 2 passate: prima PW_PERF_MODE=thresholds, poi PW_PERF_MODE=test. Le sue soglie vanno in una cartella temporanea eliminata alla fine; i tuoi file delle soglie non vengono toccati.",
751
685
  checkQuestion: "Eseguire la verifica adesso?",
752
686
  checkManual: "Eseguila tu: {command}",
753
687
  checkExit: "La verifica con PW_PERF_MODE={mode} è terminata con il codice {code}.",
754
688
  boxTitle: "Azione richiesta: per ora non si misura nulla",
755
- boxWhy: "Senza la fixture perf il pacchetto non misura alcuna richiesta. La procedura non modifica i tuoi file di test; aggiungi a mano una di queste varianti:",
689
+ boxWhy: "Senza la fixture perf il pacchetto non misura alcuna richiesta. La procedura guidata non modifica i tuoi file di test; aggiungi a mano una di queste varianti:",
756
690
  boxTitleSteps: "Azione richiesta: endpoint non ancora misurati",
757
- boxWhySteps: "Senza la fixture perf il pacchetto non misura alcuna richiesta (le durate dei test.step sono misurate). La procedura non modifica i tuoi file di test; aggiungi a mano una di queste varianti:",
691
+ boxWhySteps: "Senza la fixture perf il pacchetto non misura alcuna richiesta (le durate dei test.step sono misurate). La procedura guidata non modifica i tuoi file di test; aggiungi a mano una di queste varianti:",
758
692
  boxFixtures: "Se hai un file di fixture che esporta test:",
759
693
  boxFixturesFiles: "File con .extend() e il numero di file di test che importano ciascuno:",
760
694
  boxImports: "Se i tuoi test importano test da @playwright/test (file: {count}), cambia l’import in ognuno:",
761
695
  boxDocs: "Altre strutture (mergeTests, più oggetti test, playwright-bdd): {url}",
762
696
  runLine: "Esegui: {command}",
763
- runLesson: "Una misura è il tuo solito comando di test con PW_PERF_MODE.",
764
- nextCheck: "{command}: guarda cosa verrà misurato e quanto dura un’esecuzione completa.",
765
- nextThresholds: "{command}: prima calcola le soglie sulle macchine di CI che misureranno: avvia il job manuale delle soglie (o questo comando lì) e scarica i file delle soglie dal suo artefatto. Finché non esistono, le misure usano le soglie larghe predefinite. {estimate}",
766
- nextThresholdsNoCi: "{command}: prima calcola le soglie sulle macchine di CI che misureranno (vedi {url}). Finché i file delle soglie non esistono, le misure usano le soglie larghe predefinite. {estimate}",
767
- estimateUnknown: "(Il comando di verifica fornisce una stima.)",
768
- estimateAbove: "(Il riquadro iniziale dell’esecuzione mostra una stima del tempo basata sull’ultima esecuzione.)",
769
- nextCommit: "Fai commit di {files}.",
770
- nextTest: "{command}: una misura che fallisce in caso di regressione. Risultati: {report}; dettagli del codice di uscita: {outcome}.",
771
- nextCiJobs: "Il job di misura in {path} viene eseguito una volta a settimana e può essere avviato a mano.",
697
+ runLesson: "Una misurazione è il tuo solito comando di test con PW_PERF_MODE.",
698
+ importantTitle: "IMPORTANTE",
699
+ importantIntro: "Cosa fare ora, in questo ordine:",
700
+ importantFixFirst: "Prima aggiungi la fixture perf (riquadro rosso sopra): fino ad allora nessun endpoint viene misurato.",
701
+ importantThresholds: "Calcola le soglie in CI, nell’ambiente in cui verranno eseguiti i test (i tempi misurati su un portatile non sono confrontabili). Può richiedere diverse ore: il tuo comando di test viene eseguito più volte su 1 worker.",
702
+ importantDownload: "Scarica i file delle soglie dagli artefatti di CI: l’esecuzione delle soglie li copia anche nella cartella del report {dir}. Esempi di CI: docs/ci.md.",
703
+ importantCommit: "Committali: {files}.",
704
+ importantTest: "Da quel momento esegui i test con questo comando; fallisce in caso di regressione:",
705
+ importantResults: "Risultati: {report}; dettagli del codice di uscita: {outcome}.",
706
+ tryCheck: "Prova prima in locale: {command} mostra cosa verrà misurato e quanto dura un’esecuzione completa.",
772
707
  windowsNote: "Forme di questi comandi per PowerShell e cmd: docs/cli.md.",
773
708
  boxWrapThis: "Avvolgi quello che importano i tuoi test: {file}",
774
709
  boxWorkspace: "{file} è nel pacchetto del workspace {pkg}: installa {self} nella radice del workspace (ad es. pnpm add -Dw) o anche in quel pacchetto.",
775
710
  manualDirectImports: "I file di test che importano test direttamente da @playwright/test non vengono misurati ({count}): {files}.",
776
711
  manualDirectImportsHint: "Cambia l’import in ciascuno di essi:",
777
712
  manualDirectImportsModuleHint: "Importa in essi test da {module}, oppure cambia l’import in ciascuno:",
778
- passesSetup: "globalSetup e i progetti di setup vengono eseguiti anch’essi una volta per passaggio e le loro richieste non sono misurate: rendi idempotente il seeding dei dati.",
779
- commandReporter: "Questo comando o il suo script imposta --reporter: un’esecuzione di misura o di soglie si ferma con RUN_REPORTER_FLAG. Usa un comando senza --reporter per la misura.",
780
- commandEveryPass: "Lo script esegue questo prima di playwright test, e viene eseguito a ogni passaggio: {prep}. Sposta una preparazione lunga in uno script a parte e indica qui uno script senza di essa.",
713
+ passesSetup: "globalSetup e i progetti di setup vengono eseguiti anch’essi una volta per passata e le loro richieste non sono misurate: rendi idempotente il seeding dei dati.",
714
+ commandReporter: "Questo comando o il suo script imposta --reporter: un’esecuzione di misurazione o delle soglie si ferma con RUN_REPORTER_FLAG. Usa un comando senza --reporter per la misurazione.",
715
+ commandEveryPass: "Lo script esegue questo prima di playwright test, quindi a ogni passata: {prep}. Sposta una preparazione lunga in uno script a parte e indica qui uno script senza di essa.",
781
716
  noConfigFound: "Trovato playwright.config in sottocartelle; esegui la configurazione nella cartella di ciascuno che vuoi misurare:",
782
717
  checkCause: "Causa più probabile: {cause}",
783
718
  formatNote: "Formatta i file modificati con il tuo formatter (ad es. prettier --write).",
@@ -808,24 +743,22 @@ var uk = {
808
743
  scopeQuestion: "Вимірювати всі тести чи лише з тегом @perf? [{all}/@perf]",
809
744
  scopeAll: "усі",
810
745
  stepPasses: "Проходи",
811
- passesLesson: "Кожне правило потребує мінімальної кількості вимірів на ендпоінт (minSamples), а вимірів буде: виклики в тесті × тести × проходи. Команда тестів разом із кроками підготовки виконується один раз на прохід.",
746
+ passesLesson: "Кожне правило потребує мінімальної кількості замірів на ендпоінт (minSamples), а замірів буде: виклики в тесті × тести × проходи. Команда тестів разом із кроками підготовки виконується один раз на прохід.",
812
747
  passesQuestion: "Скільки проходів команди тестів під час вимірювання?",
813
748
  stepMeasure: "Що вимірювати",
814
749
  measureApi: 'api: час відповіді запитів до бекенду, які надсилають сторінки, і викликів request в API-тестах, згрупований у ключі ендпоінтів, наприклад "GET /api/users/:id".',
815
750
  measureSteps: 'steps: тривалість ваших блоків test.step без змін у тестах; кожен крок стає ключем, наприклад "checkout › pay", з власним файлом порогів.',
816
- stepsPrivacy: "Заголовки кроків очищуються: ідентифікатори, e-mail, URL і секрети ніколи не потрапляють у ключі, навіть у лапках.",
751
+ stepsPrivacy: "Назви кроків очищуються: ідентифікатори, e-mail, URL і секрети ніколи не потрапляють у ключі, навіть у лапках.",
817
752
  stepFilesFound: "Файли з test.step: {count}.",
818
753
  noStepsFound: "test.step поки не знайдено: кроки вимірюватимуться, щойно ви додасте блоки test.step.",
819
754
  measureQuestion: "Що вимірювати? [{all}/api/steps]",
820
755
  onlyStepsNoSteps: "Лише кроки, але test.step не знайдено: нічого не вимірюється, доки ви не додасте блоки test.step.",
821
756
  stepCommand: "Команда тестів",
822
- commandLesson1: "Введіть команду, якою ви зазвичай запускаєте тести, напр. npm run e2e:qa. Майстер додасть перед нею PW_PERF_MODE у командах нижче, запише її в job-и CI і запустить для перевірки.",
757
+ commandLesson1: "Введіть команду, якою ви зазвичай запускаєте тести, напр. npm run e2e:qa. Майстер нічого в ній не змінює: використає її в командах наприкінці та для перевірки.",
823
758
  commandLesson2: 'Enter залишає запропоновану команду; "skip" теж її залишає і пропускає перевірку наприкінці.',
824
759
  commandQuestion: "Якою командою ви зазвичай запускаєте тести?",
825
760
  commandVariable: "Введіть команду без змінних PW_PERF_: майстер сам додає PW_PERF_MODE.",
826
761
  commandChain: "Ця команда поєднує кілька команд: PW_PERF_MODE=... перед нею доходить лише до першої. Помістіть ланцюжок у скрипт package.json і введіть npm run <скрипт>.",
827
- stepCi: "CI",
828
- noCi: "Конфігурацію CI не знайдено. Рецепти для GitHub Actions, GitLab CI, Jenkins та Azure Pipelines: {url}",
829
762
  stepChanges: "Зміни",
830
763
  nothingToChange: "Нічого змінювати: проєкт уже налаштовано для цих відповідей.",
831
764
  changesLesson: "Кожну зміну показано як diff, перш ніж її застосувати.",
@@ -842,8 +775,6 @@ var uk = {
842
775
  plannedChanges: "Заплановані зміни (не записані):",
843
776
  manualSteps: "Ручні кроки: {count} (див. попередження вище).",
844
777
  nextSteps: "Наступні кроки:",
845
- nextJenkins: "Створіть у Jenkins job типу Pipeline зі шляхом до скрипта {path}.",
846
- nextAzure: "Створіть pipeline в Azure DevOps з {path}.",
847
778
  nextApply: "Застосуйте зміни вище (запустіть налаштування ще раз у терміналі).",
848
779
  originsNote: "Ключі ендпоінтів origin з baseURL не мають мітки, а інші хости позначаються своїм хостом; коротші мітки для них задайте в keys.origins у {configFile}.",
849
780
  docs: "Документація: {links}",
@@ -860,11 +791,6 @@ var uk = {
860
791
  manualConfigPattern: "{config} не змінено: його export — не простий defineConfig({...}) і не об’єкт (наприклад, інша обгортка).",
861
792
  configHintIntro: "Обгорніть експортовану конфігурацію у withPerf() як найзовнішній виклик (також навколо інших обгорток):",
862
793
  configHintCjs: "У {path} з module.exports: {call}.",
863
- manualCiKept: "{file} уже існує і не змінювався.",
864
- manualCiHint: "Порівняйте його з examples/ci/ у репозиторії {pkg}.",
865
- manualGitlabInclude: ".gitlab-ci.yml не змінено: підключіть у ньому новий файл job.",
866
- manualNpmOne: "{files} встановлює залежності через npm.",
867
- manualNpmHint: 'Цей проєкт використовує {manager}: замініть "npm ci" на "{install}", а "npx" на "{npx}".',
868
794
  declinedRun: "Запустіть свою команду тестів з PW_PERF_MODE=thresholds і закомітьте файли pw-perf-thresholds*.json, потім PW_PERF_MODE=test виконує вимірювання (напр. {example}).",
869
795
  about1: "{pkg} вимірює час відповіді ендпоінтів бекенду (і за бажанням ваших блоків test.step) у наявних e2e-тестах, без змін у тестах.",
870
796
  stepProject: "Що робить пакет і як його запускати",
@@ -873,7 +799,7 @@ var uk = {
873
799
  usageCommandPlaceholder: "<ваша команда тестів>",
874
800
  usageThresholds: "виконує тести кілька разів на 1 воркері й записує файли порогів;",
875
801
  usageCommit: "закомітьте файли порогів у репозиторій;",
876
- usageTest: "вимірює знову й падає при регресії; локально і в CI.",
802
+ usageTest: "вимірює знову й завершується помилкою при регресії; локально і в CI.",
877
803
  usageCommand: "Команда тестів — та, якою ви вже користуєтеся (напр. npm run e2e або npx playwright test). Вимірюється кожен проєкт playwright.config, який вона запускає: додайте --project <назва>, щоб вимірювати лише один браузер.",
878
804
  variablesTitle: "Інші змінні:",
879
805
  varCheck: "швидка перевірка налаштування на кількох тестах, без файлів порогів",
@@ -893,11 +819,6 @@ var uk = {
893
819
  presetNormal: "normal: рекомендовано для початку.",
894
820
  presetLoose: "loose: великий запас; лише явні регресії, для спільних або шумних середовищ.",
895
821
  presetQuestion: "Який запас мають мати обчислені пороги? [strict/normal/loose]",
896
- ci1: "Обчислюйте пороги на тих машинах CI, які будуть вимірювати: час із ноутбука там не підходить.",
897
- ci2: "Job CI, запущений вручну з PW_PERF_MODE=thresholds, зберігає файли порогів як артефакт.",
898
- ci3: "Завантажте їх і закомітьте в репозиторій.",
899
- ci4: "Запланований job (типово раз на тиждень) з PW_PERF_MODE=test падає при регресії.",
900
- ciQuestion: "Додати job-и CI для запусків порогів і вимірювань ({platform})?",
901
822
  stepCheck: "Перевірка",
902
823
  checkLesson: "Перевірка запускає вашу команду тестів як справжні запуски, лише з 2 проходами: спершу PW_PERF_MODE=thresholds, потім PW_PERF_MODE=test. Її пороги потрапляють у тимчасову папку, яку потім видаляють; ваші файли порогів не змінюються.",
903
824
  checkQuestion: "Запустити перевірку зараз?",
@@ -913,14 +834,15 @@ var uk = {
913
834
  boxDocs: "Інші структури (mergeTests, кілька об’єктів test, playwright-bdd): {url}",
914
835
  runLine: "Запуск: {command}",
915
836
  runLesson: "Вимірювання — це ваша звичайна команда тестів із PW_PERF_MODE.",
916
- nextCheck: "{command}: подивіться, що буде виміряно і скільки триватиме повний запуск.",
917
- nextThresholds: "{command}: спершу обчисліть пороги на машинах CI, які будуть вимірювати: запустіть ручний job порогів (або цю команду там) і завантажте файли порогів з його артефакту. Поки їх немає, вимірювання використовують широкі типові пороги. {estimate}",
918
- nextThresholdsNoCi: "{command}: спершу обчисліть пороги на машинах CI, які будуть вимірювати (див. {url}). Поки файлів порогів немає, вимірювання використовують широкі типові пороги. {estimate}",
919
- estimateUnknown: "(Оцінку часу дасть команда перевірки.)",
920
- estimateAbove: "(Стартова рамка запуску показує оцінку часу за останнім запуском.)",
921
- nextCommit: "Закомітьте {files}.",
922
- nextTest: "{command}: вимірювальний запуск, що падає при регресії. Результати: {report}; подробиці коду виходу: {outcome}.",
923
- nextCiJobs: "Вимірювальний job у {path} виконується раз на тиждень, його можна запустити вручну.",
837
+ importantTitle: "ВАЖЛИВО",
838
+ importantIntro: "Що робити далі, у такому порядку:",
839
+ importantFixFirst: "Спершу додайте фікстуру perf (червона рамка вище): доти жоден ендпоінт не вимірюється.",
840
+ importantThresholds: "Обчисліть пороги в CI, у тому середовищі, де запускатимуться тести (час, виміряний на ноутбуці, не переноситься). Це може тривати кілька годин: ваша команда тестів виконується кілька разів на 1 воркері.",
841
+ importantDownload: "Завантажте файли порогів з артефактів CI: запуск порогів також копіює їх у папку звіту {dir}. Приклади для CI: docs/ci.md.",
842
+ importantCommit: "Закомітьте їх: {files}.",
843
+ importantTest: "Відтепер запускайте тести цією командою; вона завершується помилкою при регресії:",
844
+ importantResults: "Результати: {report}; подробиці коду виходу: {outcome}.",
845
+ tryCheck: "Спершу спробуйте локально: {command} показує, що буде виміряно і скільки триватиме повний запуск.",
924
846
  windowsNote: "Форми цих команд для PowerShell і cmd: docs/cli.md.",
925
847
  boxWrapThis: "Обгорніть той, який імпортують ваші тести: {file}",
926
848
  boxWorkspace: "{file} у пакеті workspace {pkg}: встановіть {self} у корені workspace (напр. pnpm add -Dw) або також у цьому пакеті.",
@@ -933,7 +855,7 @@ var uk = {
933
855
  noConfigFound: "playwright.config знайдено в підкаталогах; запустіть налаштування в каталозі кожного, який хочете вимірювати:",
934
856
  checkCause: "Найімовірніша причина: {cause}",
935
857
  formatNote: "Відформатуйте змінені файли своїм форматером (напр. prettier --write).",
936
- manualNewContext: "Запити контекстів, створених через request.newContext(), не вимірюються, доки кожен контекст не відстежується ({count}): {files}.",
858
+ manualNewContext: "Запити контекстів, створених через request.newContext(), не вимірюються, доки кожен контекст не відстежуватиметься ({count}): {files}.",
937
859
  manualNewContextHint: "Відстежуйте кожен контекст одразу після створення:"
938
860
  };
939
861
  var ru = {
@@ -965,19 +887,17 @@ var ru = {
965
887
  stepMeasure: "Что измерять",
966
888
  measureApi: 'api: время ответа запросов к бэкенду, которые отправляют страницы, и вызовов request в API-тестах, сгруппированное в ключи эндпоинтов, например "GET /api/users/:id".',
967
889
  measureSteps: 'steps: длительность ваших блоков test.step без изменений в тестах; каждый шаг становится ключом, например "checkout › pay", с собственным файлом порогов.',
968
- stepsPrivacy: "Заголовки шагов очищаются: идентификаторы, e-mail, URL и секреты никогда не попадают в ключи, даже в кавычках.",
890
+ stepsPrivacy: "Названия шагов очищаются: идентификаторы, e-mail, URL и секреты никогда не попадают в ключи, даже в кавычках.",
969
891
  stepFilesFound: "Файлы с test.step: {count}.",
970
892
  noStepsFound: "test.step пока не найдено: шаги будут измеряться, как только вы добавите блоки test.step.",
971
893
  measureQuestion: "Что измерять? [{all}/api/steps]",
972
894
  onlyStepsNoSteps: "Только шаги, но test.step не найдено: ничего не измеряется, пока вы не добавите блоки test.step.",
973
895
  stepCommand: "Команда тестов",
974
- commandLesson1: "Введите команду, которой вы обычно запускаете тесты, напр. npm run e2e:qa. Мастер добавит перед ней PW_PERF_MODE в командах ниже, запишет её в job-ы CI и запустит для проверки.",
896
+ commandLesson1: "Введите команду, которой вы обычно запускаете тесты, напр. npm run e2e:qa. Мастер ничего в ней не меняет: использует её в командах в конце и для проверки.",
975
897
  commandLesson2: 'Enter оставляет предложенную команду; "skip" тоже её оставляет и пропускает проверку в конце.',
976
898
  commandQuestion: "Какой командой вы обычно запускаете тесты?",
977
899
  commandVariable: "Введите команду без переменных PW_PERF_: мастер сам добавляет PW_PERF_MODE.",
978
900
  commandChain: "Эта команда объединяет несколько команд: PW_PERF_MODE=... перед ней доходит только до первой. Поместите цепочку в скрипт package.json и введите npm run <скрипт>.",
979
- stepCi: "CI",
980
- noCi: "Конфигурация CI не найдена. Рецепты для GitHub Actions, GitLab CI, Jenkins и Azure Pipelines: {url}",
981
901
  stepChanges: "Изменения",
982
902
  nothingToChange: "Менять нечего: проект уже настроен для этих ответов.",
983
903
  changesLesson: "Каждое изменение показывается как diff, прежде чем его применить.",
@@ -988,14 +908,12 @@ var ru = {
988
908
  applyQuestion: "Применить это изменение?",
989
909
  fileWritten: "Записано: {path}",
990
910
  skipped: "Пропущено.",
991
- stepSummary: "Итог",
911
+ stepSummary: "Сводка",
992
912
  changedFiles: "Изменённые файлы:",
993
913
  noFilesChanged: "Ни один файл не изменён.",
994
914
  plannedChanges: "Запланированные изменения (не записаны):",
995
915
  manualSteps: "Ручные шаги: {count} (см. предупреждения выше).",
996
916
  nextSteps: "Дальнейшие шаги:",
997
- nextJenkins: "Создайте в Jenkins job типа Pipeline с путём к скрипту {path}.",
998
- nextAzure: "Создайте pipeline в Azure DevOps из {path}.",
999
917
  nextApply: "Примените изменения выше (запустите настройку ещё раз в терминале).",
1000
918
  originsNote: "Ключи эндпоинтов origin из baseURL не имеют метки, а другие хосты помечаются своим хостом; более короткие метки для них задайте в keys.origins в {configFile}.",
1001
919
  docs: "Документация: {links}",
@@ -1012,11 +930,6 @@ var ru = {
1012
930
  manualConfigPattern: "{config} не изменён: его export — не простой defineConfig({...}) и не объект (например, другая обёртка).",
1013
931
  configHintIntro: "Оберните экспортируемую конфигурацию в withPerf() как самый внешний вызов (в том числе вокруг других обёрток):",
1014
932
  configHintCjs: "В {path} с module.exports: {call}.",
1015
- manualCiKept: "{file} уже существует и не изменялся.",
1016
- manualCiHint: "Сравните его с examples/ci/ в репозитории {pkg}.",
1017
- manualGitlabInclude: ".gitlab-ci.yml не изменён: подключите в нём новый файл job.",
1018
- manualNpmOne: "{files} устанавливает зависимости через npm.",
1019
- manualNpmHint: 'Этот проект использует {manager}: замените "npm ci" на "{install}", а "npx" на "{npx}".',
1020
933
  declinedRun: "Запустите свою команду тестов с PW_PERF_MODE=thresholds и закоммитьте файлы pw-perf-thresholds*.json, затем PW_PERF_MODE=test выполняет измерение (напр. {example}).",
1021
934
  about1: "{pkg} измеряет время ответа эндпоинтов бэкенда (и по желанию ваших блоков test.step) в уже существующих e2e-тестах, без изменений в тестах.",
1022
935
  stepProject: "Что делает пакет и как его запускать",
@@ -1025,7 +938,7 @@ var ru = {
1025
938
  usageCommandPlaceholder: "<ваша команда тестов>",
1026
939
  usageThresholds: "выполняет тесты несколько раз на 1 воркере и записывает файлы порогов;",
1027
940
  usageCommit: "закоммитьте файлы порогов в репозиторий;",
1028
- usageTest: "измеряет снова и падает при регрессии; локально и в CI.",
941
+ usageTest: "измеряет снова и завершается с ошибкой при регрессии; локально и в CI.",
1029
942
  usageCommand: "Команда тестов — та, которой вы уже пользуетесь (напр. npm run e2e или npx playwright test). Измеряется каждый проект playwright.config, который она запускает: добавьте --project <имя>, чтобы измерять только один браузер.",
1030
943
  variablesTitle: "Другие переменные:",
1031
944
  varCheck: "быстрая проверка настройки на нескольких тестах, без файлов порогов",
@@ -1041,15 +954,10 @@ var ru = {
1041
954
  taggedSaved: "@perf сохраняется как run.grep в {configFile}; ваши команды не меняются.",
1042
955
  stepPreset: "Запас порогов",
1043
956
  presetLesson: "Пороги — это время из запуска порогов плюс запас. Пресет задаёт запас для всех правил:",
1044
- presetStrict: "strict: малый запас; ловит меньшие регрессии, чаще ложные тревоги в нестабильной среде.",
957
+ presetStrict: "strict: малый запас; ловит меньшие регрессии, чаще ложные тревоги в нестабильном окружении.",
1045
958
  presetNormal: "normal: рекомендуется для начала.",
1046
- presetLoose: "loose: большой запас; только явные регрессии, для общих или шумных сред.",
959
+ presetLoose: "loose: большой запас; только явные регрессии, для общих или шумных окружений.",
1047
960
  presetQuestion: "Какой запас должен быть у вычисленных порогов? [strict/normal/loose]",
1048
- ci1: "Вычисляйте пороги на тех машинах CI, которые будут измерять: время с ноутбука там не подходит.",
1049
- ci2: "Job CI, запущенный вручную с PW_PERF_MODE=thresholds, сохраняет файлы порогов как артефакт.",
1050
- ci3: "Скачайте их и закоммитьте в репозиторий.",
1051
- ci4: "Запланированный job (по умолчанию раз в неделю) с PW_PERF_MODE=test падает при регрессии.",
1052
- ciQuestion: "Добавить job-ы CI для запусков порогов и измерений ({platform})?",
1053
961
  stepCheck: "Проверка",
1054
962
  checkLesson: "Проверка запускает вашу команду тестов как настоящие запуски, только с 2 проходами: сначала PW_PERF_MODE=thresholds, затем PW_PERF_MODE=test. Её пороги попадают во временную папку, которая затем удаляется; ваши файлы порогов не меняются.",
1055
963
  checkQuestion: "Запустить проверку сейчас?",
@@ -1065,14 +973,15 @@ var ru = {
1065
973
  boxDocs: "Другие структуры (mergeTests, несколько объектов test, playwright-bdd): {url}",
1066
974
  runLine: "Запуск: {command}",
1067
975
  runLesson: "Измерение — это ваша обычная команда тестов с PW_PERF_MODE.",
1068
- nextCheck: "{command}: посмотрите, что будет измерено и сколько займёт полный запуск.",
1069
- nextThresholds: "{command}: сначала вычислите пороги на машинах CI, которые будут измерять: запустите ручной job порогов (или эту команду там) и скачайте файлы порогов из его артефакта. Пока их нет, измерения используют широкие пороги по умолчанию. {estimate}",
1070
- nextThresholdsNoCi: "{command}: сначала вычислите пороги на машинах CI, которые будут измерять (см. {url}). Пока файлов порогов нет, измерения используют широкие пороги по умолчанию. {estimate}",
1071
- estimateUnknown: "(Оценку времени даст команда проверки.)",
1072
- estimateAbove: "(Стартовая рамка запуска показывает оценку времени по последнему запуску.)",
1073
- nextCommit: "Закоммитьте {files}.",
1074
- nextTest: "{command}: измерительный запуск, который падает при регрессии. Результаты: {report}; подробности кода выхода: {outcome}.",
1075
- nextCiJobs: "Измерительный job в {path} выполняется раз в неделю, его можно запустить вручную.",
976
+ importantTitle: "ВАЖНО",
977
+ importantIntro: "Что делать дальше, в таком порядке:",
978
+ importantFixFirst: "Сначала добавьте фикстуру perf (красная рамка выше): до этого ни один эндпоинт не измеряется.",
979
+ importantThresholds: "Вычислите пороги в CI, в том окружении, где будут запускаться тесты (время, измеренное на ноутбуке, не переносится). Это может занять несколько часов: ваша команда тестов выполняется несколько раз на 1 воркере.",
980
+ importantDownload: "Скачайте файлы порогов из артефактов CI: запуск порогов также копирует их в папку отчёта {dir}. Примеры для CI: docs/ci.md.",
981
+ importantCommit: "Закоммитьте их: {files}.",
982
+ importantTest: "С этого момента запускайте тесты этой командой; она завершается с ошибкой при регрессии:",
983
+ importantResults: "Результаты: {report}; подробности кода выхода: {outcome}.",
984
+ tryCheck: "Сначала попробуйте локально: {command} показывает, что будет измерено и сколько займёт полный запуск.",
1076
985
  windowsNote: "Формы этих команд для PowerShell и cmd: docs/cli.md.",
1077
986
  boxWrapThis: "Оберните тот, который импортируют ваши тесты: {file}",
1078
987
  boxWorkspace: "{file} находится в пакете workspace {pkg}: установите {self} в корне workspace (напр. pnpm add -Dw) или также в этом пакете.",
@@ -1080,12 +989,12 @@ var ru = {
1080
989
  manualDirectImportsHint: "Измените импорт в каждом из них:",
1081
990
  manualDirectImportsModuleHint: "Импортируйте в них test из {module} или измените импорт в каждом из них:",
1082
991
  passesSetup: "globalSetup и проекты setup тоже выполняются один раз за проход, а их запросы не измеряются: сделайте заполнение данных идемпотентным.",
1083
- commandReporter: "Эта команда или её скрипт задаёт --reporter: измерительный запуск или запуск порогов с ним завершается ошибкой RUN_REPORTER_FLAG. Для измерения используйте команду без --reporter.",
992
+ commandReporter: "Эта команда или её скрипт задаёт --reporter: измерительный запуск или запуск порогов с ним завершается с ошибкой RUN_REPORTER_FLAG. Для измерения используйте команду без --reporter.",
1084
993
  commandEveryPass: "Скрипт запускает это перед playwright test, поэтому оно выполняется в каждом проходе: {prep}. Перенесите долгую подготовку в отдельный скрипт, а здесь укажите скрипт без неё.",
1085
994
  noConfigFound: "playwright.config найден в подкаталогах; запустите настройку в каталоге каждого, который хотите измерять:",
1086
995
  checkCause: "Наиболее вероятная причина: {cause}",
1087
996
  formatNote: "Отформатируйте изменённые файлы своим форматтером (напр. prettier --write).",
1088
- manualNewContext: "Запросы контекстов, созданных через request.newContext(), не измеряются, пока каждый контекст не отслеживается ({count}): {files}.",
997
+ manualNewContext: "Запросы контекстов, созданных через request.newContext(), не измеряются, пока каждый контекст не начнёт отслеживаться ({count}): {files}.",
1089
998
  manualNewContextHint: "Отслеживайте каждый контекст сразу после создания:"
1090
999
  };
1091
1000
  var MESSAGES = { en, es, fr, pl, it, uk, ru };
@@ -1155,12 +1064,6 @@ var LOCKFILES = {
1155
1064
  "yarn.lock": "yarn",
1156
1065
  "package-lock.json": "npm"
1157
1066
  };
1158
- var CI_MARKERS = [
1159
- ["github", (p) => p.startsWith(".github/")],
1160
- ["gitlab", (p) => p === ".gitlab-ci.yml"],
1161
- ["jenkins", (p) => p === "Jenkinsfile"],
1162
- ["azure", (p) => p === "azure-pipelines.yml"]
1163
- ];
1164
1067
  var SOURCE_FILE = /\.(?:[cm]?[jt]s|[jt]sx)$/u;
1165
1068
  var IMPORTS_PLAYWRIGHT_TEST = /(?:\bfrom\s*|\brequire\s*\(\s*|\bimport\s*\(\s*|^\s*import\s*)(['"])@playwright\/test\1/mu;
1166
1069
  var EXTEND_CALL = /(?<!\bexpect)\.extend\s*[<(]/gu;
@@ -1226,7 +1129,6 @@ function detectProject(files) {
1226
1129
  const moduleType = configPath?.endsWith(".mts") || configPath?.endsWith(".mjs") ? "esm" : configPath?.endsWith(".cts") || configPath?.endsWith(".cjs") ? "cjs" : pkg?.["type"] === "module" ? "esm" : "cjs";
1227
1130
  const packageModule = pkg?.["type"] === "module" ? "esm" : "cjs";
1228
1131
  const scripts = pkg?.["scripts"];
1229
- const paths = [...files.keys()];
1230
1132
  return {
1231
1133
  playwrightConfig: configPath === null ? null : { path: configPath, text: configText },
1232
1134
  playwrightVersion: playwrightVersion(files, pkg),
@@ -1241,7 +1143,6 @@ function detectProject(files) {
1241
1143
  ),
1242
1144
  taggedPerfTestFiles: sources2.filter((p) => PERF_TAG.test(text(p))).length,
1243
1145
  stepFiles: sources2.filter((p) => text(p).includes("test.step(")).length,
1244
- ciPlatform: CI_MARKERS.find(([, test]) => paths.some(test))?.[0] ?? null,
1245
1146
  scriptTexts: typeof scripts === "object" && scripts !== null ? Object.fromEntries(
1246
1147
  Object.entries(scripts).filter((e) => typeof e[1] === "string")
1247
1148
  ) : {},
@@ -1557,437 +1458,6 @@ function resolveImport(from, specifier, files, aliases) {
1557
1458
  return name === null || name !== specifier ? null : files.get(workspaceKey(name)) ?? null;
1558
1459
  }
1559
1460
 
1560
- // src/cli/init/files.ts
1561
- var ROOT_FILES = /* @__PURE__ */ new Set([
1562
- "package.json",
1563
- "tsconfig.json",
1564
- ".gitignore",
1565
- ".gitlab-ci.yml",
1566
- "Jenkinsfile",
1567
- "azure-pipelines.yml",
1568
- ...PLAYWRIGHT_CONFIG_NAMES,
1569
- ...PERF_CONFIG_NAMES
1570
- ]);
1571
- var ROOT_CI_FILE = /^(?:Jenkinsfile\.perf(?:-[a-z0-9-]+)?|azure-pipelines\.perf(?:-[a-z0-9-]+)?\.yml)$/u;
1572
- var SKIP_DIRS = /* @__PURE__ */ new Set([
1573
- "node_modules",
1574
- ".git",
1575
- "dist",
1576
- "build",
1577
- "coverage",
1578
- "test-results",
1579
- "playwright-report",
1580
- "blob-report"
1581
- ]);
1582
- var MAX_DEPTH = 8;
1583
- var MAX_FILES = 3e3;
1584
- var MAX_CONFIGS = 20;
1585
- async function findPlaywrightConfigs(host, root) {
1586
- const found = [];
1587
- let level = [""];
1588
- for (let depth = 1; depth <= 3 && found.length < MAX_CONFIGS; depth += 1) {
1589
- const next = [];
1590
- for (const rel of level) {
1591
- for (const entry of await host.listDir(rel === "" ? root : host.paths.join(root, rel))) {
1592
- if (!entry.directory || entry.name === "node_modules" || entry.name.startsWith("."))
1593
- continue;
1594
- const dir = rel === "" ? entry.name : `${rel}/${entry.name}`;
1595
- next.push(dir);
1596
- const names = new Set((await host.listDir(host.paths.join(root, dir))).map((e) => e.name));
1597
- const config = PLAYWRIGHT_CONFIG_NAMES.find((name) => names.has(name));
1598
- if (config !== void 0 && found.length < MAX_CONFIGS) found.push(`${dir}/${config}`);
1599
- }
1600
- }
1601
- level = next;
1602
- }
1603
- return found.sort();
1604
- }
1605
- async function readProjectFiles(host, root) {
1606
- const files = /* @__PURE__ */ new Map();
1607
- const join2 = (rel) => host.paths.join(root, rel);
1608
- const read = async (rel) => {
1609
- const text = await host.readText(join2(rel));
1610
- if (text !== null) files.set(rel, text);
1611
- };
1612
- for (const entry of await host.listDir(root)) {
1613
- if (entry.directory) continue;
1614
- if (Object.hasOwn(LOCKFILES, entry.name)) files.set(entry.name, "");
1615
- else if (ROOT_FILES.has(entry.name) || ROOT_CI_FILE.test(entry.name)) await read(entry.name);
1616
- }
1617
- for (const dir of [".github", ".github/workflows", ".gitlab"]) {
1618
- for (const entry of await host.listDir(join2(dir))) {
1619
- if (!entry.directory && /\.ya?ml$/u.test(entry.name)) await read(`${dir}/${entry.name}`);
1620
- }
1621
- }
1622
- const playwright = host.resolvePlaywright(root);
1623
- if (playwright !== null)
1624
- files.set(INSTALLED_PLAYWRIGHT, JSON.stringify({ version: playwright.version }));
1625
- const config = PLAYWRIGHT_CONFIG_NAMES.find((name) => files.has(name));
1626
- if (config === void 0) return files;
1627
- let count = 0;
1628
- const repos = [];
1629
- const walk = async (rel, depth) => {
1630
- if (depth > MAX_DEPTH || rel.split("/").includes("..")) return;
1631
- const entries = await host.listDir(rel === "." ? root : join2(rel));
1632
- if (depth > 0 && entries.some((e) => e.name === ".git")) {
1633
- repos.push(rel);
1634
- return;
1635
- }
1636
- for (const entry of entries) {
1637
- if (count >= MAX_FILES) return;
1638
- const path = rel === "." ? entry.name : `${rel}/${entry.name}`;
1639
- if (entry.directory) {
1640
- const skip = SKIP_DIRS.has(entry.name) || entry.name.startsWith(".") || path === DEFAULT_CONFIG.report.dir;
1641
- if (!skip) await walk(path, depth + 1);
1642
- } else if (SOURCE_FILE.test(entry.name) && !files.has(path)) {
1643
- count += 1;
1644
- await read(path);
1645
- }
1646
- }
1647
- };
1648
- for (const dir of testDirsOf(files.get(config))) await walk(dir, 0);
1649
- await walk(".", 0);
1650
- await readImportedFromRepos(files, repos, read);
1651
- await readWorkspaceEntries(host, root, files);
1652
- return files;
1653
- }
1654
- function sources(files) {
1655
- return [...files].filter(([path]) => SOURCE_FILE.test(path) && !path.startsWith("node_modules/"));
1656
- }
1657
- async function readImportedFromRepos(files, repos, read) {
1658
- if (repos.length === 0) return;
1659
- for (const [path, text] of sources(files)) {
1660
- for (const specifier of importSpecifiers(text)) {
1661
- if (!specifier.startsWith(".")) continue;
1662
- const target = normalizePath(`${path.split("/").slice(0, -1).join("/")}/${specifier}`);
1663
- if (!repos.some((repo) => target === repo || target.startsWith(`${repo}/`))) continue;
1664
- for (const candidate of candidatePaths(target)) {
1665
- if (files.has(candidate)) break;
1666
- await read(candidate);
1667
- if (files.has(candidate)) break;
1668
- }
1669
- }
1670
- }
1671
- }
1672
- var MAX_PACKAGES = 50;
1673
- function packageEntries(manifest) {
1674
- let pkg = {};
1675
- try {
1676
- const value = JSON.parse(manifest ?? "{}");
1677
- if (typeof value === "object" && value !== null) pkg = value;
1678
- } catch {
1679
- }
1680
- const found = [];
1681
- const add = (value) => {
1682
- if (typeof value === "string") found.push(value);
1683
- else if (typeof value === "object" && value !== null) {
1684
- const conditions = value;
1685
- for (const key of [".", "types", "import", "require", "default"]) add(conditions[key]);
1686
- }
1687
- };
1688
- add(pkg["exports"]);
1689
- for (const key of ["types", "module", "main"]) add(pkg[key]);
1690
- found.push("src/index", "index");
1691
- return [...new Set(found.map((entry) => normalizePath(entry)))];
1692
- }
1693
- async function readWorkspaceEntries(host, root, files) {
1694
- const names = /* @__PURE__ */ new Set();
1695
- for (const [, text] of sources(files)) {
1696
- for (const specifier of importSpecifiers(text)) {
1697
- const name = packageName(specifier);
1698
- if (name !== null && !name.startsWith("@playwright/") && name !== PACKAGE_NAME)
1699
- names.add(name);
1700
- }
1701
- }
1702
- const realRoot = await host.realPath(root) ?? root;
1703
- for (const name of [...names].sort().slice(0, MAX_PACKAGES)) {
1704
- const dir = await host.realPath(host.paths.join(root, `node_modules/${name}`));
1705
- if (dir === null || /[\\/]node_modules[\\/]/u.test(`${dir}/`)) continue;
1706
- const manifest = await host.readText(host.paths.join(dir, "package.json"));
1707
- for (const entry of packageEntries(manifest).flatMap(candidatePaths)) {
1708
- const text = await host.readText(host.paths.join(dir, entry));
1709
- if (text === null || !SOURCE_FILE.test(entry)) continue;
1710
- const key = relativePath(realRoot, host.paths.join(dir, entry)).replaceAll("\\", "/");
1711
- files.set(key, text);
1712
- files.set(workspaceKey(name), key);
1713
- break;
1714
- }
1715
- }
1716
- }
1717
-
1718
- // src/cli/init/generated/ci-templates.ts
1719
- var CI_TEMPLATES = {
1720
- /** examples/ci/github-actions.yml */
1721
- github: `# Performance runs with playwright-performance-regression (pw-perf). Save as
1722
- # .github/workflows/perf.yml. Recommended path (docs/ci.md):
1723
- # 1. Run the "thresholds" job by hand (Actions > Performance > Run workflow, mode: thresholds).
1724
- # Thresholds come from the same machines that measure.
1725
- # 2. Download the pw-perf-thresholds artifact and commit its pw-perf-thresholds*.json files.
1726
- # 3. The "measure" job runs every Monday (or by hand, mode: test) and fails on a regression.
1727
- # The exit code comes from reports/pw-perf/outcome.json: 0 ok, 2 performance regression, 3 tool or
1728
- # config error. Not ready to block builds? Add "continue-on-error: true" to the measure job.
1729
- name: Performance
1730
-
1731
- on:
1732
- schedule:
1733
- - cron: '0 3 * * 1'
1734
- workflow_dispatch:
1735
- inputs:
1736
- mode:
1737
- description: 'test: measurement run, thresholds: derive the thresholds files'
1738
- type: choice
1739
- options: [test, thresholds]
1740
- default: test
1741
-
1742
- jobs:
1743
- thresholds:
1744
- if: github.event_name == 'workflow_dispatch' && inputs.mode == 'thresholds'
1745
- runs-on: ubuntu-latest
1746
- timeout-minutes: 120
1747
- env:
1748
- PW_PERF_MODE: thresholds
1749
- steps:
1750
- - uses: actions/checkout@v7
1751
- - uses: actions/setup-node@v7
1752
- with:
1753
- node-version: 22
1754
- cache: npm
1755
- - run: npm ci
1756
- - run: npx playwright install --with-deps chromium
1757
- - name: Thresholds run
1758
- run: |
1759
- rm -f reports/pw-perf/outcome.json
1760
- npm run e2e || true
1761
- exit "$(node -p "require('./reports/pw-perf/outcome.json').exitCode" 2>/dev/null || echo 3)"
1762
- - name: Upload the thresholds files
1763
- if: always()
1764
- uses: actions/upload-artifact@v7
1765
- with:
1766
- name: pw-perf-thresholds
1767
- path: |
1768
- pw-perf-thresholds*.json
1769
- reports/pw-perf/
1770
- retention-days: 30
1771
-
1772
- measure:
1773
- if: github.event_name == 'schedule' || inputs.mode == 'test'
1774
- runs-on: ubuntu-latest
1775
- timeout-minutes: 60
1776
- env:
1777
- PW_PERF_MODE: test
1778
- steps:
1779
- - uses: actions/checkout@v7
1780
- - uses: actions/setup-node@v7
1781
- with:
1782
- node-version: 22
1783
- cache: npm
1784
- - run: npm ci
1785
- - run: npx playwright install --with-deps chromium
1786
- - name: Measurement run
1787
- run: |
1788
- rm -f reports/pw-perf/outcome.json
1789
- npm run e2e || true
1790
- exit "$(node -p "require('./reports/pw-perf/outcome.json').exitCode" 2>/dev/null || echo 3)"
1791
- - name: Upload the performance report
1792
- if: always()
1793
- uses: actions/upload-artifact@v7
1794
- with:
1795
- name: pw-perf-report
1796
- path: reports/pw-perf/
1797
- retention-days: 30
1798
- `,
1799
- /** examples/ci/gitlab-ci.yml */
1800
- gitlab: `# Performance runs with playwright-performance-regression (pw-perf). Save as
1801
- # .gitlab/perf.gitlab-ci.yml and include it from .gitlab-ci.yml. Recommended path (docs/ci.md):
1802
- # 1. Start the manual "perf-thresholds" job. Thresholds come from the same runners that measure.
1803
- # 2. Download its artifacts and commit the pw-perf-thresholds*.json files.
1804
- # 3. The "perf" job runs in scheduled pipelines (create a weekly schedule) and can be started by
1805
- # hand; it fails on a regression.
1806
- # The exit code comes from reports/pw-perf/outcome.json: 2 (performance regression) is a soft
1807
- # failure, 3 (tool or config error) fails the job.
1808
- .perf:
1809
- image: node:22
1810
- before_script:
1811
- - npm ci
1812
- - npx playwright install --with-deps chromium
1813
- script:
1814
- - rm -f reports/pw-perf/outcome.json
1815
- - npm run e2e || true
1816
- - exit "$(node -p "require('./reports/pw-perf/outcome.json').exitCode" 2>/dev/null || echo 3)"
1817
-
1818
- perf-thresholds:
1819
- extends: .perf
1820
- timeout: 2h
1821
- variables:
1822
- PW_PERF_MODE: thresholds
1823
- rules:
1824
- - when: manual
1825
- allow_failure: true
1826
- artifacts:
1827
- when: always
1828
- paths:
1829
- - pw-perf-thresholds*.json
1830
- - reports/pw-perf/
1831
- expire_in: 30 days
1832
-
1833
- perf:
1834
- extends: .perf
1835
- timeout: 1h
1836
- variables:
1837
- PW_PERF_MODE: test
1838
- rules:
1839
- - if: $CI_PIPELINE_SOURCE == "schedule"
1840
- - when: manual
1841
- allow_failure: true
1842
- allow_failure:
1843
- exit_codes: 2
1844
- artifacts:
1845
- when: always
1846
- paths:
1847
- - reports/pw-perf/
1848
- expire_in: 30 days
1849
- `,
1850
- /** examples/ci/Jenkinsfile */
1851
- jenkins: `// Performance runs with playwright-performance-regression (pw-perf). Use as the script of a
1852
- // pipeline job, e.g. "Jenkinsfile.perf". Recommended path (docs/ci.md):
1853
- // 1. Build with parameters, MODE=thresholds. Thresholds come from the same agents that measure.
1854
- // 2. Download the archived pw-perf-thresholds*.json files and commit them.
1855
- // 3. The job runs every Monday with MODE=test and fails on a regression.
1856
- // The exit code comes from reports/pw-perf/outcome.json: 2 (performance regression) marks the
1857
- // build UNSTABLE, 3 (tool or config error) fails it.
1858
- pipeline {
1859
- agent any
1860
- parameters {
1861
- choice(name: 'MODE', choices: ['test', 'thresholds'], description: 'test: measurement run, thresholds: derive the thresholds files')
1862
- }
1863
- options {
1864
- timeout(time: 120, unit: 'MINUTES')
1865
- }
1866
- triggers {
1867
- cron('H 3 * * 1')
1868
- }
1869
- environment {
1870
- PW_PERF_MODE = "\${params.MODE ?: 'test'}"
1871
- }
1872
- stages {
1873
- stage('Performance') {
1874
- steps {
1875
- sh 'npm ci'
1876
- sh 'npx playwright install --with-deps chromium'
1877
- sh 'rm -f reports/pw-perf/outcome.json'
1878
- sh(script: 'npm run e2e', returnStatus: true)
1879
- script {
1880
- def code = sh(script: 'node -p "require(\\'./reports/pw-perf/outcome.json\\').exitCode" 2>/dev/null || echo 3', returnStdout: true).trim()
1881
- if (code == '2') {
1882
- unstable('Performance regression (exit code 2)')
1883
- } else if (code != '0') {
1884
- error("Performance run failed with exit code \${code}")
1885
- }
1886
- }
1887
- }
1888
- }
1889
- }
1890
- post {
1891
- always {
1892
- archiveArtifacts artifacts: 'pw-perf-thresholds*.json, reports/pw-perf/**', allowEmptyArchive: true
1893
- }
1894
- }
1895
- }
1896
- `,
1897
- /** examples/ci/azure-pipelines.yml */
1898
- azure: `# Performance runs with playwright-performance-regression (pw-perf). Register as its own
1899
- # pipeline, e.g. azure-pipelines.perf.yml. Recommended path (docs/ci.md):
1900
- # 1. Run the pipeline by hand with mode "thresholds". Thresholds come from the same agents
1901
- # that measure.
1902
- # 2. Download the pw-perf-thresholds artifact and commit its pw-perf-thresholds*.json files.
1903
- # 3. The pipeline runs every Monday with mode "test" and fails on a regression.
1904
- # The exit code comes from reports/pw-perf/outcome.json: 2 (performance regression) ends the job
1905
- # as "succeeded with issues", 3 (tool or config error) fails it.
1906
- trigger: none
1907
- pr: none
1908
-
1909
- parameters:
1910
- - name: mode
1911
- displayName: 'test: measurement run, thresholds: derive the thresholds files'
1912
- type: string
1913
- default: test
1914
- values: [test, thresholds]
1915
-
1916
- schedules:
1917
- - cron: '0 3 * * 1'
1918
- displayName: Weekly measurement run
1919
- branches:
1920
- include:
1921
- - main
1922
- always: true
1923
-
1924
- pool:
1925
- vmImage: ubuntu-latest
1926
-
1927
- jobs:
1928
- - job: perf
1929
- timeoutInMinutes: 120
1930
- variables:
1931
- PW_PERF_MODE: \${{ parameters.mode }}
1932
- steps:
1933
- - task: NodeTool@0
1934
- inputs:
1935
- versionSpec: '22.x'
1936
- - script: npm ci
1937
- displayName: Install dependencies
1938
- - script: npx playwright install --with-deps chromium
1939
- displayName: Install Chromium
1940
- - bash: |
1941
- rm -f reports/pw-perf/outcome.json
1942
- npm run e2e || true
1943
- code=$(node -p "require('./reports/pw-perf/outcome.json').exitCode" 2>/dev/null || echo 3)
1944
- if [ "$code" -eq 2 ]; then
1945
- echo "##vso[task.complete result=SucceededWithIssues;]Performance regression (exit code 2)"
1946
- exit 0
1947
- fi
1948
- exit $code
1949
- displayName: Performance run
1950
- - bash: mkdir -p pw-perf-thresholds && cp pw-perf-thresholds*.json pw-perf-thresholds/
1951
- condition: and(always(), eq('\${{ parameters.mode }}', 'thresholds'))
1952
- displayName: Collect the thresholds files
1953
- - publish: pw-perf-thresholds
1954
- artifact: pw-perf-thresholds
1955
- condition: and(always(), eq('\${{ parameters.mode }}', 'thresholds'))
1956
- displayName: Publish the thresholds files
1957
- - publish: reports/pw-perf
1958
- artifact: pw-perf-report
1959
- condition: always()
1960
- displayName: Publish the performance report
1961
- `
1962
- };
1963
-
1964
- // src/cli/init/ci.ts
1965
- var CI_COMMAND = "npm run e2e";
1966
- var CI_PATHS = {
1967
- github: ".github/workflows/perf.yml",
1968
- gitlab: ".gitlab/perf.gitlab-ci.yml",
1969
- jenkins: "Jenkinsfile.perf",
1970
- azure: "azure-pipelines.perf.yml"
1971
- };
1972
- function yamlScalar(text) {
1973
- const plain = !/^[-?:,[\]{}#&*!|>'"%@`\s]/u.test(text) && !/(: |\s#|:$|\s$|['"\t])/u.test(text);
1974
- return plain ? text : `'${text.replaceAll("'", "''")}'`;
1975
- }
1976
- function groovySingleQuoted(text) {
1977
- return text.replaceAll("\\", "\\\\").replaceAll("'", "\\'");
1978
- }
1979
- function ciFile(platform, command) {
1980
- const template = CI_TEMPLATES[platform];
1981
- const text = platform === "gitlab" ? (
1982
- // A sequence item of a plain YAML list.
1983
- template.replaceAll(`- ${CI_COMMAND} || true`, `- ${yamlScalar(`${command} || true`)}`)
1984
- ) : platform === "jenkins" ? template.replaceAll(`'${CI_COMMAND}'`, `'${groovySingleQuoted(command)}'`) : (
1985
- // GitHub Actions and Azure Pipelines: inside a `|` block, taken literally.
1986
- template.replaceAll(CI_COMMAND, command)
1987
- );
1988
- return { path: CI_PATHS[platform], text };
1989
- }
1990
-
1991
1461
  // src/cli/init/generated/config-options.ts
1992
1462
  var CONFIG_OPTIONS = [
1993
1463
  { path: "run", description: "How the measurement run is executed.", leaf: false },
@@ -2070,7 +1540,7 @@ var CONFIG_OPTIONS = [
2070
1540
  path: "measure.exclude",
2071
1541
  description: "Requests whose URL matches any pattern are skipped.",
2072
1542
  leaf: true,
2073
- default: ["/socket.io/"]
1543
+ default: ["/socket.io/", "/sockjs/", "/sockjs-node/", "/signalr/", "/_blazor/"]
2074
1544
  },
2075
1545
  {
2076
1546
  path: "measure.excludeKnownThirdParty",
@@ -2664,11 +2134,17 @@ var CONFIG_OPTIONS = [
2664
2134
  { path: "report", description: "Run outputs.", leaf: false },
2665
2135
  {
2666
2136
  path: "report.dir",
2667
- description: "Directory of report.json and report.html, relative to the Playwright config directory.",
2137
+ description: "Directory of report.json, report.html and junit.xml, relative to the Playwright config directory.",
2668
2138
  leaf: true,
2669
2139
  default: "reports/pw-perf"
2670
2140
  },
2671
2141
  { path: "report.html", description: "Write the HTML report.", leaf: true, default: true },
2142
+ {
2143
+ path: "report.junit",
2144
+ description: "Write junit.xml next to report.json in test mode.",
2145
+ leaf: true,
2146
+ default: true
2147
+ },
2672
2148
  {
2673
2149
  path: "report.rawUrls",
2674
2150
  description: "Include raw URLs of the slowest samples in the run report.",
@@ -2692,7 +2168,7 @@ var CONFIG_OPTIONS = [
2692
2168
 
2693
2169
  // src/cli/init/perf-config.ts
2694
2170
  var PERF_TAG2 = "@perf";
2695
- var WIDTH = 100;
2171
+ var WIDTH = 97;
2696
2172
  function activeValues(answers) {
2697
2173
  const values = /* @__PURE__ */ new Map();
2698
2174
  if (answers.passesTest !== DEFAULT_CONFIG.run.passes.test)
@@ -2729,15 +2205,12 @@ function wrap(text, width) {
2729
2205
  if (line !== "") lines2.push(line);
2730
2206
  return lines2;
2731
2207
  }
2732
- var nested = (place) => place.commented ? { ...place, inner: `${place.inner} ` } : { ...place, indent: `${place.indent} ` };
2733
- var lineAt = (place, text) => place.commented ? `${place.indent}// ${place.inner}${text}`.trimEnd() : `${place.indent}${text}`;
2734
- var prefixLength = (place) => place.indent.length + (place.commented ? 3 + place.inner.length : 0);
2735
2208
  var Renderer = class {
2736
2209
  lines = [];
2737
2210
  #children = /* @__PURE__ */ new Map();
2738
- #active;
2739
- constructor(active) {
2740
- this.#active = active;
2211
+ #answers;
2212
+ constructor(answers) {
2213
+ this.#answers = answers;
2741
2214
  for (const option of CONFIG_OPTIONS) {
2742
2215
  if (!inFile(option.path)) continue;
2743
2216
  const parent = option.path.split(".").slice(0, -1).join(".");
@@ -2747,39 +2220,34 @@ var Renderer = class {
2747
2220
  children(path) {
2748
2221
  return this.#children.get(path) ?? [];
2749
2222
  }
2750
- #isActive(path) {
2751
- for (const key of this.#active.keys())
2752
- if (key === path || key.startsWith(`${path}.`)) return true;
2753
- return false;
2754
- }
2755
- option(option, outer) {
2756
- const active = this.#isActive(option.path);
2757
- const place = outer.commented || active ? outer : { ...outer, commented: true };
2223
+ /** The option with its comment above, as active code (04-D-54). */
2224
+ option(option, indent) {
2758
2225
  const name = option.path.split(".").at(-1);
2759
- const valueText = option.leaf && active ? ts(this.#active.get(option.path)) : ts(option.default);
2226
+ const answered = option.leaf && this.#answers.has(option.path);
2760
2227
  const text = FILE_TEXTS.get(option.path) ?? option.description;
2761
- const description = option.leaf && active ? `${text} Default: ${ts(option.default)}.` : text;
2762
- for (const l of wrap(description, WIDTH - prefixLength(outer) - 3))
2763
- this.lines.push(lineAt(outer, `// ${l}`));
2228
+ const description = answered ? `${text} Default: ${ts(option.default)}.` : text;
2229
+ for (const l of wrap(description, WIDTH - indent.length - 3))
2230
+ this.lines.push(`${indent}// ${l}`);
2764
2231
  if (!option.leaf) {
2765
- this.lines.push(lineAt(place, `${name}: {`));
2766
- for (const child of this.children(option.path)) this.option(child, nested(place));
2767
- this.lines.push(lineAt(place, "},"));
2232
+ this.lines.push(`${indent}${name}: {`);
2233
+ for (const child of this.children(option.path)) this.option(child, `${indent} `);
2234
+ this.lines.push(`${indent}},`);
2768
2235
  return;
2769
2236
  }
2770
- const single = `${name}: ${valueText},`;
2771
- if (prefixLength(place) + single.length <= WIDTH || !Array.isArray(option.default)) {
2772
- this.lines.push(lineAt(place, single));
2237
+ const value = answered ? this.#answers.get(option.path) : option.default;
2238
+ const single = `${indent}${name}: ${ts(value)},`;
2239
+ if (single.length <= WIDTH || !Array.isArray(value)) {
2240
+ this.lines.push(single);
2773
2241
  return;
2774
2242
  }
2775
- const inside = nested(place);
2776
- this.lines.push(lineAt(place, `${name}: [`));
2243
+ const inside = `${indent} `;
2244
+ this.lines.push(`${indent}${name}: [`);
2777
2245
  for (const l of wrap(
2778
- option.default.map((item) => `${ts(item)},`).join(" "),
2779
- WIDTH - prefixLength(inside)
2246
+ value.map((item) => `${ts(item)},`).join(" "),
2247
+ WIDTH - inside.length
2780
2248
  ))
2781
- this.lines.push(lineAt(inside, l));
2782
- this.lines.push(lineAt(place, "],"));
2249
+ this.lines.push(`${inside}${l}`);
2250
+ this.lines.push(`${indent}],`);
2783
2251
  }
2784
2252
  };
2785
2253
  var CONFIG_FILE_OPTIONS = [
@@ -2841,7 +2309,7 @@ var CONFIG_FILE_OPTIONS = [
2841
2309
  },
2842
2310
  {
2843
2311
  option: "report.dir",
2844
- text: "Directory of report.json and report.html (do not commit it), relative to the Playwright config directory."
2312
+ text: "Directory of report.json, report.html and junit.xml (do not commit it), relative to the Playwright config directory."
2845
2313
  }
2846
2314
  ];
2847
2315
  var FILE_TEXTS = new Map(CONFIG_FILE_OPTIONS.map((o) => [o.option, o.text]));
@@ -2852,19 +2320,16 @@ function inFile(path) {
2852
2320
  }
2853
2321
  function renderPerfConfig(answers, format2 = "ts") {
2854
2322
  const renderer = new Renderer(activeValues(answers));
2855
- const top = { indent: " ", commented: false, inner: "" };
2856
2323
  renderer.children("").forEach((section, i) => {
2857
2324
  if (i > 0) renderer.lines.push("");
2858
- renderer.option(section, top);
2325
+ renderer.option(section, " ");
2859
2326
  });
2860
2327
  return [
2861
2328
  ...format2 === "ts" ? [] : ["// @ts-check"],
2862
2329
  `// Configuration of ${PACKAGE_NAME}, written by its guided setup.`,
2863
2330
  "// It lists the most important options only; every option, with its default, is described at",
2864
2331
  `// ${DOCS_CONFIG_URL}`,
2865
- "// Only the values that differ from the defaults are set. The other options are commented out",
2866
- "// with their default value: uncomment a line (and its enclosing objects) to change it. Objects",
2867
- "// are merged with the defaults; an array you set replaces the default array.",
2332
+ "// Objects are merged with the defaults; an array you set replaces the default array.",
2868
2333
  format2 === "cjs" ? `const { definePerfConfig } = require('${PACKAGE_NAME}');` : `import { definePerfConfig } from '${PACKAGE_NAME}';`,
2869
2334
  "",
2870
2335
  format2 === "cjs" ? "module.exports = definePerfConfig({" : "export default definePerfConfig({",
@@ -3400,40 +2865,23 @@ function planGitignore(info, plan) {
3400
2865
  const c = change(info, ".gitignore", addIgnore(current, dir));
3401
2866
  if (c !== null) plan.changes.push(c);
3402
2867
  }
3403
- var INSTALL = {
3404
- npm: "npm ci",
3405
- pnpm: "pnpm install --frozen-lockfile",
3406
- yarn: "yarn install --immutable"
3407
- };
3408
- function planCi(info, answers, plan, t) {
3409
- const platform = info.ciPlatform;
3410
- if (!answers.addCi || platform === null) return;
3411
- const file = ciFile(platform, answers.command);
3412
- const before = info.files.get(file.path) ?? null;
3413
- if (before === file.text) return;
3414
- if (before !== null) {
3415
- plan.manualSteps.push(
3416
- manual(t("manualCiKept", { file: file.path }), t("manualCiHint", { pkg: PACKAGE_NAME }))
3417
- );
3418
- return;
3419
- }
3420
- plan.changes.push({ path: file.path, kind: "create", before: null, after: file.text });
3421
- if (platform === "gitlab" && !(info.files.get(".gitlab-ci.yml") ?? "").includes(file.path)) {
3422
- plan.manualSteps.push(
3423
- manual(t("manualGitlabInclude"), ["include:", ` - local: ${file.path}`].join("\n"))
3424
- );
3425
- }
3426
- if (info.packageManager !== "npm") {
3427
- plan.manualSteps.push(
3428
- manual(
3429
- t("manualNpmOne", { files: file.path }),
3430
- t("manualNpmHint", {
3431
- manager: info.packageManager,
3432
- install: INSTALL[info.packageManager],
3433
- npx: info.packageManager === "pnpm" ? "pnpm exec" : "yarn"
3434
- })
3435
- )
3436
- );
2868
+ function emptyThresholdsFiles() {
2869
+ const prefix = DEFAULT_CONFIG.thresholds.filePrefix;
2870
+ return [
2871
+ { path: `${prefix}.json`, kind: "api" },
2872
+ { path: `${prefix}.steps.json`, kind: "step" }
2873
+ ];
2874
+ }
2875
+ function planThresholdsFiles(info, plan) {
2876
+ for (const { path, kind } of emptyThresholdsFiles()) {
2877
+ if (info.files.has(path)) continue;
2878
+ const after = stringifyStable({
2879
+ schemaVersion: SCHEMA_VERSIONS.thresholds,
2880
+ kind,
2881
+ generated: null,
2882
+ entries: {}
2883
+ });
2884
+ plan.changes.push({ path, kind: "create", before: null, after });
3437
2885
  }
3438
2886
  }
3439
2887
  function planInitChanges(info, answers, lang = "en") {
@@ -3444,12 +2892,163 @@ function planInitChanges(info, answers, lang = "en") {
3444
2892
  planTestObject(info, answers, plan, t);
3445
2893
  planRequestContexts(info, answers, plan, t);
3446
2894
  planGitignore(info, plan);
3447
- planCi(info, answers, plan, t);
2895
+ planThresholdsFiles(info, plan);
3448
2896
  return plan;
3449
2897
  }
3450
2898
  function isProtected(info, path) {
3451
2899
  return PERF_CONFIG_NAMES.includes(path) && info.existing.perfConfig === path;
3452
2900
  }
2901
+
2902
+ // src/cli/init/files.ts
2903
+ var ROOT_FILES = /* @__PURE__ */ new Set([
2904
+ "package.json",
2905
+ "tsconfig.json",
2906
+ ".gitignore",
2907
+ ...PLAYWRIGHT_CONFIG_NAMES,
2908
+ ...PERF_CONFIG_NAMES,
2909
+ // Existing thresholds files are never replaced by the empty ones (04-REQ-75).
2910
+ ...emptyThresholdsFiles().map((f) => f.path)
2911
+ ]);
2912
+ var SKIP_DIRS = /* @__PURE__ */ new Set([
2913
+ "node_modules",
2914
+ ".git",
2915
+ "dist",
2916
+ "build",
2917
+ "coverage",
2918
+ "test-results",
2919
+ "playwright-report",
2920
+ "blob-report"
2921
+ ]);
2922
+ var MAX_DEPTH = 8;
2923
+ var MAX_FILES = 3e3;
2924
+ var MAX_CONFIGS = 20;
2925
+ async function findPlaywrightConfigs(host, root) {
2926
+ const found = [];
2927
+ let level = [""];
2928
+ for (let depth = 1; depth <= 3 && found.length < MAX_CONFIGS; depth += 1) {
2929
+ const next = [];
2930
+ for (const rel of level) {
2931
+ for (const entry of await host.listDir(rel === "" ? root : host.paths.join(root, rel))) {
2932
+ if (!entry.directory || entry.name === "node_modules" || entry.name.startsWith("."))
2933
+ continue;
2934
+ const dir = rel === "" ? entry.name : `${rel}/${entry.name}`;
2935
+ next.push(dir);
2936
+ const names = new Set((await host.listDir(host.paths.join(root, dir))).map((e) => e.name));
2937
+ const config = PLAYWRIGHT_CONFIG_NAMES.find((name) => names.has(name));
2938
+ if (config !== void 0 && found.length < MAX_CONFIGS) found.push(`${dir}/${config}`);
2939
+ }
2940
+ }
2941
+ level = next;
2942
+ }
2943
+ return found.sort();
2944
+ }
2945
+ async function readProjectFiles(host, root) {
2946
+ const files = /* @__PURE__ */ new Map();
2947
+ const join2 = (rel) => host.paths.join(root, rel);
2948
+ const read = async (rel) => {
2949
+ const text = await host.readText(join2(rel));
2950
+ if (text !== null) files.set(rel, text);
2951
+ };
2952
+ for (const entry of await host.listDir(root)) {
2953
+ if (entry.directory) continue;
2954
+ if (Object.hasOwn(LOCKFILES, entry.name)) files.set(entry.name, "");
2955
+ else if (ROOT_FILES.has(entry.name)) await read(entry.name);
2956
+ }
2957
+ const playwright = host.resolvePlaywright(root);
2958
+ if (playwright !== null)
2959
+ files.set(INSTALLED_PLAYWRIGHT, JSON.stringify({ version: playwright.version }));
2960
+ const config = PLAYWRIGHT_CONFIG_NAMES.find((name) => files.has(name));
2961
+ if (config === void 0) return files;
2962
+ let count = 0;
2963
+ const repos = [];
2964
+ const walk = async (rel, depth) => {
2965
+ if (depth > MAX_DEPTH || rel.split("/").includes("..")) return;
2966
+ const entries = await host.listDir(rel === "." ? root : join2(rel));
2967
+ if (depth > 0 && entries.some((e) => e.name === ".git")) {
2968
+ repos.push(rel);
2969
+ return;
2970
+ }
2971
+ for (const entry of entries) {
2972
+ if (count >= MAX_FILES) return;
2973
+ const path = rel === "." ? entry.name : `${rel}/${entry.name}`;
2974
+ if (entry.directory) {
2975
+ const skip = SKIP_DIRS.has(entry.name) || entry.name.startsWith(".") || path === DEFAULT_CONFIG.report.dir;
2976
+ if (!skip) await walk(path, depth + 1);
2977
+ } else if (SOURCE_FILE.test(entry.name) && !files.has(path)) {
2978
+ count += 1;
2979
+ await read(path);
2980
+ }
2981
+ }
2982
+ };
2983
+ for (const dir of testDirsOf(files.get(config))) await walk(dir, 0);
2984
+ await walk(".", 0);
2985
+ await readImportedFromRepos(files, repos, read);
2986
+ await readWorkspaceEntries(host, root, files);
2987
+ return files;
2988
+ }
2989
+ function sources(files) {
2990
+ return [...files].filter(([path]) => SOURCE_FILE.test(path) && !path.startsWith("node_modules/"));
2991
+ }
2992
+ async function readImportedFromRepos(files, repos, read) {
2993
+ if (repos.length === 0) return;
2994
+ for (const [path, text] of sources(files)) {
2995
+ for (const specifier of importSpecifiers(text)) {
2996
+ if (!specifier.startsWith(".")) continue;
2997
+ const target = normalizePath(`${path.split("/").slice(0, -1).join("/")}/${specifier}`);
2998
+ if (!repos.some((repo) => target === repo || target.startsWith(`${repo}/`))) continue;
2999
+ for (const candidate of candidatePaths(target)) {
3000
+ if (files.has(candidate)) break;
3001
+ await read(candidate);
3002
+ if (files.has(candidate)) break;
3003
+ }
3004
+ }
3005
+ }
3006
+ }
3007
+ var MAX_PACKAGES = 50;
3008
+ function packageEntries(manifest) {
3009
+ let pkg = {};
3010
+ try {
3011
+ const value = JSON.parse(manifest ?? "{}");
3012
+ if (typeof value === "object" && value !== null) pkg = value;
3013
+ } catch {
3014
+ }
3015
+ const found = [];
3016
+ const add = (value) => {
3017
+ if (typeof value === "string") found.push(value);
3018
+ else if (typeof value === "object" && value !== null) {
3019
+ const conditions = value;
3020
+ for (const key of [".", "types", "import", "require", "default"]) add(conditions[key]);
3021
+ }
3022
+ };
3023
+ add(pkg["exports"]);
3024
+ for (const key of ["types", "module", "main"]) add(pkg[key]);
3025
+ found.push("src/index", "index");
3026
+ return [...new Set(found.map((entry) => normalizePath(entry)))];
3027
+ }
3028
+ async function readWorkspaceEntries(host, root, files) {
3029
+ const names = /* @__PURE__ */ new Set();
3030
+ for (const [, text] of sources(files)) {
3031
+ for (const specifier of importSpecifiers(text)) {
3032
+ const name = packageName(specifier);
3033
+ if (name !== null && !name.startsWith("@playwright/") && name !== PACKAGE_NAME)
3034
+ names.add(name);
3035
+ }
3036
+ }
3037
+ const realRoot = await host.realPath(root) ?? root;
3038
+ for (const name of [...names].sort().slice(0, MAX_PACKAGES)) {
3039
+ const dir = await host.realPath(host.paths.join(root, `node_modules/${name}`));
3040
+ if (dir === null || /[\\/]node_modules[\\/]/u.test(`${dir}/`)) continue;
3041
+ const manifest = await host.readText(host.paths.join(dir, "package.json"));
3042
+ for (const entry of packageEntries(manifest).flatMap(candidatePaths)) {
3043
+ const text = await host.readText(host.paths.join(dir, entry));
3044
+ if (text === null || !SOURCE_FILE.test(entry)) continue;
3045
+ const key = relativePath(realRoot, host.paths.join(dir, entry)).replaceAll("\\", "/");
3046
+ files.set(key, text);
3047
+ files.set(workspaceKey(name), key);
3048
+ break;
3049
+ }
3050
+ }
3051
+ }
3453
3052
  var PromptAborted = class extends Error {
3454
3053
  constructor() {
3455
3054
  super("interrupted");
@@ -3509,6 +3108,57 @@ function formatIssues(issues, level, opts) {
3509
3108
  return issues.map((issue) => formatIssue(issue, level, opts)).join("");
3510
3109
  }
3511
3110
 
3111
+ // src/cli/init/next-steps.ts
3112
+ var IMPORTANT_BOX_MAX_WIDTH = 80;
3113
+ var MIN_WIDTH = 40;
3114
+ var INDENT = 3;
3115
+ function importantBoxWidth(columns) {
3116
+ const known = columns !== void 0 && columns > 0 ? columns : IMPORTANT_BOX_MAX_WIDTH;
3117
+ return Math.min(IMPORTANT_BOX_MAX_WIDTH, Math.max(MIN_WIDTH, known));
3118
+ }
3119
+ function importantBox(input, opts) {
3120
+ const { t, commands, reportDir } = input;
3121
+ const point = (n, text) => ({ text: `${n}. ${text}`, indent: INDENT });
3122
+ const command = (text) => ({
3123
+ text: `${" ".repeat(INDENT)}${text}`,
3124
+ style: "cyan",
3125
+ indent: INDENT
3126
+ });
3127
+ const under = (text) => ({
3128
+ text: `${" ".repeat(INDENT)}${text}`,
3129
+ indent: INDENT
3130
+ });
3131
+ const lines2 = [
3132
+ { text: t("importantIntro"), style: "bold" },
3133
+ ...input.fixFirst ? [{ text: t("importantFixFirst"), style: "red" }] : [],
3134
+ { text: "" },
3135
+ point(1, t("importantThresholds")),
3136
+ command(commands.thresholds),
3137
+ { text: "" },
3138
+ point(2, t("importantDownload", { dir: reportDir })),
3139
+ { text: "" },
3140
+ point(3, t("importantCommit", { files: input.files.join(", ") })),
3141
+ { text: "" },
3142
+ point(4, t("importantTest")),
3143
+ command(commands.test),
3144
+ under(
3145
+ t("importantResults", {
3146
+ report: `${reportDir}/report.html`,
3147
+ outcome: `${reportDir}/outcome.json`
3148
+ })
3149
+ ),
3150
+ ...input.windows ? [{ text: "" }, { text: t("windowsNote"), style: "dim" }] : []
3151
+ ];
3152
+ return box(lines2, {
3153
+ width: importantBoxWidth(opts.columns),
3154
+ color: opts.color,
3155
+ ascii: opts.ascii,
3156
+ border: "yellow",
3157
+ title: `${marks(opts.ascii).warn} ${t("importantTitle")}`,
3158
+ wrap: true
3159
+ });
3160
+ }
3161
+
3512
3162
  // src/cli/init/wizard.ts
3513
3163
  function versionAtLeast(version, minimum) {
3514
3164
  const parts = (v) => v.split(/[.+-]/u).slice(0, 3).map((p) => Number.parseInt(p, 10) || 0);
@@ -3519,13 +3169,7 @@ function versionAtLeast(version, minimum) {
3519
3169
  }
3520
3170
  return true;
3521
3171
  }
3522
- var STEPS = 10;
3523
- var PLATFORM_NAMES = {
3524
- github: "GitHub Actions",
3525
- gitlab: "GitLab CI",
3526
- jenkins: "Jenkins",
3527
- azure: "Azure Pipelines"
3528
- };
3172
+ var STEPS = 9;
3529
3173
  var DOCS = `${REPOSITORY_URL}/blob/main/docs`;
3530
3174
  var TUTORIAL_QUESTION = `Set up ${PACKAGE_NAME} with a guided tutorial?`;
3531
3175
  var LANGUAGE_QUESTION = `Language / Język? [${LANGUAGES.join("/")}]`;
@@ -3561,7 +3205,7 @@ var Dialog = class {
3561
3205
  line(text, style, indent = " ") {
3562
3206
  this.say(`${indent}${this.paint(text, style)}`);
3563
3207
  }
3564
- /** Step header in cyan ("[2/10] Which tests") and the lesson dimmed. */
3208
+ /** Step header in cyan ("[2/9] Which tests") and the lesson dimmed. */
3565
3209
  step(n, title, ...lesson) {
3566
3210
  this.say("", this.paint(`[${n}/${STEPS}] ${title}`, "cyan"));
3567
3211
  for (const l of lesson) this.line(l, "dim");
@@ -3766,23 +3410,12 @@ async function askAnswers(dialog, info) {
3766
3410
  if (hints.reporter) dialog.line(`⚠ ${t("commandReporter")}`, "yellow");
3767
3411
  if (hints.everyPass !== null)
3768
3412
  dialog.line(`⚠ ${t("commandEveryPass", { prep: hints.everyPass })}`, "yellow");
3769
- dialog.stepOf(7, "stepCi", "ci1", "ci2", "ci3", "ci4");
3770
- let addCi = false;
3771
- if (info.ciPlatform === null) {
3772
- dialog.say(` ${t("noCi", { url: `${DOCS}/ci.md` })}`);
3773
- } else {
3774
- addCi = await dialog.confirm(
3775
- t("ciQuestion", { platform: PLATFORM_NAMES[info.ciPlatform] }),
3776
- true
3777
- );
3778
- }
3779
3413
  return {
3780
3414
  scope,
3781
3415
  passesTest,
3782
3416
  measure,
3783
3417
  preset,
3784
3418
  command,
3785
- addCi,
3786
3419
  runCheck: dialog.interactive && !skipped
3787
3420
  };
3788
3421
  }
@@ -3896,37 +3529,6 @@ function thresholdsFiles(info, answers) {
3896
3529
  files.push(`${prefix}.steps.json`);
3897
3530
  return files;
3898
3531
  }
3899
- function nextSteps(dialog, info, answers, commands, written, checkRan) {
3900
- const { t, paint: paint3 } = dialog;
3901
- const cmd = (text) => paint3(text, "cyan");
3902
- if (written.length === 0) return [t("nextApply")];
3903
- const dir = DEFAULT_CONFIG.report.dir;
3904
- const platform = info.ciPlatform;
3905
- const ciPath = answers.addCi && platform !== null ? CI_PATHS[platform] : null;
3906
- const estimate = t(checkRan ? "estimateAbove" : "estimateUnknown");
3907
- const steps = [];
3908
- if (!checkRan) steps.push(t("nextCheck", { command: cmd(commands.check) }));
3909
- steps.push(
3910
- ciPath === null ? t("nextThresholdsNoCi", {
3911
- command: cmd(commands.thresholds),
3912
- url: `${DOCS}/ci.md`,
3913
- estimate
3914
- }) : t("nextThresholds", { command: cmd(commands.thresholds), estimate }),
3915
- t("nextCommit", { files: thresholdsFiles(info, answers).join(", ") }),
3916
- t("nextTest", {
3917
- command: cmd(commands.test),
3918
- report: `${dir}/report.html`,
3919
- outcome: `${dir}/outcome.json`
3920
- })
3921
- );
3922
- if (ciPath !== null && platform !== null) {
3923
- const ci = [t("nextCiJobs", { path: ciPath })];
3924
- if (platform === "jenkins") ci.push(t("nextJenkins", { path: ciPath }));
3925
- if (platform === "azure") ci.push(t("nextAzure", { path: ciPath }));
3926
- steps.push(ci.join(" "));
3927
- }
3928
- return steps;
3929
- }
3930
3532
  async function checkCause(host, mode) {
3931
3533
  const text = await host.readText(
3932
3534
  host.paths.join(host.cwd, `${DEFAULT_CONFIG.report.dir}/outcome.json`)
@@ -4040,7 +3642,7 @@ async function runInit(cmd, host, style) {
4040
3642
  const plan = planInitChanges(info, answers, lang);
4041
3643
  const commands = runCommands(answers.command, host.platform);
4042
3644
  dialog.stepOf(
4043
- 8,
3645
+ 7,
4044
3646
  "stepChanges",
4045
3647
  plan.changes.length === 0 ? "nothingToChange" : "changesLesson"
4046
3648
  );
@@ -4063,7 +3665,7 @@ ${redBox}`);
4063
3665
  const wrapped = info.existing.wrappedConfig || written.includes(configPath);
4064
3666
  let checkResults = null;
4065
3667
  if (testObject === null || testObject.stepsMeasured) {
4066
- dialog.stepOf(9, "stepCheck", "checkLesson");
3668
+ dialog.stepOf(8, "stepCheck", "checkLesson");
4067
3669
  if (answers.runCheck && written.length > 0 && wrapped) {
4068
3670
  if (await dialog.confirm(t("checkQuestion"), true)) {
4069
3671
  prompt?.close();
@@ -4077,7 +3679,7 @@ ${redBox}`);
4077
3679
  dialog.line(t("skipped"), "dim");
4078
3680
  }
4079
3681
  }
4080
- dialog.step(10, t("stepSummary"));
3682
+ dialog.step(9, t("stepSummary"));
4081
3683
  if (written.length > 0) {
4082
3684
  dialog.say(
4083
3685
  ` ${t("changedFiles")}`,
@@ -4097,26 +3699,36 @@ ${redBox}`);
4097
3699
  if (r.code !== 0) dialog.say(` ${t("checkExit", { mode: r.mode, code: r.code })}`);
4098
3700
  if (r.code !== 0 && r.cause !== null) dialog.say(` ${t("checkCause", { cause: r.cause })}`);
4099
3701
  }
4100
- dialog.say("", ` ${paint3(t("runLine", { command: commands.test }), "bold")}`);
4101
- dialog.line(t("runLesson"), "dim");
4102
- if (host.platform === "win32") dialog.line(t("windowsNote"), "dim");
4103
- dialog.say(
4104
- ` ${paint3(t("nextSteps"), "bold")}`,
4105
- ...nextSteps(
4106
- dialog,
4107
- info,
4108
- answers,
4109
- commands,
4110
- written,
4111
- checkResults !== null && checkResults.length > 0
4112
- ).map((s, i) => ` ${i + 1}. ${s}`)
4113
- );
3702
+ const done = write && (written.length > 0 || plan.changes.length === 0);
3703
+ if (!done) {
3704
+ dialog.say("", ` ${paint3(t("runLine", { command: commands.test }), "bold")}`);
3705
+ dialog.line(t("runLesson"), "dim");
3706
+ if (host.platform === "win32") dialog.line(t("windowsNote"), "dim");
3707
+ dialog.say(` ${paint3(t("nextSteps"), "bold")}`, ` 1. ${t("nextApply")}`);
3708
+ } else if (checkResults === null || checkResults.length === 0) {
3709
+ dialog.say("", ` ${t("tryCheck", { command: paint3(commands.check, "cyan") })}`);
3710
+ }
4114
3711
  const oldScripts = info.existing.scripts.filter((name) => name.startsWith("perf:"));
4115
3712
  if (oldScripts.length > 0) dialog.say(` ${t("oldScripts", { names: oldScripts.join(", ") })}`);
4116
3713
  dialog.say(` ${t("originsNote", { configFile: configFileName(info) })}`);
4117
3714
  const links = [`${DOCS}/adoption.md`, `${DOCS}/cli.md`, `${DOCS}/ci.md`];
4118
3715
  dialog.line(t("docs", { links: links.join(" · ") }), "dim");
4119
3716
  if (write) dialog.line(`✔ ${t("finished")}`, "green");
3717
+ if (done) {
3718
+ const important = importantBox(
3719
+ {
3720
+ t,
3721
+ commands,
3722
+ files: thresholdsFiles(info, answers),
3723
+ reportDir: DEFAULT_CONFIG.report.dir,
3724
+ fixFirst: redBox !== null,
3725
+ windows: host.platform === "win32"
3726
+ },
3727
+ { columns: host.stdout.columns, color: dialog.colors, ascii: dialog.ascii }
3728
+ );
3729
+ host.stdout.write(`
3730
+ ${important}`);
3731
+ }
4120
3732
  return 0;
4121
3733
  } catch (error) {
4122
3734
  if (error instanceof PromptAborted) {