kwikqa 0.1.0 → 0.2.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  KwikQA End User License Agreement
2
2
 
3
- Effective 21 October 2026
3
+ Effective 23 October 2026
4
4
  Copyright (c) 2026 KwikQA. All rights reserved.
5
5
 
6
6
  KwikQA is proprietary software. It is not open source, and this agreement does not grant any
@@ -47,8 +47,9 @@ you do not accept, do not install or use the Software.
47
47
  https://kwikqa.com/pricing/. Usage is counted per AI request as described there. Paid plans are
48
48
  sold by Paddle.com, our merchant of record, renew monthly or yearly until cancelled, and are
49
49
  refunded as described at https://kwikqa.com/refunds/, including a full refund of your first
50
- payment if you cancel within 14 days of it. We may change plans or prices with at least 30
51
- days' notice; a change applies from your next billing period after the notice ends.
50
+ payment if you cancel within 14 days of it, once in any 12 months. We may change plans or
51
+ prices with at least 30 days' notice; a change applies from your next billing period after the
52
+ notice ends.
52
53
 
53
54
  5. Your data. You keep all rights in your code, test reports, evidence, and the changes the
54
55
  Software makes to your code. The Software builds a redacted, size-limited evidence packet on
package/README.md CHANGED
@@ -13,6 +13,8 @@ npx kwikqa fix
13
13
  npx kwikqa validate
14
14
  ```
15
15
 
16
+ Using pnpm, Yarn, or Bun? See [Package managers and monorepos](#package-managers-and-monorepos).
17
+
16
18
  ## What it will and won't do
17
19
 
18
20
  - **Diagnoses with evidence.** Every cause it reports cites the report fields, trace events, or source
@@ -34,10 +36,13 @@ npx kwikqa validate
34
36
  ## Requirements
35
37
 
36
38
  - Node.js 20.11 or later
37
- - Playwright Test, Cypress, or WebdriverIO (Mocha or Jasmine) installed in your project. KwikQA
38
- runs your project's own copy and never installs packages or browsers.
39
+ - Playwright Test, Cypress, or WebdriverIO (Mocha or Jasmine) installed in your project with npm,
40
+ pnpm, Yarn, or Bun. KwikQA runs your project's own copy and never installs packages or browsers.
39
41
  - A git repository
40
42
 
43
+ For repairs, KwikQA needs one of those three frameworks. It also reads and diagnoses runs from
44
+ [other test frameworks](#other-test-frameworks).
45
+
41
46
  ## Setup
42
47
 
43
48
  ```sh
@@ -92,12 +97,92 @@ failing specs and records each failure's page (see below).
92
97
 
93
98
  `login` signs you in with GitHub; the free plan needs no payment details.
94
99
 
100
+ ### Other test frameworks
101
+
102
+ KwikQA also reads the reports these write, and diagnoses the run:
103
+
104
+ - Vitest (`--reporter=junit`);
105
+ - Jest (`jest-junit`);
106
+ - Mocha (`mocha-junit-reporter`);
107
+ - pytest (`--junitxml`);
108
+ - Playwright's own `junit` reporter;
109
+ - JUnit and TestNG through Maven Surefire or Failsafe (`target/surefire-reports`), including
110
+ Selenium tests;
111
+ - JUnit and TestNG through Gradle (`build/test-results/test`), including the test-retry plugin's
112
+ retries;
113
+ - TestNG's own `testng-results.xml`;
114
+ - Allure results (`allure-results`) from TestNG, JUnit, Playwright, and pytest;
115
+ - CTRF reports, from Playwright, Jest, pytest, and other tools that write them;
116
+ - Cucumber's JSON report, from cucumber-js (`--format json:<file>`) and Cucumber-JVM (the `json`
117
+ plugin).
118
+
119
+ Point `--report` at the file or its directory:
120
+
121
+ ```sh
122
+ npx kwikqa analyze --report reports/junit.xml --html
123
+ ```
124
+
125
+ You get failure groups, a diagnosis, and the [failure report](#failure-report). KwikQA doesn't
126
+ capture, repair, or validate these runs, and `fix` says so before it sends anything. For Playwright
127
+ repairs, use its JSON reporter as shown above.
128
+
129
+ Some details depend on the reporter:
130
+
131
+ - For TestNG, `testng-results.xml` keeps retried attempts and failed configuration methods, which
132
+ Surefire's XML of the same run doesn't correlate. Under Maven, add TestNG's XML reporter to
133
+ Surefire's configuration, then point `--report` at `test-output`:
134
+
135
+ ```xml
136
+ <properties>
137
+ <property>
138
+ <name>listener</name>
139
+ <value>org.testng.reporters.XMLReporter</value>
140
+ </property>
141
+ </properties>
142
+ ```
143
+ - Allure adds each run's results to its directory, and KwikQA reads the directory as one run, so
144
+ clean it between runs: `mvn clean`, or pytest's `--clean-alluredir`. Otherwise an earlier run's
145
+ results read as retries.
146
+ - Cucumber's JSON keeps only each scenario's final attempt, so a scenario that passed on a retry
147
+ reads as passed. Cucumber-JVM 8 needs a JSON library on the test class path to write it, such as
148
+ `tools.jackson.core:jackson-databind`.
149
+ - Gradle names a JUnit parameterized test by its display name, which includes its arguments. To
150
+ keep test data out of KwikQA's titles, set
151
+ `junit.jupiter.params.displayname.default = {displayName}[{index}]` in
152
+ `junit-platform.properties`.
153
+ - jest-junit records no test file unless you set `addFileAttribute: true`.
154
+ - pytest records each test's line only with `-o junit_family=xunit1`.
155
+ - JUnit XML from a tool KwikQA doesn't recognize is still read and diagnosed, as an unidentified
156
+ framework.
157
+
158
+ ### Package managers and monorepos
159
+
160
+ This page uses npm's commands. With another package manager, install and run KwikQA the same way:
161
+
162
+ | | Install | Run |
163
+ | --- | --- | --- |
164
+ | npm | `npm i -D kwikqa` | `npx kwikqa analyze` |
165
+ | pnpm | `pnpm add -D kwikqa` | `pnpm exec kwikqa analyze` |
166
+ | Yarn | `yarn add -D kwikqa` | `yarn kwikqa analyze` |
167
+ | Bun | `bun add -d kwikqa` | `bunx kwikqa analyze` |
168
+
169
+ The commands KwikQA suggests use the same form as the one you ran.
170
+
171
+ In a monorepo, install KwikQA in the package that holds your tests, and run it from that package's
172
+ folder, where its `kwikqa.config.json` goes. KwikQA finds that package's Playwright, Cypress, or
173
+ WebdriverIO wherever your package manager installed it inside the repository, including the root's
174
+ `node_modules`. It never runs one from outside the repository, so pnpm's global virtual store
175
+ (`enableGlobalVirtualStore`) isn't supported.
176
+
95
177
  ## Commands
96
178
 
97
179
  | Command | What it does |
98
180
  | --- | --- |
99
181
  | `npx kwikqa analyze` | Diagnose the failures in the latest report. `--report <path>` picks a report file or a directory of one run's reports; `--framework` names the framework of a JUnit report; `--local` builds the evidence summary without sending anything; `--no-changes` leaves out recent code changes (see below). |
100
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
+ | `npx kwikqa analyze --html` | Also write the [failure report](#failure-report), `kwikqa-report.html`; `--output <path>` writes it elsewhere. |
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. |
101
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. |
102
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. |
103
188
  | `npx kwikqa fix --retry` | After a failed validation, re-diagnose from the new evidence and propose one revised patch. |
@@ -109,6 +194,27 @@ failing specs and records each failure's page (see below).
109
194
  Exit codes: `0` success or an informative result, `1` the repair or validation did not succeed, `2`
110
195
  usage error, `3` sign-in, plan, or usage-limit problem.
111
196
 
197
+ ## Failure report
198
+
199
+ `npx kwikqa analyze --html`, or `npx kwikqa report` after an analysis, writes one HTML file,
200
+ `kwikqa-report.html`. It shows:
201
+
202
+ - the run's counts;
203
+ - each failure group, numbered as `analyze` numbered it, with its tests, its owner (test code,
204
+ application, or environment), the diagnosis, and the evidence the diagnosis cites;
205
+ - flaky tests and failures no rule could classify;
206
+ - what KwikQA could see for each evidence channel, and every request that was sent.
207
+
208
+ A local analysis (`--local`) gets the same report without owners. Writing a report is free on
209
+ every plan and needs no sign-in. `kwikqa report` rebuilds the evidence from the same test report and
210
+ artifacts. If those have changed since the analysis, it says so instead of showing evidence the
211
+ diagnosis did not see.
212
+
213
+ The file is self-contained: it loads nothing from the network, and it stays readable when a viewer
214
+ blocks its script and styles, as Jenkins does for archived HTML by default. It holds the same
215
+ redacted evidence a request preview shows, so share it the way you share CI logs. KwikQA only ever
216
+ replaces a file it wrote itself, and `init` offers to add `kwikqa-report.html` to `.gitignore`.
217
+
112
218
  ## Plans
113
219
 
114
220
  | Plan | Monthly | Annual | Analyses / month | Fixes / month |
@@ -127,7 +233,7 @@ produced for the same run, so it doesn't use another analysis.
127
233
  The paid plans are coming soon: until they open, every account uses Free.
128
234
 
129
235
  Annual billing gives two months free. Cancel within 14 days of your first payment, monthly or
130
- annual, and it is refunded in full. After that, cancelling an annual plan from the dashboard refunds
236
+ annual, and it is refunded in full, once in any 12 months. After that, cancelling an annual plan from the dashboard refunds
131
237
  its unused months; monthly plans stay active until the end of the paid month. Payments go through
132
238
  Paddle, the merchant of record.
133
239
 
@@ -196,14 +302,81 @@ Run records, transaction journals, captures, and validation output stay on your
196
302
 
197
303
  ## CI
198
304
 
199
- `analyze` can run unattended; `fix` cannot, because applying a patch always needs a person.
305
+ `analyze` and `ci` run unattended; `fix` doesn't, because applying a patch always needs a person.
306
+ Create a CI token at https://kwikqa.com/dashboard/account/ and store it as the secret
307
+ `KWIKQA_TOKEN`. Running KwikQA with it approves its diagnosis requests, and each request's preview
308
+ is printed to the job's log.
309
+
310
+ ### GitHub Actions
311
+
312
+ `npx kwikqa ci` analyzes the failed run, writes `kwikqa-report.html`, and publishes a summary: one
313
+ row per failure group with its owner and evidence grade, the flaky tests, and a pointer to the
314
+ report. It holds no error text or evidence; the report does.
315
+
316
+ ```yaml
317
+ permissions:
318
+ contents: read
319
+ pull-requests: write # only for the comment
320
+ steps:
321
+ - uses: actions/checkout@v7
322
+ - run: npx playwright test
323
+ - if: failure()
324
+ run: npx kwikqa ci
325
+ env:
326
+ KWIKQA_TOKEN: ${{ secrets.KWIKQA_TOKEN }}
327
+ GITHUB_TOKEN: ${{ github.token }}
328
+ # Optional, see "Slack and Microsoft Teams" below
329
+ KWIKQA_SLACK_WEBHOOK_URL: ${{ secrets.KWIKQA_SLACK_WEBHOOK_URL }}
330
+ KWIKQA_TEAMS_WEBHOOK_URL: ${{ secrets.KWIKQA_TEAMS_WEBHOOK_URL }}
331
+ - if: failure()
332
+ uses: actions/upload-artifact@v7
333
+ with:
334
+ name: kwikqa-report
335
+ path: kwikqa-report.html
336
+ ```
337
+
338
+ - **Job summary.** The summary is shown on the run's page.
339
+ - **Pull-request comment.** On a pull request, the summary is also one comment. A re-run of the
340
+ same workflow job updates that comment instead of adding another, and a later run with no
341
+ failures updates it to say so. Each job of a workflow keeps its own comment; jobs of one matrix
342
+ share one, so analyze a sharded run once, after merging its reports.
343
+ - **Pull requests from forks.** GitHub gives a fork's workflows no secrets and a read-only token.
344
+ KwikQA analyzes such a run locally, writes the report and the summary, and skips the comment.
345
+ Don't switch to `pull_request_target` to get the token: it runs the fork's code with your
346
+ repository's secrets.
347
+ - **Never the cause of a failed build.** A comment or summary that can't be published is reported
348
+ in the log and skipped; the exit code is the analysis's. Without a KwikQA token, or past your
349
+ plan's limit, the run is analyzed locally and the summary says why it wasn't diagnosed.
350
+
351
+ ### Slack and Microsoft Teams
352
+
353
+ `kwikqa ci` posts the run to the incoming webhooks you store as CI secrets. KwikQA keeps no webhook
354
+ anywhere, and never prints one.
355
+
356
+ - **Slack.** Create an incoming webhook for the channel, and store its URL as
357
+ `KWIKQA_SLACK_WEBHOOK_URL`.
358
+ - **Teams.** In the channel, add the Workflows template "Post to a channel when a webhook request is
359
+ received", and store its URL as `KWIKQA_TEAMS_WEBHOOK_URL`. (Office 365 connector webhooks were
360
+ retired in May 2026.)
361
+
362
+ The message names the repository and branch, links the pull request or commit and the run, and gives
363
+ the counts. Then it has one line per failure group, with the group's category, where it fails, its
364
+ size, and its owner, and the flaky count. It holds no error text, evidence, or source: a channel is
365
+ a wider audience than a build log. KwikQA posts only when tests failed, unless you pass
366
+ `--notify always`. A failed post is retried once, printed, and never fails the build.
367
+
368
+ ### Other CI systems
369
+
370
+ `npx kwikqa ci` writes the report there too, and posts to Slack and Teams, but writes no summary or
371
+ comment yet. Or run `analyze` directly:
200
372
 
201
373
  ```sh
202
- export KWIKQA_TOKEN=... # create a CI token at https://kwikqa.com/dashboard/account/
203
- npx playwright test || npx kwikqa analyze --yes
204
- npx cypress run || npx kwikqa analyze --yes
374
+ npx playwright test || npx kwikqa analyze --yes --html
375
+ npx cypress run || npx kwikqa analyze --yes --html
205
376
  ```
206
377
 
378
+ Then keep `kwikqa-report.html` as a build artifact.
379
+
207
380
  ## Account and billing
208
381
 
209
382
  The dashboard at https://kwikqa.com/dashboard/ shows your plan, usage, and recent requests. There