Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reruning all the tests not just the failed ones with cucumber. #103

Closed
Jakyhack opened this issue Jan 30, 2019 · 1 comment
Closed

Reruning all the tests not just the failed ones with cucumber. #103

Jakyhack opened this issue Jan 30, 2019 · 1 comment

Comments

@Jakyhack
Copy link

Jakyhack commented Jan 30, 2019

Hi guys! I've seen some issues like that but not for cucumber. It's an strange behaviour. First of all, my data:

  • Operating system and version: Windows 10
  • Node.js version: 8.11.1
  • Protractor version: 5.4.2
  • Protractor flake version: 3.3.0
  • Protractor configuration file:
exports.config = {
    params: {
        env: 'TEST',
        world: {}
    },
    onPrepare: async function() {
        var utils = require('./e2e-common/lib/utils.js');
        utils.loadVariables('../env.json');
        require('./e2e-common/lib/waitReady.js');
        require('./e2e-common/lib/waitAbsent.js');
    },
    seleniumAddress: 'http://localhost:4444/wd/hub',
    restartBrowserBetweenTests: true,
    allScriptsTimeout: 150000,
    maxSessions: 1,
    capabilities: {
        browserName: 'chrome',
        specs: [
            'features/**/*.feature',
        ],
        chromeOptions: {
            args: ['--no-proxy-server'],
        },
    },
    framework: 'custom',
    frameworkPath: require.resolve('protractor-cucumber-framework'),
    cucumberOpts: {
        require: [
            './e2e-common/step_definitions/**/*.js',
            './e2e-common/lib/hooks.js'
        ],
        profile: false,
        'no-source': true
    }
};

My Specs:
TodayFolder/:

  • Morning.feature: With 3 Scenarios
  • Afternoon.feature: With 3 Scenarios
  • Evening.feature: With 3 Scenarios

TomorrowFolder/:

  • Morning.feature: With 3 Scenarios
  • Afternoon.feature: With 3 Scenarios
  • Evening.feature: With 3 Scenarios

Total: 18 Scenarios

After hooks:
In my Afterhooks I've putted console.log('Specs:', scenario.sourceLocation.uri);

Okay. Given all of this data, what is happening is:

  • Run the regression with: ./node_modules/.bin/protractor-flake --parser cucumber -- "conf.js"
  • The following testcase fail: TomorrowFolder/Afternoon.feature -> Scenario number 2.
  • The console log shows: "Specs: TmorrowFolder/Afternoon.feature"
  • We can see something like:

Using cucumber to parse output
Re-running tests: test attempt 2
Re-running the following test files:
Tomorrow\Afternoon.feature

Until this point everything is fine. But what is happening After is:

  1. Rerun the "TomorrowFolder/Afternoon.feature" with all of its testcases
  2. Rerun again all the features with all the testcases (Included again "TomorrowFolder/Afternoon.feature")

This means is not just reruning the failed feature, it's reruning all the features and the failed features twice.

@abubakarafzal
Copy link

@Jakyhack Did your problem resolved ?

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

No branches or pull requests

2 participants