kwikqa 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -3
- package/dist/kwikqa.mjs +111 -109
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -182,7 +182,7 @@ WebdriverIO wherever your package manager installed it inside the repository, in
|
|
|
182
182
|
| `npx kwikqa analyze --capture` | First re-run the failing tests so every failure has full evidence. Playwright runs with full tracing; with Playwright 1.59+ and [Playwright CLI](https://www.npmjs.com/package/@playwright/cli) installed, it also pauses locator failures at the failing line and asks Playwright for locators of the closest elements (`--no-probe` skips this). Cypress and WebdriverIO re-run the failing specs with your own config plus KwikQA's reporter and failure capture, which records each failed attempt's DOM, command log, console, and network. Asks before running anything; `--yes` approves in CI. |
|
|
183
183
|
| `npx kwikqa analyze --html` | Also write the [failure report](#failure-report), `kwikqa-report.html`; `--output <path>` writes it elsewhere. |
|
|
184
184
|
| `npx kwikqa report` | Write the failure report of the latest analysis without analyzing again or sending anything. `--run <id>` picks an earlier run under `.kwikqa/runs/`; `--output <path>` picks the file. |
|
|
185
|
-
| `npx kwikqa ci` | In a CI job: analyze as `analyze --yes --html` does, then publish a summary. On GitHub Actions that is the job summary and one pull-request comment; with your webhooks, also a Slack or Teams message. See [CI](#ci). Without a KwikQA token it analyzes locally. It takes `--report`, `--framework`, `--local`, `--no-changes`, and `--output` as `analyze` does, and `--notify always` to post to chat after every run, not only failed ones. |
|
|
185
|
+
| `npx kwikqa ci` | In a CI job: analyze as `analyze --yes --html` does, then publish a summary. On GitHub Actions that is the job summary and one pull-request comment, on Azure Pipelines a build summary and one pull-request thread, and on GitLab CI/CD the job's log and one merge-request note; with your webhooks, also a Slack or Teams message. See [CI](#ci). Without a KwikQA token it analyzes locally. It takes `--report`, `--framework`, `--local`, `--no-changes`, and `--output` as `analyze` does, and `--notify always` to post to chat after every run, not only failed ones. |
|
|
186
186
|
| `npx kwikqa fix` | Propose a repair for a test-side cause, show the diff and validation commands, and apply it if you approve. First it offers to re-run the failing tests once: a test that passes now is flaky, so KwikQA reports it and requests no repair. It starts with the failure group whose test-side diagnosis is strongest; if the model declines, or its proposal fails KwikQA's checks, it asks about the next such group, at most three, each with its own preview. One `fix` counts as one fix however many groups it tries. `--group <n>` repairs only group n, as `analyze` numbered it. `--propose-only` stops after the proposal. |
|
|
187
187
|
| `npx kwikqa validate` | Run the approved validation. The repaired test must pass three times in a row, with retries off. Passing keeps the patch; failing rolls it back. When other tests failed with the same cause, it then offers to re-run them once and names any that still fail, so you can run `fix` again for them; the patch stays either way. |
|
|
188
188
|
| `npx kwikqa fix --retry` | After a failed validation, re-diagnose from the new evidence and propose one revised patch. |
|
|
@@ -348,6 +348,68 @@ steps:
|
|
|
348
348
|
in the log and skipped; the exit code is the analysis's. Without a KwikQA token, or past your
|
|
349
349
|
plan's limit, the run is analyzed locally and the summary says why it wasn't diagnosed.
|
|
350
350
|
|
|
351
|
+
### Azure Pipelines
|
|
352
|
+
|
|
353
|
+
```yaml
|
|
354
|
+
steps:
|
|
355
|
+
- script: npx playwright test
|
|
356
|
+
- script: npx kwikqa ci
|
|
357
|
+
condition: failed()
|
|
358
|
+
env:
|
|
359
|
+
KWIKQA_TOKEN: $(KWIKQA_TOKEN)
|
|
360
|
+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
361
|
+
# Optional, see "Slack and Microsoft Teams" below
|
|
362
|
+
KWIKQA_SLACK_WEBHOOK_URL: $(KWIKQA_SLACK_WEBHOOK_URL)
|
|
363
|
+
- publish: kwikqa-report.html
|
|
364
|
+
artifact: kwikqa-report
|
|
365
|
+
condition: failed()
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Store `KWIKQA_TOKEN` as a secret variable of the pipeline. Azure Pipelines gives a step a secret,
|
|
369
|
+
and `System.AccessToken`, only through the step's `env`.
|
|
370
|
+
|
|
371
|
+
- **Build summary.** The summary is a "KwikQA" section on the run's Extensions tab.
|
|
372
|
+
- **Pull-request thread.** On an Azure Repos pull request, the summary is also one thread. A re-run
|
|
373
|
+
of the same pipeline job updates it. It's created closed, so it never holds up the pull request
|
|
374
|
+
under a comment-resolution policy.
|
|
375
|
+
- **Permission.** The thread needs "Contribute to pull requests" for the pipeline's build service.
|
|
376
|
+
Set it in Project settings → Repositories → your repository → Security, for
|
|
377
|
+
"*project* Build Service (*organization*)".
|
|
378
|
+
- **Other repositories.** A pipeline for a GitHub or Bitbucket repository gets the build summary
|
|
379
|
+
only.
|
|
380
|
+
- **Forks.** A fork's build gets no secrets unless the pipeline allows it. KwikQA analyzes it
|
|
381
|
+
locally and skips the thread.
|
|
382
|
+
|
|
383
|
+
### GitLab CI/CD
|
|
384
|
+
|
|
385
|
+
```yaml
|
|
386
|
+
e2e:
|
|
387
|
+
image: mcr.microsoft.com/playwright:v1.64.1-noble
|
|
388
|
+
script:
|
|
389
|
+
- npm ci
|
|
390
|
+
- npx playwright test || { npx kwikqa ci; exit 1; }
|
|
391
|
+
artifacts:
|
|
392
|
+
when: always
|
|
393
|
+
expose_as: KwikQA report
|
|
394
|
+
paths:
|
|
395
|
+
- kwikqa-report.html
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
The `exit 1` keeps the job failed: KwikQA exits with the analysis's code, which is usually `0`.
|
|
399
|
+
|
|
400
|
+
- **Variables.** Add `KWIKQA_TOKEN` and `GITLAB_TOKEN` under Settings → CI/CD → Variables. Mark
|
|
401
|
+
them **masked**, and leave **protected** off, or a feature branch's pipeline won't get them.
|
|
402
|
+
- **The token.** `CI_JOB_TOKEN` can't write notes, so `GITLAB_TOKEN` is a token with the `api`
|
|
403
|
+
scope and at least the Reporter role. Use a project or group access token (Premium or Ultimate on
|
|
404
|
+
GitLab.com, any tier when self-managed), or a personal access token, ideally a dedicated user's.
|
|
405
|
+
The note is posted as that token's user.
|
|
406
|
+
- **Merge-request note.** The summary is printed in the job's log and posted as one note on the
|
|
407
|
+
merge request. A re-run of the same job updates it. A merge request pipeline names its merge
|
|
408
|
+
request. A branch pipeline gets a note when its branch has exactly one open merge request in the
|
|
409
|
+
project.
|
|
410
|
+
- **Forks.** A fork's merge request pipeline runs in the fork, without your project's variables.
|
|
411
|
+
KwikQA analyzes it locally and skips the note.
|
|
412
|
+
|
|
351
413
|
### Slack and Microsoft Teams
|
|
352
414
|
|
|
353
415
|
`kwikqa ci` posts the run to the incoming webhooks you store as CI secrets. KwikQA keeps no webhook
|
|
@@ -367,8 +429,8 @@ a wider audience than a build log. KwikQA posts only when tests failed, unless y
|
|
|
367
429
|
|
|
368
430
|
### Other CI systems
|
|
369
431
|
|
|
370
|
-
`npx kwikqa ci` writes the report
|
|
371
|
-
comment yet:
|
|
432
|
+
On Jenkins and other CI systems, `npx kwikqa ci` writes the report and posts to Slack and Teams,
|
|
433
|
+
but writes no summary or comment yet:
|
|
372
434
|
|
|
373
435
|
```sh
|
|
374
436
|
npx playwright test || { npx kwikqa ci; exit 1; }
|