Test Generation with TestDriver
Simplify test creation with AI-driven exploratory testing.
Writing tests can be a tedious and time-consuming task. TestDriver can generate tests just by exploring your app! This guide will show you how to generate tests using TestDriver.
Generate exploratory tests
Launch testdriverai
in interactive mode with the following command:
TestDriver will boot up.
Ensure your website or app is visible on your test runner’s display.
Then, run the generate
command.
This will generate 10 tests within the testdriver/generate
directory. You can change the number of tests generated by changing the number after 10
. The generated tests will be in the form of a .yaml
file, and you can run them using your test runner of choice (local or cloud hosted).
Now your directory structure will look like this:
Notice that each test file has no commands! It’s only a list of prompts. This is similar to an exploratory test.
Generate regression tests from exploratory tests
Now it’s time to generate the regression test.
Run the tests with the run
command and use the --save
parameter:
When a test has no commands
, TestDriver falls back to the prompt
.
When using the --save
command, TestDriver appends any generated commands to the test file.
So as your test run, TestDriver will append successful commands to the YAML file and save it.
.yaml
file extension for all test files. This is a breaking change from v4 which uses the .yml
extension!Now the next time you run the test, TestDriver will use the commands instead of the prompt!