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 asrow.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) | command | value/target | hook | chaining? | describe | only |
---|---|---|---|---|---|---|---|
Login | User Login | visit | /login | before | Login test | ||
Login | User Login | get | #username | Login test | |||
Login | User Login | type | user1 | YES | Login test | ||
Login | User Login | get | #password | Login test | |||
Login | User Login | type | pass123 | YES | Login test | ||
Login | User Login | click | #submit | YES | Login test | ||
Login | User Login | should | url,/home | YES | Login 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