Skip to main content

Excel Template Structure

Chathai uses an Excel template to define test cases.
See the sample template at xlsxtemplate/chathai-templateV.1.0.0.xlsx. or download example template

Column descriptions

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

Placeholders for DDT

  • Put values in value/target using {{field}}, e.g., {{email}}, {{phone}}, {{coupon}}.
  • Use with the -ddt generate command to resolve as row.field.
  • You can also use placeholders inside selectors, e.g., input[name="{{fieldName}}"].

The contains command

  • Provide 1–2 arguments separated by a comma or slash, e.g.:
    • button, Apply Coupon
    • button/Apply Coupon

Complex test case example

TestScenario(des)Test case(IT)commandvalue/targethookchaining?describeonly
LoginUser Loginvisit/loginbeforeLogin test
LoginUser Loginget#usernameLogin test
LoginUser Logintypeuser1YESLogin test
LoginUser Loginget#passwordLogin test
LoginUser Logintypepass123YESLogin test
LoginUser Loginclick#submitYESLogin test
LoginUser Loginshouldurl,/homeYESLogin test

Caveats

  • Must use .xlsx files only
  • Do not rename the main sheet
  • Do not remove required columns
  • If the template format is invalid, use npx chathai --validate
  • If you use {{placeholder}} without enabling -ddt, the CLI will warn after generation