This repo is a reference implementation of Captain consuming TestCafe results.
| Path | What it is |
|---|---|
tests/ |
Two TestCafe fixture files (example-one.testcafe.js, example-two.testcafe.js) with 6 tests total. |
local-page/ |
A vendored snapshot of TestCafe's public example page and its CSS/JS assets. Tests load this via file:// so the suite has no external dependencies. Two minimal patches are applied — see Local page patches. |
bin/run-testcafe |
Wrapper that invokes the testcafe/testcafe Docker image with --network none and writes a JSON report to tmp/testcafe.json. |
.captain/config.yaml |
Tells Captain to invoke ./bin/run-testcafe and read results from tmp/testcafe.json. |
.github/workflows/ci.yml |
Runs captain run captain-examples-testcafe on every push and PR. |
./bin/run-testcafeYou'll see the standard TestCafe spec reporter output, and tmp/testcafe.json
will be populated with the machine-readable report Captain consumes.
To exercise the full Captain integration locally (quarantine logic, retries, flake detection, upload to Captain Cloud), install the Captain CLI and run:
captain run captain-examples-testcafeIf you want to upload results to your Captain Cloud organization, also export
RWX_ACCESS_TOKEN (more documentation here).
Without the token, Captain runs in OSS mode — local-only, no upload.
The included GitHub Actions workflow does the same thing in CI. The runner already has Docker available, so the steps reduce to:
- uses: actions/checkout@v3
- uses: rwx-research/setup-captain@v1
- name: Run TestCafe
run: captain run captain-examples-testcafe
env:
RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}Add an RWX_ACCESS_TOKEN action secret to your repository to enable Captain
Cloud uploads.
See the full documentation on test suite integration for the broader feature set.
local-page/ is a near-verbatim mirror of the upstream example page.
Two patches were applied so the page works under file:// URLs:
local-page/example/index.html— the upstream submit handler concatenateswindow.location.href + "thank-you.html", which produces a broken URL whenhrefends inindex.htmlinstead of a directory. Replaced with a trailing-segment substitution that works under bothfile://andhttp://. The favicon link (an absolute/testcafe/favicon.icopath) is removed because it has no offline analogue.local-page/example/thank-you.html— the upstream page loads jQuery from thecode.jquery.comCDN. Pointed at the already-vendored jQuery 1.12.4 instead. Favicon removed for the same reason as above.
Both patches are marked with Local patch: comments in the HTML.