This page outlines how the Launchable CLI interfaces with the Cypress CLI.
After running tests, point the CLI to your test report files to collect test results and train the model:
launchable record tests --build <BUILD NAME> cypress ./report/*.xml
The high level flow for subsetting is:
- 1.Get the full list of tests/test paths and pass that to
launchable subsetwith an optimization target for the subset
launchable subsetwill get a subset from the Launchable platform and output that list to a text file
- 3.Pass the text file into your test runner to run only those tests
To retrieve a subset of tests, first list all the tests you would normally run and pass that to
find ./cypress/integration -type f | launchable subset \
--build <BUILD NAME> \
--confidence <TARGET> \
cypress > launchable-subset.txt
--buildshould use the same
<BUILD NAME>value that you used before in
launchable record build.
This creates a file called
launchable-subset.txtthat you can pass into your command to run tests:
cypress run --spec "$(cat launchable-subset.txt)" --reporter junit --reporter-options "mochaFile=report/test-output-[hash].xml"