-
Notifications
You must be signed in to change notification settings - Fork 2
Typescript #12
Comments
Hi @AdaskoTheBeAsT, unfortunately, it is not possible to use this package with Typescript. This is mainly due to the custom behavior of the cucumber functions ( It seems to me, that it is not a big problem to add these and to get this package running with Typescript. I think I will add this in the future. |
Thanks - it really will be killer feature. I use testcafe with angular 6 and typescript is natural there ;) probably much more people use such combination. |
@AdaskoTheBeAsT we are doing this at the moment and it's quite simple really. The workaround is to just run You will even have full code completion whenever you do The problem is just that testcafe has its own built-in TypeScript compiler which you can't (yet) invoke with gherkin-tescafe. |
@DennisJaamann I try to setup that on CI env - do you have maybe some small sample? |
@AdaskoTheBeAsT of course Here you go: package.json
tsconfig.e2e.json (could be that this needs to be slightly altered with different params, but dont remember exacly which ones)
e2e/cucumber/features e2e/cucumber/steps/some-page.ts
Works like a charm! |
@DennisJaamann Thanks a lot! : ) |
If you want typings I think you can add something of this sort in environment.ts file for example. This will eventually call the given in cucumber. Maybe it adds a bit of complexity, but you'll have all the typings, while also be able to do some custom logic, such as transformations. import { Given as given } from "cucumber";
export function Given(pattern: RegExp | string, action: (t: TestController, args: string[]) => Promise<void>) {
return given.call(this, pattern, action);
} |
Hi all I see that this project now has a type definition which is great that augments Steps I've taken:
The only issue I've found is in the typings file:
Updating this to |
Hey @eddiegroves, thanks for letting us know. I published v2.3.2 with a fix. Internally, we do not use typescript for writing e2e tests (yet). Until then, this is more of an unofficial feature. |
Hi guys, I don't want create new issue, could u please help me debug my problem. I got typeError when try run tests. I use Ubuntu bionic. here is my e2e json: {
"compileOnSave": false,
"compilerOptions": {
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"target": "es6",
"lib": ["es2017", "dom"],
"baseUrl": ".",
"outDir": "./src/.dist/",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"types": [
"node",
"gherkin-testcafe"
]
},
"include": [
"src/BDD/**/*.ts"
],
"exclude": [
"node_modules",
"dist",
"tmp"
]
} |
@maximkoev the error is not related to TypeScript - You've come across issue #36, there are suggested workarounds in that issue until the upstream issue is resolved (a new release of package |
Hi,
do gherkin-testcafe support somewhat running tests written in typescript?
If it is possible do you have some sample configuration how it can be done?
Thanks
The text was updated successfully, but these errors were encountered: