kiwigrid/gherkin-testcafe

Add support for more CLI options

Closed this issue · 11 comments

Support all options.

@Lukas-Kullmann have you also considered these: https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md ?

Especially the --tags options is really awesome, this way you can run subsets of tests any time you would like.

For example:

  • @smoke for quick developer tests (pre-push, very short run time)
  • @ci for an extended set of tests (in ci pipeline, medium run time)
  • @qa for the ultimate set of tests (before deploying to production, long run time)

Will investigate if and how we could leverage this

Hey @DennisJaamann,
no, I have not concidered these. But I think you are right. It would be worth adding some support for these options. Especially, as you said, the --tags one!

--reporter is needed.

just wondering if you have considered the option of running test cases with proxy?

at present, I run my test cases like this

 "scripts": {
    "test": "testcafe chrome Tests/ -e --proxy https.proxy.domain.com:8000"
  },

Does this repo have the ability to run test cases behind a proxy. If yes, could you please quote an example usage?Thanks

At present when I try to run these test using the command in the read me doc I get the following error

PS C:\Users\Mon\Desktop\TestCafe\gherkin-testcafe> gherkin-testcafe --steps tests/**/*.js --specs tests/**/*.feature --browsers firefox
module.js:545
    throw err;
    ^

Error: Cannot find module 'testcafe/lib/errors/runtime'

I followed the exact steps as in read me and when I got the above error I also tried installing gherkin-testcafe globally. Could someone please advise as to how these test cases need to be run?

Hi @skullz03, I'm sorry, but as of now, the proxy option is not supported in the gherkin-testcafe CLI. You can however pass the proxy option via the programming interface.

For your other issue, I will investigate this tomorrow.

Hi Lukas,

Thanks for replying to my question. I have looked at the programming interface but not really clear how to add the proxy to it. I know this might be SO forum question. But just hoping you can give me some idea?

Sure. Your example is equivalent to:

const createTestCafe = require('gherkin-testcafe');

(async () => { 
  const testcafe = await createTestCafe(); 
  const runner = await testcafe.createRunner(); 
  await runner
    .steps('Tests/**/*.js')
    .specs('Tests/**/*.feature')
    .browsers('chrome')
    .useProxy('https.proxy.domain.com:8000')
    .run({ skipJsErrors: true });
})();

And then run this on your NodeJS environment.

Thanks for the idea. Appreciate it!

Hey @skullz03,

sorry, that I did not answer your other question sooner. I was quite busy.

The problem there seems to be, that you want to run gherkin-testcafe from the command line from the package itself. This is only possible, if you installed it as a dependency of your project.

To run the examples, please execute

node main.js --steps examples/*.js --specs examples/*.feature -b firefox

Do not clone the repo and put test files into it. Start your own project and install gherkin-testcafe (and testcafe as a dependency: npm i -D gherkin-testcafe testcafe). From there, you can use gherkin-testcafe via the command line.

Beginning from version 2, all CLI options are inherited from testcafe.