Skip to main content

Generate Your First Tests

With requirements on the Project Data tab, TestFlair's AI builds your test suite one layer at a time: user stories, then test cases, then executable scripts. You review each layer before generating the next.

  • Who can generate Project Admin, QA Manager and Business Analyst for user stories; Project Admin, QA Manager and Tester for test cases and scripts. See Roles & Permissions
  • Costs Confirmations show an estimate of 1 Flair per user story and per test case generated. Script generation shows its estimated cost in the dialog before you confirm
  • Takes A minute or two per step for a typical BRD
  1. Add requirements
  2. AIGenerate user stories
  3. Review stories
  4. AIGenerate test cases
  5. Review test cases
  6. AIGenerate test scripts
  7. Run a script
  8. TestFlairExecute in a browser
  9. Read the result
You review every layer before the next one is generated from it.
Trying it on the sample?

On Sample: Online Shop, the Explore TestFlair checklist links you straight to each of these steps.

Step 1: Generate user stories​

  1. Open the project's Project Data tab.
  2. Click Generate User Stories (top right).
  3. The confirmation lists the Business requirements it will use and the estimated cost: 1 Flair per user story generated. Click Generate user stories.

Stories are written in the project's Generation Language and follow the familiar shape:

As a [user type], I want [action] so that [benefit]

Generate User Stories on the Project Data tab

Generate User Stories is greyed out when:

  • There are no requirements yet — add a file or text first.
  • Every requirement has already been used — add or edit requirements to generate new stories.
  • A user story generation is already running in this project.
  • Files are ticked in the list — then the selection bar's Generate user stories button generates from just those files. See Project Data.

Step 2: Generate test cases​

  1. Open the User Stories tab and review the stories. Edit or delete any that miss the mark.
  2. Generate test cases:
    • For every story — click Generate test cases (top right).
    • For some stories — tick them and click Generate test cases in the selection bar at the bottom. The top button is disabled while stories are ticked.
    • For one story — use the generate icon on its row.
  3. Confirm. The confirmation estimates 1 Flair per generated test case.

Generate test cases from the User Stories list

Each test case has a title, preconditions, numbered steps with expected results, and a link to its user story. See Test Cases.

Step 3: Generate test scripts​

  1. Open the Test Cases tab and review the cases.
  2. Tick the cases you want scripted and click Generate test scripts in the selection bar — or use the generate icon on one case's row.
  3. In How would you like to generate your script?, choose the language (Java) and the framework (Selenium or Playwright). The dialog shows the estimated Flairs and your balance.
  4. Click Generate Test Script.

Choosing the language and framework for a script

See Test Scripts for what the generator produces and how to edit it.

Follow progress while you work​

Generation runs in the background, so you can keep working or move to another page. A progress card in the bottom-right corner tracks every job in the current workspace:

You seeMeaning
In Progress... with 2/3Two of three jobs have finished
Generating user stories…, Executing …Still running
User stories ready, Execution passedDone — click the row to open the result
… finished with errorsSome items were generated, some failed
… generation failed, Execution failedNothing was produced — click × on the row to dismiss it

Finished jobs stay listed while any other job is still running. Once everything has finished, the card clears itself a few seconds later. Jobs from your other workspaces never appear here — switch workspace to see them.

Step 4: Run your first test​

  1. Open the Test Scripts tab.
  2. On a script whose generation has finished, click the run button (its tooltip reads Execute test script, or Re-run once it has run before). To run several, tick them and click Run in the selection bar.
  3. Execution Preferences Settings shows the setting the run will use. Keep it, or pick a saved one, then click Run.

The script runs against the test case's URL — the project's base URL unless the case has its own. Follow it live from the script's page.

info

Testing an application that runs locally or behind a firewall? Set up a tunnel first — see Test Execution.

Step 5: Review the result​

While it runs, the script shows Running.... When it finishes, it shows Execution completed or Execution failed, and the progress card shows Execution passed or Execution failed. Open the script to see the logs, step screenshots and the recording.

A failed run can generate bug suggestions for you to review and file — see Bugs.

What's next​

  • Test Runs — Run many test cases together and compare sessions
  • Dashboard — Track test case status and executions across projects
  • User Stories and Test Cases — Editing, filtering and bulk actions
  • Bugs — Track and manage the bugs your tests find