testeiya 0.10.1 → 0.10.2
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 +7 -19
- package/dist/prompt/clis.d.ts +7 -0
- package/dist/prompt/pipeline-report.d.ts +1 -0
- package/dist/prompt/report.d.ts +10 -0
- package/dist/prompt/system-prompt.d.ts +22 -0
- package/dist/prompt/testomat.io.d.ts +19 -0
- package/dist/prompt/thread.d.ts +73 -0
- package/dist/src/args.d.ts +39 -0
- package/dist/src/attribution-extension.d.ts +3 -0
- package/dist/src/checkpoint.d.ts +30 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +27 -32
- package/dist/src/cli.js.map +1 -1
- package/dist/src/doctor.d.ts +11 -0
- package/dist/src/env.d.ts +30 -0
- package/dist/src/exec.d.ts +11 -0
- package/dist/src/git.d.ts +41 -0
- package/dist/src/langfuse-extension.d.ts +7 -0
- package/dist/src/langfuse.d.ts +67 -0
- package/dist/src/mcp.d.ts +19 -0
- package/dist/src/model.d.ts +20 -0
- package/dist/src/models.d.ts +1 -0
- package/dist/src/output.d.ts +84 -0
- package/dist/src/pipeline/command-stage.d.ts +12 -0
- package/dist/src/pipeline/crash-guard.d.ts +12 -0
- package/dist/src/pipeline/crash-guard.js +21 -0
- package/dist/src/pipeline/crash-guard.js.map +1 -0
- package/dist/src/pipeline/diagram.d.ts +24 -0
- package/dist/src/pipeline/gate.d.ts +21 -0
- package/dist/src/pipeline/launcher.d.ts +33 -0
- package/dist/src/pipeline/launcher.js +16 -3
- package/dist/src/pipeline/launcher.js.map +1 -1
- package/dist/src/pipeline/log.d.ts +29 -0
- package/dist/src/pipeline/log.js +9 -0
- package/dist/src/pipeline/log.js.map +1 -1
- package/dist/src/pipeline/overlay.d.ts +29 -0
- package/dist/src/pipeline/pipeline-file.d.ts +44 -0
- package/dist/src/pipeline/pipeline.d.ts +78 -0
- package/dist/src/pipeline/pipeline.js +22 -0
- package/dist/src/pipeline/pipeline.js.map +1 -1
- package/dist/src/pipeline/report.d.ts +26 -0
- package/dist/src/pipeline/report.js +13 -0
- package/dist/src/pipeline/report.js.map +1 -1
- package/dist/src/pipeline/spec.d.ts +63 -0
- package/dist/src/pipeline/stage-env.d.ts +13 -0
- package/dist/src/pipeline/stage-env.js +31 -0
- package/dist/src/pipeline/stage-env.js.map +1 -0
- package/dist/src/pipeline/stage.d.ts +71 -0
- package/dist/src/pipeline/stage.js.map +1 -1
- package/dist/src/pipeline/state.d.ts +63 -0
- package/dist/src/pipeline/summary-stage.d.ts +24 -0
- package/dist/src/pipeline/task-stage.d.ts +24 -0
- package/dist/src/pipeline/task-stage.js +86 -2
- package/dist/src/pipeline/task-stage.js.map +1 -1
- package/dist/src/pipeline/variables.d.ts +20 -0
- package/dist/src/result.d.ts +6 -0
- package/dist/src/run.d.ts +69 -0
- package/dist/src/run.js +116 -60
- package/dist/src/run.js.map +1 -1
- package/dist/src/session.d.ts +43 -0
- package/dist/src/sessions.d.ts +23 -0
- package/dist/src/skills.d.ts +29 -0
- package/package.json +11 -2
- package/pipelines/api-testing.yml +1 -1
- package/scripts/vendor-skills.js +62 -0
- package/skills/codeceptjs/ci-fix-tests/SKILL.md +0 -119
- package/skills/codeceptjs/codeceptjs-auth/SKILL.md +0 -141
- package/skills/codeceptjs/codeceptjs-exploration/SKILL.md +0 -100
- package/skills/codeceptjs/codeceptjs-fundamentals/SKILL.md +0 -196
- package/skills/codeceptjs/codeceptjs-run-analysis/SKILL.md +0 -83
- package/skills/codeceptjs/debugging-codeceptjs-tests/SKILL.md +0 -126
- package/skills/codeceptjs/lint-codeceptjs-tests/SKILL.md +0 -104
- package/skills/codeceptjs/migrate-codeceptjs-4/SKILL.md +0 -109
- package/skills/codeceptjs/migrate-cypress-to-codeceptjs/SKILL.md +0 -295
- package/skills/codeceptjs/migrate-protractor-to-codeceptjs/SKILL.md +0 -339
- package/skills/codeceptjs/migrate-selenium-java-to-codeceptjs/SKILL.md +0 -459
- package/skills/codeceptjs/migrate-testcafe-to-codeceptjs/SKILL.md +0 -338
- package/skills/codeceptjs/refactoring-codeceptjs-tests/SKILL.md +0 -78
- package/skills/codeceptjs/writing-codeceptjs-tests/SKILL.md +0 -102
- package/skills/playwright/playwright-best-practices/SKILL.md +0 -303
- package/skills/playwright/playwright-best-practices/advanced/authentication-flows.md +0 -360
- package/skills/playwright/playwright-best-practices/advanced/authentication.md +0 -871
- package/skills/playwright/playwright-best-practices/advanced/clock-mocking.md +0 -364
- package/skills/playwright/playwright-best-practices/advanced/mobile-testing.md +0 -409
- package/skills/playwright/playwright-best-practices/advanced/multi-context.md +0 -288
- package/skills/playwright/playwright-best-practices/advanced/multi-user.md +0 -393
- package/skills/playwright/playwright-best-practices/advanced/network-advanced.md +0 -452
- package/skills/playwright/playwright-best-practices/advanced/third-party.md +0 -464
- package/skills/playwright/playwright-best-practices/architecture/pom-vs-fixtures.md +0 -363
- package/skills/playwright/playwright-best-practices/architecture/test-architecture.md +0 -369
- package/skills/playwright/playwright-best-practices/architecture/when-to-mock.md +0 -383
- package/skills/playwright/playwright-best-practices/browser-apis/browser-apis.md +0 -391
- package/skills/playwright/playwright-best-practices/browser-apis/iframes.md +0 -403
- package/skills/playwright/playwright-best-practices/browser-apis/service-workers.md +0 -504
- package/skills/playwright/playwright-best-practices/browser-apis/websockets.md +0 -403
- package/skills/playwright/playwright-best-practices/core/annotations.md +0 -424
- package/skills/playwright/playwright-best-practices/core/assertions-waiting.md +0 -361
- package/skills/playwright/playwright-best-practices/core/configuration.md +0 -452
- package/skills/playwright/playwright-best-practices/core/fixtures-hooks.md +0 -417
- package/skills/playwright/playwright-best-practices/core/global-setup.md +0 -434
- package/skills/playwright/playwright-best-practices/core/locators.md +0 -242
- package/skills/playwright/playwright-best-practices/core/page-object-model.md +0 -315
- package/skills/playwright/playwright-best-practices/core/projects-dependencies.md +0 -453
- package/skills/playwright/playwright-best-practices/core/test-data.md +0 -492
- package/skills/playwright/playwright-best-practices/core/test-suite-structure.md +0 -361
- package/skills/playwright/playwright-best-practices/core/test-tags.md +0 -298
- package/skills/playwright/playwright-best-practices/debugging/console-errors.md +0 -420
- package/skills/playwright/playwright-best-practices/debugging/debugging.md +0 -504
- package/skills/playwright/playwright-best-practices/debugging/error-testing.md +0 -360
- package/skills/playwright/playwright-best-practices/debugging/flaky-tests.md +0 -496
- package/skills/playwright/playwright-best-practices/frameworks/angular.md +0 -530
- package/skills/playwright/playwright-best-practices/frameworks/nextjs.md +0 -469
- package/skills/playwright/playwright-best-practices/frameworks/react.md +0 -531
- package/skills/playwright/playwright-best-practices/frameworks/vue.md +0 -574
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/ci-cd.md +0 -468
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/docker.md +0 -283
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/github-actions.md +0 -546
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/gitlab.md +0 -397
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/other-providers.md +0 -521
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/parallel-sharding.md +0 -371
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/performance.md +0 -453
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/reporting.md +0 -424
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/test-coverage.md +0 -497
- package/skills/playwright/playwright-best-practices/testing-patterns/accessibility.md +0 -359
- package/skills/playwright/playwright-best-practices/testing-patterns/api-testing.md +0 -719
- package/skills/playwright/playwright-best-practices/testing-patterns/browser-extensions.md +0 -506
- package/skills/playwright/playwright-best-practices/testing-patterns/canvas-webgl.md +0 -493
- package/skills/playwright/playwright-best-practices/testing-patterns/component-testing.md +0 -500
- package/skills/playwright/playwright-best-practices/testing-patterns/drag-drop.md +0 -576
- package/skills/playwright/playwright-best-practices/testing-patterns/electron.md +0 -509
- package/skills/playwright/playwright-best-practices/testing-patterns/file-operations.md +0 -377
- package/skills/playwright/playwright-best-practices/testing-patterns/file-upload-download.md +0 -562
- package/skills/playwright/playwright-best-practices/testing-patterns/forms-validation.md +0 -561
- package/skills/playwright/playwright-best-practices/testing-patterns/graphql-testing.md +0 -331
- package/skills/playwright/playwright-best-practices/testing-patterns/i18n.md +0 -508
- package/skills/playwright/playwright-best-practices/testing-patterns/performance-testing.md +0 -476
- package/skills/playwright/playwright-best-practices/testing-patterns/security-testing.md +0 -430
- package/skills/playwright/playwright-best-practices/testing-patterns/visual-regression.md +0 -634
- package/skills/playwright/playwright-cli/SKILL.md +0 -489
- package/skills/playwright/playwright-cli/references/element-attributes.md +0 -23
- package/skills/playwright/playwright-cli/references/playwright-tests.md +0 -39
- package/skills/playwright/playwright-cli/references/pr-attachments.md +0 -60
- package/skills/playwright/playwright-cli/references/request-mocking.md +0 -87
- package/skills/playwright/playwright-cli/references/running-code.md +0 -245
- package/skills/playwright/playwright-cli/references/session-management.md +0 -227
- package/skills/playwright/playwright-cli/references/storage-state.md +0 -275
- package/skills/playwright/playwright-cli/references/test-generation.md +0 -433
- package/skills/playwright/playwright-cli/references/tracing.md +0 -139
- package/skills/playwright/playwright-cli/references/video-recording.md +0 -216
- package/skills/skills.lock.json +0 -89
- package/skills/skills.yaml +0 -35
- /package/skills/{testomatio/explorbot → explorbot}/explorbot-fundamentals/SKILL.md +0 -0
- /package/skills/{testomatio/explorbot → explorbot}/explorbot-fundamentals/references/no-install.md +0 -0
- /package/skills/{testomatio/explorbot → explorbot}/explorbot-plan/SKILL.md +0 -0
- /package/skills/{testomatio/explorbot → explorbot}/explorbot-setup/SKILL.md +0 -0
- /package/skills/{testomatio/explorbot → explorbot}/prima/SKILL.md +0 -0
- /package/skills/{testomatio/qa-process → qa-process}/qa-lead-strategy-advisor/SKILL.md +0 -0
- /package/skills/{testomatio/qa-process → qa-process}/qa-lead-strategy-advisor/references/output-format.md +0 -0
- /package/skills/{testomatio/qa-process → qa-process}/qa-review-pr/SKILL.md +0 -0
- /package/skills/{testomatio/qa-process → qa-process}/testing-workflow/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/catalog-features/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/catalog-features/references/layout.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/detect-product-mismatches/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/detect-product-mismatches/references/features.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/detect-product-mismatches/references/layout.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/pull-request-diff-analyzer/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-explain-behavior/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-explain-behavior/references/answer-shapes.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-explain-behavior/references/examples.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-pr-requirements-analyzer/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-pr-requirements-analyzer/references/summary-example.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-requirement-reviewer/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-requirement-reviewer/references/requirements_reviewer_examples.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-thinking/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/wiki-from-code/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/wiki-from-code/references/behaviors.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/wiki-from-code/references/layout.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/write-user-story/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/CLAUDE.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/CODECEPTJS_BEST_PRACTICES.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/FINAL_SUMMARY_TEMPLATE.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/PLAYWRIGHT_BEST_PRACTICES.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/POM_BEST_PRACTICES.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/TEST_DATA_MANAGEMENT.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/debug-fix-failed-flaky-autotests/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/debug-fix-failed-flaky-autotests/references/DEBUGGING_QUICK_REFERENCE.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/epic-requirements-specification/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/qa-automation-test-consolidation/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/qa-data-seeder/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/run-tests-with-testomatio-reporter/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/setup-change-aware-pr-testing/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/setup-ci-automation/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/testomat-allure-adapter/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/detect-duplicate-test-cases/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/detect-duplicate-test-cases/references/DUPLICATE_INSTRUCTIONS.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/detect-useless-tests/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/improve-test-cases/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/improve-test-cases/references/TESTOMAT_MARKDOWN_EXAMPLE.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/CSV_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/CUSTOM_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/TESTMO_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/TESTRAIL_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/XRAY_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-e2e-tests-reporting/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_ARTIFACTS.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_HTML_REPORT.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_REPORTERS_CONFIG.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-split-testing-levels-pyramid/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-sprint-report-by-testomatio/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-sprint-report-by-testomatio/references/qa-sprint-report.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-test-code-coverage/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-test-code-coverage/references/COVERAGE_FILE_FORMAT.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-test-code-coverage/references/E2E_FRAMEWORKS.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-test-code-coverage/scripts/check-coverage.mjs +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-write-test-cases/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-write-test-cases/references/test-case-format.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-write-test-cases/references/testomat-tms-guide.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-write-test-cases/references/writing-rule.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/scan-automation-project/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/sync-test-cases-with-tms/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/sync-test-cases-with-tms/references/TESTOMATIO_CLI.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/testomatio-mcp/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/testomatio-mcp/references/MCP_SETUP.md +0 -0
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: debugging-codeceptjs-tests
|
|
3
|
-
description: >
|
|
4
|
-
Use when a CodeceptJS 4 test fails, flakes, or behaves unexpectedly. Trigger
|
|
5
|
-
on run errors and stack traces from `npx codeceptjs run`, intermittent
|
|
6
|
-
failures, locator drift, timing issues, "works locally fails in CI", "why
|
|
7
|
-
does this fail", trace/screenshot/console mentions, and breakpoint /
|
|
8
|
-
step-through / "pause at step N" requests.
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Debugging CodeceptJS 4 Tests
|
|
12
|
-
|
|
13
|
-
Failures lie — the error usually points at a step that's a side effect of something earlier (auth expired, frame switch missed, network call pending). Reproduce, capture state, read it, then fix.
|
|
14
|
-
|
|
15
|
-
## Paths
|
|
16
|
-
|
|
17
|
-
- **MCP-first (AI agents)**: `run_test` / in-test `pause()` yield control to the agent on the same `I` / browser the test uses. Inspect via `run_code` / `snapshot`; step through via `run_step_by_step` + `continue`.
|
|
18
|
-
- **CLI fallback (humans / CI / framework internals)**: `--debug` → `--verbose` → `DEBUG="codeceptjs:*"`. The DEBUG escape hatch is only for framework-internal suspicion: recorder hangs, plugin races, event leaks, "step never ran". Namespaces: `codeceptjs:recorder`, `codeceptjs:pause`, `codeceptjs:ai`, `codeceptjs:plugin:<name>`.
|
|
19
|
-
|
|
20
|
-
`pause()` adapts to who's driving: TTY → readline REPL; MCP → yields control to the agent; non-TTY non-MCP subprocess → prints a notice and resolves (no CI deadlock).
|
|
21
|
-
|
|
22
|
-
## Workflow
|
|
23
|
-
|
|
24
|
-
1. **Fundamentals** — run `codeceptjs-fundamentals`: helper, plugins (`aiTrace`, `screenshot`, `pageInfo`, `retryFailedStep`, `pause`, `auth`), env vars, MCP availability. If `aiTrace` isn't declared, add it once: `plugins: { aiTrace: { enabled: true } }` — most of this skill leans on its output.
|
|
25
|
-
- **Declare once; never edit config to change its trigger.** Override per-run with `-p aiTrace:on=step|fail|test|file|url` (fundamentals § Plugins from CLI). `on=fail` for lean CI repros, `on=step` while diagnosing. Flipping `on:` in config churns the repo and leaks into other runs.
|
|
26
|
-
2. **Reproduce minimally**: `npx codeceptjs run --grep '<scenario>' --steps`. Add `-c codecept.ci.conf.js` if CI-specific. Confirm reproduction before instrumenting.
|
|
27
|
-
3. **Pick tools**:
|
|
28
|
-
- MCP `run_test <test>` — runs in-process; returns reporter result or `{ status: 'paused', pausedAfter, page, suggestions }`
|
|
29
|
-
- MCP `run_step_by_step` + `continue` — pause after every step; for watching the whole flow
|
|
30
|
-
- MCP `run_code` — arbitrary code in the live session; works fresh *and* paused; returns produced values + console output + final-state snapshot
|
|
31
|
-
- MCP `snapshot` — current browser state without acting (URL, cookies, storage, HTML, ARIA, screenshot, console)
|
|
32
|
-
- MCP `list_actions` — sanity-check an `I.*` method exists
|
|
33
|
-
- CLI `npx codeceptjs run --grep '<scenario>' --debug` — first move without MCP; `--verbose` adds promise-queue/retry/timeout logs
|
|
34
|
-
4. **Breakpoint**:
|
|
35
|
-
- In-test `pause()` — best when already editing or breaking inside `within`/loop/hook
|
|
36
|
-
- `pauseAt: N` on `run_test` — no test edit; pauses after the Nth leaf step
|
|
37
|
-
- Find N: `npx codeceptjs dry-run --debug --grep '<scenario>' --numbers --no-ansi` (1-based, per-test; number of the line to stop *after*)
|
|
38
|
-
- While paused: inspect with `run_code`, capture clean state with `snapshot`, walk prior steps in `output/trace_<TestName>_<hash>/trace.md`, release with `continue`
|
|
39
|
-
5. **Read the trace** — hand off to `codeceptjs-run-analysis`; focus on the **first** failed step — late failures are usually side effects of an earlier silent miss. It also covers grepping large HTML, clustering errors across traces, comparing reruns.
|
|
40
|
-
6. **Form a hypothesis**:
|
|
41
|
-
|
|
42
|
-
| Symptom | Likely cause |
|
|
43
|
-
|---|---|
|
|
44
|
-
| Element missing, page is `/login` | Auth: stale session cache, missing env var |
|
|
45
|
-
| Element in HTML but `display: none` | `waitForVisible`, not `waitForElement` |
|
|
46
|
-
| Locator matches 2+ (strict mode) | Scope it: context arg, then ARIA role, then `step.opts({ elementIndex })` |
|
|
47
|
-
| Element present in screenshot N+1, missing in N | Animation / lazy load → `waitForVisible(loc, t)` |
|
|
48
|
-
| 401/403 in console.json | API token expired or env var missing |
|
|
49
|
-
| Steps pass, next `I.see` fails | Frame switch missed → `within({ frame })` |
|
|
50
|
-
| Different result CI vs local | `setHeadlessWhen(CI)`, viewport, timing, env vars |
|
|
51
|
-
| Recorder hangs, step never fires | `DEBUG="codeceptjs:recorder"` |
|
|
52
|
-
| Plugin misbehaves | `DEBUG="codeceptjs:plugin:<name>"` |
|
|
53
|
-
|
|
54
|
-
7. **Verify the fix on the live page** — try the candidate replacement step via `run_code` (works while paused, same `I`) **before editing the file**. Humans at a TTY get the same via in-test `pause()`.
|
|
55
|
-
8. **Apply and re-run**: edit, then `npx codeceptjs run --grep '<scenario>' --steps`; confirm via `codeceptjs-run-analysis` that the failure didn't shift steps. Leave a one-line `Why:` comment when the fix introduces `waitFor*` or `step.opts` — those comments are worth keeping.
|
|
56
|
-
|
|
57
|
-
## Query trace HTML with `codeceptq`
|
|
58
|
-
|
|
59
|
-
`aiTrace` writes per-step `<NNNN>_<step>_page.html` snapshots (one element per line — line numbers map 1:1 to elements). `codeceptq` resolves any CodeceptJS locator against a saved snapshot.
|
|
60
|
-
|
|
61
|
-
- **Never load page HTML into context manually** — snapshots are thousands of lines; `codeceptq` returns only matched elements with their line numbers.
|
|
62
|
-
- Test candidate locators offline before applying via `run_code` — a hit is a green light to try live, not a guarantee (visibility, re-renders).
|
|
63
|
-
- Multiple matches → don't write a brittler XPath; disambiguate with `step.opts({ elementIndex })` following the order `codeceptq` prints.
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
npx codeceptq '#submit-btn' --file output/trace_*/0007_*_page.html # CSS
|
|
67
|
-
npx codeceptq 'Email' --field --file output/trace_*/0003_*_page.html # semantic field
|
|
68
|
-
npx codeceptq 'Save' '.modal' --click --file output/trace_*/0005_*_page.html # scoped clickable
|
|
69
|
-
npx codeceptq 'Username' --field --json --file ... # machine-readable
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Key flags: `--field/--click/--checkable/--select` force semantic strategies; `--xpath`/`--css` override auto-detection (a bare tag name like `select.foo` is treated as fuzzy text); exit codes `0` match / `1` none / `2` invalid input.
|
|
73
|
-
|
|
74
|
-
> ⚠ **The `[context]` second positional does not scope** (CodeceptJS 4.1.0). It prints `N matches within '<ctx>'` but returns page-wide results — `lib/command/query.js` evaluates an absolute XPath (`//…`) against the context node, and `//foo` re-roots at the document. It will report a match inside a container that does not hold the element. To check a scoped locator offline, pass one composed selector (`codeceptq '.modal button[aria-label="Save"]'`) and compare its count against the unscoped form; a context-dependent locator is only truly verified by running the step.
|
|
75
|
-
|
|
76
|
-
## Inspect deeper
|
|
77
|
-
|
|
78
|
-
Hand off to `codeceptjs-exploration` when the trace says *what* failed but you need more page-state detail ("is this button actually disabled?", "are there really two Save buttons?"). Debug-specific reaches:
|
|
79
|
-
|
|
80
|
-
- Button rendered but click had no effect → `grabWebElement('Submit')` + `isEnabled()` + `getBoundingBox()` (disabled? offscreen?)
|
|
81
|
-
- Strict-mode multi-match → exploration's broad-XPath iterate-and-disambiguate pattern
|
|
82
|
-
- Iframe content → wrap failing steps in `within({ frame })`
|
|
83
|
-
|
|
84
|
-
Prefer this over `usePlaywrightTo`/`useWebDriverTo` for inspection — same code across helpers, less boilerplate.
|
|
85
|
-
|
|
86
|
-
## Native helper escape hatch
|
|
87
|
-
|
|
88
|
-
Only when the `I.*` surface truly doesn't cover it (network interception, storage manipulation, helper-only APIs):
|
|
89
|
-
|
|
90
|
-
- Playwright: `I.usePlaywrightTo('label', async ({ browser, browserContext, page }) => { ... })`
|
|
91
|
-
- Puppeteer: `I.usePuppeteerTo('label', async ({ page }) => { ... })`
|
|
92
|
-
- WebDriver: `I.useWebDriverTo('label', async ({ browser }) => { ... })`
|
|
93
|
-
|
|
94
|
-
The label shows up in step output and traces. Works inside MCP `run_code` too. These couple tests to a specific helper — last resort.
|
|
95
|
-
|
|
96
|
-
## Helper gotchas
|
|
97
|
-
|
|
98
|
-
- Playwright: `strict: true` throws on multi-match; prefer `'load'`/`'domcontentloaded'` over `'networkidle'`; `trace: 'on'` → `output/trace.zip` (`npx playwright show-trace`)
|
|
99
|
-
- Puppeteer: `'networkidle0'` hangs on long-polling pages — use `'networkidle2'` or `'domcontentloaded'`
|
|
100
|
-
- WebDriver: `smartWait` covers actions only, not assertions; `executeScript` args must be JSON-serializable
|
|
101
|
-
|
|
102
|
-
## Auth-related failures
|
|
103
|
-
|
|
104
|
-
Redirect to `/login` mid-test or 401/403 in console → fix **auth**, not the failing step: check the plugin's `check`, credential env vars, and stale cached session under `output/<role>_session.json` (delete to force re-login). Full pattern in `codeceptjs-auth`.
|
|
105
|
-
|
|
106
|
-
## Flakiness and waits
|
|
107
|
-
|
|
108
|
-
Most "intermittent" failures are missed waits. Use trace HTML/ARIA to find the actual gating element instead of adding generic delay (fundamentals § Waiting has the mapping). `I.wait(N)` confirms a timing hypothesis while debugging — replace with the specific `waitFor*` before committing.
|
|
109
|
-
|
|
110
|
-
## Things to avoid
|
|
111
|
-
|
|
112
|
-
- Fixing from the error message without reading the trace.
|
|
113
|
-
- Editing the test before verifying the fix via `run_code`.
|
|
114
|
-
- Committing `pause()` calls — debugging tool only.
|
|
115
|
-
- Blind `waitFor*` instead of identifying the real gating element.
|
|
116
|
-
- Leaving `I.wait(N)` in committed tests.
|
|
117
|
-
- Editing `aiTrace`'s `on:` in config between runs — declare once, override per-run.
|
|
118
|
-
- Skipping the config check — `setHeadlessWhen(CI)` / env-driven URLs explain many "works locally fails in CI".
|
|
119
|
-
- Hiding failures with `retries` instead of fixing the cause.
|
|
120
|
-
|
|
121
|
-
## Related skills
|
|
122
|
-
|
|
123
|
-
- `codeceptjs-fundamentals` — effects, plugins-from-CLI, waiting rules
|
|
124
|
-
- `codeceptjs-exploration` — WebElement inspection, broad-XPath disambiguation
|
|
125
|
-
- `codeceptjs-run-analysis` — trace.md walking, error clustering, rerun comparison
|
|
126
|
-
- `codeceptjs-auth` — auth failure patterns
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: lint-codeceptjs-tests
|
|
3
|
-
description: >
|
|
4
|
-
Use when a CodeceptJS 4 suite needs a static quality gate — before committing
|
|
5
|
-
tests, reviewing a PR that touches tests, hardening CI, or on direct asks:
|
|
6
|
-
"lint the tests", "find I.wait / setTimeout sleeps", "leftover .only or
|
|
7
|
-
pause()", "missing await on grab", "passwords printed in logs", "why are
|
|
8
|
-
tests slow/flaky". Runs `@codeceptjs/lint` — an AST-based linter that needs
|
|
9
|
-
no CodeceptJS install and no browser.
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Lint CodeceptJS 4 Tests
|
|
13
|
-
|
|
14
|
-
`@codeceptjs/lint` reads tests, page objects and helpers as an AST and reports the smells that make suites slow, flaky or leaky — fixed sleeps, `if` branching, raw `fetch`, missing `await` on grabbers, plain-text credentials, leftover `.only`/`pause()`. One finding per line; exit codes `0` / `1` (errors found) / `2` (bad input, unparsable file) drop straight into CI.
|
|
15
|
-
|
|
16
|
-
## Commands
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npx @codeceptjs/lint # files from codecept.conf.js in cwd
|
|
20
|
-
npx @codeceptjs/lint tests/ pages/login.js # explicit paths (no config needed)
|
|
21
|
-
npx @codeceptjs/lint -r no-pause -r no-only # only these rules (or --rules a,b)
|
|
22
|
-
npx @codeceptjs/lint rules # list rules + defaults
|
|
23
|
-
npx @codeceptjs/lint --json # file, line, column, rule, level, message, source
|
|
24
|
-
npx @codeceptjs/lint -c e2e/codecept.conf.js # config in another directory
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Without paths it reads `codecept.conf.js|ts|cjs|mjs` and lints everything matched by `tests`, local `include` files (page objects, steps file) and helpers loaded via `require`. TypeScript is parsed with Node's type stripping (Node 22.13+); `enum`/`namespace` report as parse errors. A TS config importing `./x.js` for an `x.ts` file (tsx convention) loads when the project has `tsx` installed.
|
|
28
|
-
|
|
29
|
-
## Rules and the fix for each
|
|
30
|
-
|
|
31
|
-
| Rule | Default | Detects → fix |
|
|
32
|
-
|---|---|---|
|
|
33
|
-
| `no-fixed-wait` | error | `I.wait(5)` → `I.waitForElement` / `I.waitForText` / `I.see` |
|
|
34
|
-
| `no-sleep` | error | bare and `window.`/`globalThis.` `setTimeout`, incl. `await new Promise(r => setTimeout(r, ms))` and `timers/promises`, outside helpers → condition wait |
|
|
35
|
-
| `no-if-in-test` | error | `if` inside a Scenario/hook → `tryTo()` from `codeceptjs/effects` |
|
|
36
|
-
| `no-fetch` | error | `fetch()` (incl. `window.fetch`, `globalThis.fetch`) outside helpers → REST helper `I.sendGetRequest` / `I.sendPostRequest` |
|
|
37
|
-
| `no-console` | warn | `console.*` outside helpers → `I.say()` (lands in the report) |
|
|
38
|
-
| `no-only` | error on CI, warn locally | `Scenario.only`, `Feature.only`, `Data(...).only` → remove before commit |
|
|
39
|
-
| `no-pause` | error on CI, warn locally | `pause()`, `this.pause()` → remove before commit |
|
|
40
|
-
| `no-skip` | warn | `Scenario.skip`, `Feature.skip`, `xScenario`, `xFeature` → intentional? suppress with a comment explaining why |
|
|
41
|
-
| `secret-credentials` | error | credential-ish `process.env.X` / `process.env['X']` or a password/token/secret/api-key locator passed to `I.*` → wrap with `secret()` |
|
|
42
|
-
| `await-grab` | error | `I.grab*()` assigned, destructured or passed without `await` (`await Promise.all([...])` and `.then()` chains are fine) → add `await` |
|
|
43
|
-
| `no-actor-in-helper` | error | `I` inside a class extending `Helper` → `this.helpers['Name']` |
|
|
44
|
-
| `raw-browser-in-test` | warn | `I.use*To`, `I.executeScript` in a Scenario → move into a helper or page object |
|
|
45
|
-
|
|
46
|
-
"On CI" = the `CI` env var is set — local debugging stubs (`pause()`, `.only`) stay warnings so they don't fail the lint while investigating.
|
|
47
|
-
|
|
48
|
-
## Configuring per project
|
|
49
|
-
|
|
50
|
-
Levels live in the config, next to the tests they govern:
|
|
51
|
-
|
|
52
|
-
```js
|
|
53
|
-
export const config = {
|
|
54
|
-
tests: './*_test.js',
|
|
55
|
-
lint: {
|
|
56
|
-
rules: { 'no-if-in-test': 'warn', 'raw-browser-in-test': 'off' },
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Levels: `error`, `warn`, `off`. For a single deliberate case, suppress inline — rule id required, never disable a rule project-wide for one line:
|
|
62
|
-
|
|
63
|
-
```js
|
|
64
|
-
I.wait(1) // codeceptjs-lint-disable-line no-fixed-wait
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Workflow
|
|
68
|
-
|
|
69
|
-
1. Run `npx @codeceptjs/lint` at the project root; if no config loads (secrets, tsx-less TS config), pass paths explicitly.
|
|
70
|
-
2. Fix errors first (they fail CI), warnings by judgment. Triage by cost: sleeps and missing `await` are the flakiness drivers; `secret()` fixes are one-line.
|
|
71
|
-
3. For bulk cleanup, feed `--json` output to drive file-by-file edits — the `source` field holds the offending line (truncated to 120 chars).
|
|
72
|
-
4. Add the gate so it stays clean:
|
|
73
|
-
|
|
74
|
-
```yaml
|
|
75
|
-
# CI, before codeceptjs run
|
|
76
|
-
- run: npx @codeceptjs/lint
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
For agent-driven work, a Claude Code `PreToolUse` hook blocks edits that *add* a new error (pre-existing errors and warnings never block; a failing hook allows the edit):
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{
|
|
83
|
-
"hooks": {
|
|
84
|
-
"PreToolUse": [
|
|
85
|
-
{ "matcher": "Write|Edit|MultiEdit", "hooks": [{ "type": "command", "command": "npx @codeceptjs/lint --hook claude" }] }
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Things to avoid
|
|
92
|
-
|
|
93
|
-
- "Fixing" `await-grab` by deleting the `await` usage — the grab result is a promise, the fix is `await`, not removal.
|
|
94
|
-
- Replacing `I.wait` with a longer `I.wait`.
|
|
95
|
-
- Suppressing `no-if-in-test` when the branch is load-bearing — that's `tryTo()` or a helper's job.
|
|
96
|
-
- Adding the CI step before triaging existing findings — the suite goes red on day one.
|
|
97
|
-
- Skipping the hook's config scope check — it only lints files the config covers.
|
|
98
|
-
|
|
99
|
-
## Related skills
|
|
100
|
-
|
|
101
|
-
- `debugging-codeceptjs-tests` — `I.wait(N)` as a timing probe is fine mid-debug, lint-clean it before committing
|
|
102
|
-
- `refactoring-codeceptjs-tests` — bulk cleanup of a lint-red suite (extract helpers, tame locators)
|
|
103
|
-
- `writing-codeceptjs-tests` — write clean tests from the start
|
|
104
|
-
- `ci-fix-tests` — run the lint gate first so CI fixes don't reintroduce smells
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: migrate-codeceptjs-4
|
|
3
|
-
description: "Migrate a CodeceptJS 3.x project to 4.x. Trigger when `package.json` pins `codeceptjs` at 3.x or is missing `\"type\": \"module\"`, when test files still use CommonJS (`require()` / `module.exports`) against CodeceptJS APIs, when config references removed helpers (`Nightmare`, `Protractor`, `TestCafe`, `AI`, `SoftExpectHelper`, `Mochawesome`) or removed plugins (`autoLogin`, `tryTo`, `retryTo`, `eachElement`, `commentStep`, `fakerTransform`, `enhancedRetryFailedStep`, `allure`, `htmlReporter`, `wdio`, `selenoid`, `screenshotOnFail`, `pauseOnFail`, `stepByStepReport`), or when 3.x APIs are in use (`ai.request` function, Joi schemas in `seeResponseMatchesJsonSchema`, `restart: 'browser'`, `I.retry()`, `I.limitTime()`, Playwright `customLocators`)."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Migrate CodeceptJS 3.x → 4.x
|
|
7
|
-
|
|
8
|
-
CodeceptJS 4 is **ESM-only and TypeScript-first**. There is no compatibility shim for CommonJS — every helper, page object, custom step, and config file must be ESM. This skill drives a project through the upgrade end-to-end.
|
|
9
|
-
|
|
10
|
-
The authoritative reference is `node_modules/codeceptjs/docs/migration-4.md` (after `npm install codeceptjs@4`). Read it once; this skill orchestrates the work and surfaces the parts agents miss.
|
|
11
|
-
|
|
12
|
-
## When to trigger
|
|
13
|
-
|
|
14
|
-
Detect *before* acting. Look for any of:
|
|
15
|
-
|
|
16
|
-
- `package.json` lists `"codeceptjs": "^3"` / `"3.x"`, or has no `"type": "module"`.
|
|
17
|
-
- Tests, page objects, helpers, or config use `require()` / `module.exports` against CodeceptJS.
|
|
18
|
-
- Config still references removed helpers (`Nightmare`, `Protractor`, `TestCafe`, `AI`, `SoftExpectHelper`, `Mochawesome`) or removed plugins (`autoLogin`, `tryTo`, `retryTo`, `eachElement`, `commentStep`, `fakerTransform`, `enhancedRetryFailedStep`, `allure`, `htmlReporter`, `wdio`, `selenoid`, `screenshotOnFail`, `pauseOnFail`, `stepByStepReport`).
|
|
19
|
-
- 3.x APIs: `ai.request`, Joi schemas in `seeResponseMatchesJsonSchema`, `restart: 'browser'`, `I.retry()`, `I.limitTime()`, Playwright `customLocators`, `I.softExpect*` / `I.flushSoftAssertions`.
|
|
20
|
-
- `--reporter mochawesome` in scripts/CI, or `mochawesome` in `package.json` / `mocha.reporterOptions`.
|
|
21
|
-
|
|
22
|
-
If none of these hint at 3.x, the project is likely on 4.x already — hand back to `codeceptjs-fundamentals`.
|
|
23
|
-
|
|
24
|
-
## Workflow
|
|
25
|
-
|
|
26
|
-
Phases run in order. Commit at each boundary so any regression is bisectable.
|
|
27
|
-
|
|
28
|
-
### 1. Bump Node and CodeceptJS
|
|
29
|
-
|
|
30
|
-
- Confirm Node ≥ 16 (recommended 20+); update `engines.node` and CI runners.
|
|
31
|
-
- `npm install codeceptjs@4`.
|
|
32
|
-
- TypeScript projects: `npm install --save-dev tsx`. Replaces `ts-node/esm`, which now warns.
|
|
33
|
-
|
|
34
|
-
### 2. Convert the project to ESM
|
|
35
|
-
|
|
36
|
-
- Add `"type": "module"` to `package.json`. **Without this, every `.js` file parses as CommonJS and ESM imports throw at load time.**
|
|
37
|
-
- Convert config, page objects, custom helpers, custom steps, programmatic usage:
|
|
38
|
-
- `const Helper = require('@codeceptjs/helper')` → `import Helper from '@codeceptjs/helper'`
|
|
39
|
-
- `module.exports = X` → `export default X` (or named exports)
|
|
40
|
-
- `const { codecept, container, event } = require('codeceptjs')` → `import codeceptjs, { container, event } from 'codeceptjs'`
|
|
41
|
-
- `Container.create()` and `Config.load()` are now async — `await` them.
|
|
42
|
-
- Files that genuinely need CJS (rare; usually third-party shims): rename to `.cjs`.
|
|
43
|
-
|
|
44
|
-
### 3. Remove or replace deleted helpers and plugins
|
|
45
|
-
|
|
46
|
-
| Old | Replacement |
|
|
47
|
-
|---|---|
|
|
48
|
-
| Helper `Nightmare` / `Protractor` / `TestCafe` | `Playwright`, `Puppeteer`, or `WebDriver`. |
|
|
49
|
-
| Helper `AI` | Top-level `ai:` config + `aiTrace` plugin. |
|
|
50
|
-
| Helper `SoftExpectHelper` | `import { hopeThat } from 'codeceptjs/effects'`; call `hopeThat.noErrors()` at end of scenario. |
|
|
51
|
-
| Helper `Mochawesome` | **Stop and ask the user** — see "Mochawesome decision" below. Do not silently delete it. |
|
|
52
|
-
| Plugin `autoLogin` | `auth` plugin (see the `codeceptjs-auth` skill). |
|
|
53
|
-
| Plugin `tryTo` / `retryTo` | `import { tryTo, retryTo } from 'codeceptjs/effects'` |
|
|
54
|
-
| Plugin `eachElement` | `import { eachElement } from 'codeceptjs/els'` |
|
|
55
|
-
| Plugin `commentStep` | `import step from 'codeceptjs/steps'` → `step.section('name')` / `step.endSection()` |
|
|
56
|
-
| Plugin `fakerTransform` | `import { faker } from '@faker-js/faker'` directly in tests. |
|
|
57
|
-
| Plugin `enhancedRetryFailedStep` | Renamed to `retryFailedStep`. |
|
|
58
|
-
| Plugin `allure` / `htmlReporter` | `@testomatio/reporter` (HTML pipe). For JUnit XML, the `junitReporter` plugin. |
|
|
59
|
-
| Plugin `wdio` / `selenoid` | Configure via `helpers.WebDriver`, or run externally. |
|
|
60
|
-
| Plugin `screenshotOnFail` / `pauseOnFail` / `stepByStepReport` | Renamed `screenshot` / `pause` / `screenshot` with `slides: true`. Old names still resolve but emit a deprecation warning. |
|
|
61
|
-
|
|
62
|
-
#### Mochawesome decision
|
|
63
|
-
|
|
64
|
-
The bundled `Mochawesome` **helper** is removed in 4.x (the helper class, the `mochawesome` dependency, and the worker report-dir wiring). The `mochawesome` **reporter** itself still works — it is a stock Mocha reporter and never needed CodeceptJS to bundle it.
|
|
65
|
-
|
|
66
|
-
This is a **user choice — do not pick for them**. When you detect Mochawesome (the helper in `helpers:`, `--reporter mochawesome`, or `mochawesome` in `package.json`/`mocha.reporterOptions`), stop and ask which path they want:
|
|
67
|
-
|
|
68
|
-
1. **Switch to `@testomatio/reporter` (recommended).** Richer HTML report (steps, screenshots, videos, traces), worker-safe, no helper or internal coupling. `npm install --save-dev @testomatio/reporter`, enable the `testomatio` plugin, run with `TESTOMATIO_DISABLE_UPLOAD=1`. For JUnit XML add the `junitReporter` plugin. This is the path to recommend.
|
|
69
|
-
2. **Keep Mochawesome — report only.** Remove the `Mochawesome` helper from `helpers:`, keep `npm i -D mochawesome` and `--reporter mochawesome --reporter-options reportDir=output`. Loses the auto-embedded failure screenshots the helper provided.
|
|
70
|
-
3. **Keep Mochawesome — with embedded screenshots.** Remove the helper from `helpers:` and re-create it as a **project-local custom helper** that wraps `mochawesome/addContext` (a faithful port is in the migration guide, section "Keeping Mochawesome"). Flag the two caveats: it imports non-semver-stable `codeceptjs/lib/*` internals (pin the version), and the screenshot-plugin filename sync is no longer automatic (set `uniqueScreenshotNames` identically on the helper and the `screenshot` plugin).
|
|
71
|
-
|
|
72
|
-
In all cases also: remove `mochawesome` report-dir handling from any custom worker scripts, and replace any reliance on `I.addMochawesomeContext()` (only option 3 keeps it).
|
|
73
|
-
|
|
74
|
-
Present options 1–3 explicitly and let the user decide before changing anything. Default the recommendation to option 1. The full reference (before/after configs + the custom-helper port) is in `node_modules/codeceptjs/docs/migration-4.md` → "Mochawesome → Testomat.io Reporter".
|
|
75
|
-
|
|
76
|
-
### 4. Update changed APIs
|
|
77
|
-
|
|
78
|
-
- **AI config** — delete the `request` function. Install Vercel AI SDK + provider (`npm install ai @ai-sdk/openai`) and set `ai: { model: openai('gpt-5') }`. Same shape for `@ai-sdk/anthropic`, `@ai-sdk/google`, etc.
|
|
79
|
-
- **JSON schemas** — `I.seeResponseMatchesJsonSchema()` now uses Zod, not Joi. Rewrite (`Joi.object().keys({...})` → `z.object({...})`, `Joi.string().required()` → `z.string()`, etc.) and `npm uninstall joi`.
|
|
80
|
-
- **Playwright** — replace `restart: 'browser'` with `'session'` (default), `'context'`, or `'keep'`. Drop `customLocators` config; use the `customLocator` plugin or ARIA locators (`{ role: 'button', name: 'Submit' }`).
|
|
81
|
-
- **`I.retry()` / `I.limitTime()`** — **removed** (not just deprecated). Replace with the step options API: `import step from 'codeceptjs/steps'`, then pass the config as the **last argument** of the step. `I.retry(3).click('Submit')` → `I.click('Submit', step.retry(3))`; `I.limitTime(10).fillField('Email', x)` → `I.fillField('Email', x, step.timeout(10))`. Also `step.opts({ elementIndex: 2 })`. Behavior is unchanged except the option no longer leaks onto the following step. `recorder.retry()` is unaffected (custom helpers only).
|
|
82
|
-
- **`within` and `session`** — no longer global. `import { within, session } from 'codeceptjs'` (or `within` from `codeceptjs/effects`). Both return Promises — `await` when you need the return value.
|
|
83
|
-
- **Subpath imports** — `codeceptjs/effects`, `codeceptjs/els`, `codeceptjs/steps`, `codeceptjs/store`, `codeceptjs/assertions`. See the migration guide for the full list.
|
|
84
|
-
- **`tryTo` / `hopeThat`** — return `Promise<boolean>` (the 3.x `Promise<T | false>` shape is gone).
|
|
85
|
-
|
|
86
|
-
### 5. Adopt `noGlobals: true`
|
|
87
|
-
|
|
88
|
-
3.x leaked `Helper`, `actor`, `inject`, `share`, `secret`, `locate`, `dataTable`, `within`, `session`, `codecept_dir`, `output_dir` as globals. 4.x defaults `noGlobals: true` in new configs and warns for projects without it. Add it to config and replace globals with explicit imports from `codeceptjs` / `@codeceptjs/helper`. Test-runner globals (`Feature`, `Scenario`, `Before`, `After`, `BeforeSuite`, `AfterSuite`, `pause`, `inject`, `share`) and BDD step-definition globals (`Given`, `When`, `Then`, `And`) **stay** — they're scope-injected by the runner.
|
|
89
|
-
|
|
90
|
-
### 6. Bump dependent packages
|
|
91
|
-
|
|
92
|
-
If your project depends directly on these, verify nothing breaks: `chai` (4 → 6, ESM-only), `chai-as-promised` (7 → 8), `commander` (11 → 14), `@faker-js/faker` (9 → 10), `chokidar` (4 → 5), `@cucumber/gherkin` (35 → 38), `webdriverio` (9.12 → 9.23). `joi` and `testcafe` are removed. See migration guide §7 for the full table.
|
|
93
|
-
|
|
94
|
-
### 7. Verify
|
|
95
|
-
|
|
96
|
-
Run, in order:
|
|
97
|
-
|
|
98
|
-
1. `npx codeceptjs check -c <config>` — surfaces config / helper / plugin / page object issues without spinning up a browser.
|
|
99
|
-
2. `npx codeceptjs run --debug` on a small smoke scenario. Confirm steps execute and the report is sane.
|
|
100
|
-
3. `npx codeceptjs run-workers 2` — confirms the worker event dispatcher fires per-test events the same way it does in single-process mode (4.x change).
|
|
101
|
-
4. TypeScript users: confirm error stack traces point at `.ts` source lines (proves `tsx` is loaded, not `ts-node/esm`).
|
|
102
|
-
5. Grep the repo for `tryTo(`, `retryTo(`, `eachElement(`, `commentStep(`, `softExpect`, `I.softExpect`, `Joi.`, `restart: 'browser'`, `I.retry(`, `I.limitTime(`, and (unless the user chose to keep it) `Mochawesome` / `--reporter mochawesome` — none should remain. `step.retry(` / `step.timeout(` passed as a step argument is the expected replacement, not a leftover.
|
|
103
|
-
6. If the project used `autoLogin`: confirm the `auth` plugin restores sessions and roles.
|
|
104
|
-
|
|
105
|
-
## Related skills
|
|
106
|
-
|
|
107
|
-
- `codeceptjs-auth` — replacement for the removed `autoLogin` plugin
|
|
108
|
-
- `codeceptjs-fundamentals` — run **after** migration to confirm wiring
|
|
109
|
-
- Full reference: `node_modules/codeceptjs/docs/migration-4.md`
|