Skip to main content

Getting Started

1. Install Chathai

Install via npm:

npm install chathai --save-dev

Or use npx without installing:

npx chathai --help

2. Open Chathai UI (for non-command-line users)

npx chathai install-ui
npx chathai open-ui

Chathai UI helps you create and edit test cases in Excel easily.


3. Excel Template Structure

Chathai uses an Excel (.xlsx) file to define test cases.
Example of required columns:

TestScenario(des)Test case(IT)Describeonlyhookcommandvalue/targetchaining?
Simple Todo AppLoads the app and adds a todoOpen the site before each test in the suitevisithttp://localhost:3000
Simple Todo AppLoads the app and adds a todoOpen the site before each test in the suitegetinput[name="task"]
Simple Todo AppLoads the app and adds a todoOpen the site before each test in the suiteskiptypeLearn Cypress
Simple Todo AppLoads the app and adds a todoOpen the site before each test in the suitebeforegetbutton[type="submit"]
Simple Todo AppLoads the app and adds a todoOpen the site before each test in the suiteclick
Simple Todo AppLoads the app and adds a todoOpen the site before each test in the suitecontainsLearn Cypress

Column descriptions

  • TestScenario(des): Test group name (describe)
  • Test case(IT): Test case name (it)
  • Describe: Test group description (optional)
  • only: Use with Cypress.only (optional)
  • hook: Specify hooks such as before, beforeEach (optional)
  • command: Cypress commands such as visit, get, type, click, contains
  • value/target: Command value/target such as URL, selector, text
  • chaining?: Whether to chain commands (optional)

4. Complete example test case

TestScenario(des)Test case(IT)Describeonlyhookcommandvalue/targetchaining?
LoginUser LoginLogin testbeforevisit/login
LoginUser LoginLogin testget#username
LoginUser LoginLogin testtypeuser1YES
LoginUser LoginLogin testget#password
LoginUser LoginLogin testtypepass123YES
LoginUser LoginLogin testclick#submitYES
LoginUser LoginLogin testshouldurl,/homeYES

5. Usage steps

  1. Create test cases in Excel as shown
  2. Generate Cypress script:
    npx chathai generate ./xlsxtemplate/chathai-templateV.1.0.0.xlsx ./cypress/e2e
    Or open DDT mode (replace {{field}} from a fixture):
    npx chathai generate -ddt ecommerce_ddt
    # If you don't specify a fixture name, the default ecommerce_ddt will be used
  3. Run Cypress:
    npx cypress open
  4. Export test report:
    npx chathai export-report

Note: After generation, if potential issues are found, the CLI will print a "Chathai warnings:" summary (e.g., placeholder without DDT, invalid contains format, etc.).


6. Good to know

  • Create a new template with
    npx chathai --create-template my-template.xlsx
  • Validate a template with
    npx chathai --validate my-template.xlsx
  • See all commands in the CLI Reference

7. No Cypress background required

  • No need to write JavaScript
  • No need to know Cypress syntax
  • Just prepare test cases in Excel as shown
  • Use simple commands via CLI or UI