0

I would like to repeat a test run multiple times. So I would like to add the count to the command we are passing to run the test. I tried adding the option to grunt file but is not working

Command needs to be generated

npx grunt test-ofp-qa -tags=@inflight -browserType=chrome_single -feature=<feature name> -Count=2

Also tried the below code in gruntfile

        webdriver: {
            options: {
                configFile: './test/config/suite.cucumber.conf.js', //Default config file.
                keepAlive: true, //If false, the grunt process stops when the test fails.
                noColor: false, //If true, protractor will not use colors in its output.
                debug: false,
                specFileRetries: parseInt(grunt.option('failRetryCount')) || 0,
                specFileRun: parseInt(grunt.option('inflightCount')) || 0,
                useExistingRefNum: grunt.option('refNum') || undefined,
                specs: [
                    require('util').format(featureFilePath, (grunt.option('feature') || '*').replace('.feature', ''))
                ],
                capabilities: [ new Capabilities(grunt.option('browserType')).capabilities ],               
                cucumberOpts: { retry: parseInt(grunt.option('failRetryCount')) || 0 ,
            run: parseInt(grunt.option('inflightCount')) || 0}
            },

3
  • Some drawback in changing the test to call a function that performs the checking n times? – João Farias Jun 16 '20 at 12:43
  • @JoãoFarias Sorry.I didnt understand your comment – RRR Jun 16 '20 at 13:58
  • What write you test function instead of foo() { g(); } you write foo() { repeat(5) { g(); } } ? – João Farias Jun 16 '20 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.