Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

The specs are not run in my Protractor-CucumberJS framework #197

Open
belurharish opened this issue Dec 13, 2019 · 0 comments
Open

The specs are not run in my Protractor-CucumberJS framework #197

belurharish opened this issue Dec 13, 2019 · 0 comments

Comments

@belurharish
Copy link

belurharish commented Dec 13, 2019

I created a grunt tasks using grunt-protractor-runner with my protractor-cucumber framework. I have put the specs in Gruntfile.js and not in config.js file. When I run grunt test command no specs are picked for execution. Below is how the Gruntfile.js looks like:

    grunt.initConfig({
    protractor: {
        options: {
            keepAlive: true,
            noColor: false,
        },
        chrome: {
            options: {
                configFile: "./config/config.js",
                args: {
                    autoConnect: false,
                    seleniumServerJar: './node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar',
                    chromeDriver: './node_modules/webdriver-manager/selenium/chromedriver.exe',
                    specs: [
                        '../features/calendar.feature',
                        '../features/deal.feature',
                        '../features/entitlement.feature',
                        '../features/filter.feature',
                        '../features/product.feature'
                    ],
                    capabilities: {
                        browserName: 'chrome',
                        chromeOptions: {
                            useAutomationExtension: false,
                            args: ['–disable-gpu'],
                        }
                    }
                }
            }
        }
    },
});
grunt.registerTask('test', ['protractor:chrome']);

When I grunt test, it logs:

Running "protractor:chrome" (protractor) task [17:22:57] I/launcher - Running 1 instances of WebDriver [17:22:57] I/hosted - Using the selenium server at http://localhost:4444/wd/hub

0 scenarios 0 steps 0m00.000s

My config.js file looks like this:

const Reporter = require('../support/Reporter.js');
exports.config = {
  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  restartBrowserBetweenTests: false,
  SELENIUM_PROMISE_MANAGER: true,
  ignoreUncaughtExceptions: true,
  // highlightDelay: 1000,
  onPrepare: function () {
    browser.ignoreSynchronization = false;
    browser.manage().timeouts().setScriptTimeout(40 * 1000);
    browser.manage().timeouts().implicitlyWait(4 * 1000);
    browser.manage().window().maximize();
    require('babel-register');
  },
  cucumberOpts: {
    strict: true,
    format: ['json:./reports/json/cucumber_report.json'],
    require: ['../support/*.js', '../stepDefinitions/*.js','../stepDefinitions/*.ts'],
    tags: 'not @Ignore',     //(@CucumberScenario or @ProtractorScenario) and (not @Ignore)
    retry: 3
  },
  onComplete: function () {
    Reporter.moveReportToArchive();
    Reporter.createHTMLReport();
  }
};
  • It looks like when I mention the specs in grunt file and not in config.js, they are ignored.
  • It started working fine only when I put the specs in config.js

Reference: https://stackoverflow.com/q/59295192/2613428

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant