I have to create a testing framework using CodeceptJS. I am trying to use typescript instead of javascript to write my page objects and tests. Can someone help with what configuration is required in conf.js or steps.ts file
I have added below in conf file but not sure what else to add require: ["ts-node/register", "should"]
ts-node
to your package.json dev dependencies. And install dependenciesrequire: ["ts-node/register"]
to config.tests
regexp in configuration supports ts
files:
for example tests: "./tests/*.spec.ts"
Definitions for codeceptjs are generated by command codeceptjs def
.
https://codecept.io/commands#typescript-definitions
You should add this definitions in your tsconfig.
P.S. There are an example for TS&CodeceptJS integration: https://github.com/elukoyanov/codecept-typescript-example
Pay attention, it has one tsconfig for main project (in project directory) and second tsconfig for codeceptjs only (in src/specs/e2e
path)