This guide demonstrates how to convert user stories from CSV files into individual TestDriver test files using Node.js. Each user story will be saved as its own YAML test file, and the tests will be executed in parallel using a GitHub Actions workflow.Documentation Index
Fetch the complete documentation index at: https://docs.testdriver.ai/llms.txt
Use this file to discover all available pages before exploring further.
Workflow overview
- Export User Stories: Extract user stories from TestRail, CSV, or Jira.
- Convert to Test Files: Use a Node.js script to generate individual YAML test files for each user story.
- Run Tests: Use a CI/CD workflow to execute the tests in parallel with the TestDriver CLI.
Step 1: Export user stories
Export user stories from your source (TestRail, CSV, or Jira) and save them in a structured format (for example, JSON or CSV). For example:Example CSV file (user_stories.csv):
| User Story ID | User Story Title | Description |
|---|---|---|
| 1 | Log in to the application | User logs in with valid credentials. |
| 2 | Search for a product | User searches for a product by name. |
| 3 | Add product to cart | User adds a product to the cart. |
Step 2: Node.js script to convert user stories into test files
Create a Node.js script to read the exported data and generate individual YAML test files for each user story.Install required dependencies
Node.js script (generate-tests.js)
Run the script
test_1.yaml, test_2.yaml) in the testdriver/ directory.
Step 3: CI/CD workflow to run tests in parallel
Create a CI/CD workflow to execute the generated test files in parallel using the TestDriver CLI. Below is a generalized example for any CI/CD system (adapt for your platform):.github/workflows/testdriver.yaml
Step 4: Secure API key
Store your TestDriver API key as a GitHub secret (for example,TD_API_KEY) to securely authenticate your tests.
Step 5: Commit and push
- Commit the
generate-tests.jsscript,user_stories.csv, and.github/workflows/run-tests.yamlto your repository. - Push the changes to the
mainbranch.
Step 6: Run the workflow
The GitHub Actions workflow will automatically:- Gather all test files in the
testdriver/directory. - Execute each test file in parallel using the matrix strategy.
Example output
-
Generated Test Files:
testdriver/test_1.yamltestdriver/test_2.yamltestdriver/test_3.yaml
-
GitHub Actions Dashboard:
- Each test file is executed as a separate job, and the results are displayed in the Actions tab.

