Skip to main content

Test Cases

A test case is one scenario that checks your application behaves as expected: what must be true first, the steps to take, and the result to expect. TestFlair generates test cases from your user stories, and you can also write them by hand or import the ones you already have.

  • Where Project → Test Cases tab
  • Who can create and edit Project Admin, QA Manager, Tester (plus workspace Owners and Coordinators). Everyone with access to the project can read test cases.
  • Costs Generation shows an estimate of 1 Flair per generated test case before it starts. Writing, editing and running are free.
  • Language English, or Modern Standard Arabic when the project is set to Arabic

What it starts from

User story
Runs firstPrecondition test case
Test data

Test case

Test casesteps and expected result

What it becomes

Test script
ResultRun result
A test case covers a user story, may start after another test case, and becomes an executable script.

Generating test cases​

Test cases are generated from user stories.

  • From the User Stories tab: click Generate test cases to generate for all stories, tick stories and use Generate test cases in the selection bar, or use the generate icon on a single story's row.
  • From the Test Cases tab: when the project has no test cases yet, click Generate test cases. If there are no user stories either, TestFlair first asks for your requirements so it can generate the stories.

The confirmation shows how many user stories will be used and the cost estimate. Click Generate test cases. Generation runs in the background; a progress indicator shows while it works.

Generation also fills in realistic test data for the steps that need it. Test cases are written in the project's Generation Language. See Generation Language.

If a story already has test cases, TestFlair asks before replacing them (Overwrite existing output?). If you delete all of a story's test cases, you can generate them again for that story.

What a test case contains​

FieldRequiredNotes
TitleYesWhat the test verifies
DescriptionYes
Pre ConditionYesWhat must be true first: written as text, or linked to other test cases (see Preconditions)
User StoryNoThe story this test case covers
URLNoThe page the test starts on. Needed before you can generate a test script.
Test StepsYesNumbered actions, each with optional test data
Expected ResultYesThe outcome that means the test passed

Every test case also has an ID (for example TC-12), a type and a status, shown as pills next to its title.

Type​

TypeColourVerifies
PositivegreenThe expected, happy-path behaviour
NegativeredError handling and invalid input
EdgegrayBoundaries and corner cases

New test cases default to Positive. Change the type from the pill in the drawer (in create or edit mode) or from the TYPE column. The type guides how TestFlair writes the test script.

Steps and expected result​

Each step is one action, such as Enter the registered email in the Email field. The Expected Result describes the outcome of the whole test case. Use the data button on a step to attach the values it types; see Test Data.

Example​

TC-1: Verify password reset with a valid email

Pre Condition: The user has a registered account with [email protected].

Test Steps:

  1. Open the login page
  2. Click the "Forgot Password" link
  3. Enter [email protected] in the email field
  4. Click "Send Reset Link"

Expected Result: A message confirms that a reset email has been sent.

Preconditions​

Many tests only make sense after something else has happened: you can't check out without logging in and filling a cart. Instead of repeating those steps in every test case, link the test cases that set the scene as preconditions.

Beta feature

Linking test cases as preconditions is a Beta feature and may not be visible on every account. Contact your workspace admin or [email protected] if you'd like access. Without it, Pre Condition is a text field.

TC-1Log in
TC-4Add item to cart
TC-9Pay by card
TC-9 links TC-4 as its precondition. TC-4 links TC-1, so TC-9's chain is TC-1 → TC-4 → TC-9.

How chains work​

  • A test case has one direct precondition. To start after several test cases, link them to each other in order and link the last one. That keeps every chain a single line, so a script always runs in the state it was generated in.
  • The precondition's own chain comes with it. In the example, TC-9 lists TC-1 and TC-4. Only TC-4 is TC-9's own link; TC-1 belongs to TC-4's chain and can only be changed on TC-4.
  • A chain can be up to 10 levels deep, and links can't form a loop: a test case can't be the precondition of a test case it depends on.
  • Preconditions stay inside one project.

Linking a precondition​

  1. Open the test case in create or edit mode.
  2. In the Pre Condition section, choose TCs in the toggle (the other option, Text, holds a written precondition).
  3. Click Add Pre Condition (or Change Pre Condition to replace the current one).
  4. In Select TCs Dependencies, search by ID or name, pick a test case and click Add selected. Use the eye icon on any card to preview a test case first.
  5. Click Save. The link is saved with the test case.

The section lists the whole chain under TCs Dependencies, in the order it runs. Use the bin icon on your direct link to remove it, and the eye icon to preview any test case in the chain.

Which test cases can be linked​

A precondition is replayed, not re-explored, so it needs a usable script. In the picker, test cases that can't be linked are greyed out with a tag; hover it to see why:

TagMeaningWhat to do
No script generatedThe test case has no test script yetGenerate its script
Not readyIts last script generation didn't pass every step, its recording can't be replayed or failed a replay, test data it uses was deleted, its script is still generating, failed or isn't Java, or it was edited after its script was generatedRegenerate its script (in Java)
Depends on this oneIt already starts after the test case you're editingPick another test case: linking it would create a loop

A test case in the chain that becomes not ready later shows an orange info icon with the reason.

What preconditions change​

Script generation. When you generate a script for a test case with preconditions, TestFlair first replays its preconditions' recorded steps in the browser, then the AI explores only this test case's own steps. Its script holds only its own code. A script can be generated only once every precondition in its chain is ready, and precondition chains run on Java scripts; if you pick another framework for a test case others depend on, the script picker warns you that its dependents will be blocked until they're regenerated with that framework too.

Running. When a test case with preconditions runs, the current scripts of its preconditions run first, in the same browser, followed by its own steps. Regenerating a precondition's script reaches every dependent at its next run, with nothing else to update. The same happens when you export the script.

Status. If a precondition fails, every test case that depends on it, at any depth, becomes Blocked. When the precondition passes again, those test cases go back to Not Executed. In a test run, a test case whose precondition already failed in that run is not executed; its result reads Precondition failed.

History. The test case's activity feed records when a precondition affected it, and when a change to it affected its dependents. See Collaboration.

  1. YouRun TC-9
  2. PreconditionTC-1 code
  3. passes
    PreconditionTC-4 code
  4. passes
    TC-9's own steps
  5. Pass
    ResultPassed
    Fail
    ResultFailed
    TC-1 or TC-4 fails
    BlockedPrecondition failed; own steps don't run
One run of a dependent: preconditions first, in the same browser.

Test case statuses​

StatusMeaning
Not ExecutedNot run yet, or a precondition that blocked it has passed again
In ProgressRunning now
PassedThe last run passed
FailedThe last run failed
BlockedA precondition failed, or someone marked it Blocked
Not Executed
In Progressrun starts
Passedrun passes
Failedrun fails
Blockedprecondition fails
  • Not Executed→Blockeda precondition fails
  • Blocked→Not Executedthe precondition passes
  • Passed→In Progressrun again
  • Failed→In Progressrun again
Runs move a test case through its statuses; preconditions can block and release it. Running a Passed or Failed test case again takes it back to In Progress.

You can also set a status by hand, from the status pill in the drawer (create or edit mode) or from the STATUS column. A test case you mark Blocked yourself stays blocked until you change it: a recovering precondition doesn't release it.

Finding test cases​

The Test Cases list with status tabs

  • Search test cases... matches a test case's ID or title as you type.
  • Status tabs under the search bar (All, Not Executed, In Progress, Passed, Failed, Blocked) show a live count and filter with one click.
  • The filter icon in the search bar opens filters for Status, Source (Ai generated, Manual, Imported, and Jira when the project is connected to Jira) and Features, where you pick user stories grouped by feature.

Opening a test case​

A test case open in its drawer

Click a row to open the test case in a drawer. It has three tabs:

  • Details: the test case's fields.
  • Linked bugs: bugs linked to this test case. Create a new bug or Link an existing one. See Bugs.
  • Properties: who created it and when, its source, its assignee and last edit, and its Connections: the user story it Covers, the test script it's Implemented by, and the latest run it was Executed by. Click a connection to open it.

From the drawer footer you can Edit it, click Generate Test Script, or use the … menu to Export or Delete it. Generate Test Script stays disabled until the test case has a URL.

To work in more space, click the maximize icon in the drawer header. The test case opens as a full page in the same mode (view, edit or create); unsaved changes, including bugs you've queued for a new test case, come with you.

On the full page, a line under the title shows who created the test case, when it was last edited, the user story it covers (click the code to open the story), its source and a View properties link.

To ask the AI assistant about a test case or have it edit the test case, use the assistant button in the drawer header. See TestFlair AI.

note

While a test case's script is generating, you can't edit, delete or regenerate it. Hover the disabled button for the reason.

Creating a test case by hand​

  1. Click Create test case.
  2. Enter the Title and Description.
  3. Add the Pre Condition: text, or a linked test case.
  4. Optionally pick the User Story and enter the URL.
  5. Add the Test Steps (Add test step adds another) and their test data.
  6. Enter the Expected Result, set the type and status pills, and click Save.

Importing existing test cases​

Already have test cases in a spreadsheet or document? Use … → Import to have TestFlair extract them as written, review them, and add the ones you want. See Test Case Import.

Working with several test cases​

The selection bar after ticking a test case

Tick test cases to show the selection bar:

ActionWhat it does
Generate test scriptsOpens the script generator for the selected test cases
Add URLSets one URL on every selected test case
ExportDownloads the selected test cases as a spreadsheet
DeleteDeletes the selected test cases

The … menu at the top of the page offers Export, Import and Delete for the whole list; it's disabled while rows are ticked.

Troubleshooting​

Not enough test cases, or missing scenarios

  • Add detail to the user story and its acceptance criteria, then generate again.
  • Add the missing scenarios by hand.

Generate Test Script is disabled

  • Add a URL to the test case. If its script is already generating, wait for it to finish.

A test case is Blocked and you didn't block it

  • One of its preconditions failed. Open the test case's precondition chain to find it, fix and rerun that test case; its dependents return to Not Executed when it passes.

A test case can't be picked as a precondition

Next Steps​