yahoo / protractor-retry

Use protractor features to automatically re-run failed tests with a specific configurable number of attempts.
MIT License
28 stars 32 forks source link

Lists all specs file name but does not run the failed test #43

Open ghost opened 6 years ago

ghost commented 6 years ago

Hello, I have Angular 6 (Universal, with .Net template).

Seems like protractor re-try lists "All" the specs file but does not actually run the failed tests:

Re-running tests , attempt : 1 Re-running the following test files : C:\projects\stash\xxx\xxxx\src\xxxxx\ClientApp\e2e\src\specs\article\article.e2e-spec.ts,C:\projects\stash\xxx\xxxx\src\xxxx\ClientApp\e2e\src\specs\consumer\my-page\my-page-delete-saved-progress-user-interaction.e2e-spec.ts,C:\projects\stash\xxx\xxxx\src\xxxx\ClientApp\e2e\src\specs\consumer\xxxx\my-page-load-progress-user-interaction.e2e-spec.ts,

my protractor config is as below:

Any ideas?

// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');
var retry = require('protractor-retry').retry;
const appSettings = require('./e2e-settings.json');
const {
  seedPageData,
  cleanUpSeededPageData

} = require('./mongodb-setup');

const NUMBER_OF_RETRIES = 2;
exports.config = {
  rootElement: 'app',
  getPageTimeout: 100000,
  allScriptsTimeout: 100000,
  specs: [
    './src/**/*.e2e-spec.ts'
  ],
  capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      args: ["--disable-browser-side-navigation"]
    }
  },
  directConnect: true,
  baseUrl: appSettings.SpaUrl,
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 50000,
    print: function () {
    }
  },
  params: {
    locale: appSettings.locale
  },
  beforeLaunch: function () {
    require('ts-node').register({
      project: require('path').join(__dirname, './tsconfig.e2e.json')
    });
    return cleanUpSeededPageData(appSettings.mongodbConnectionString, appSettings.mongodbDatabseName);
  },
  onPrepare: function () {
    retry.onPrepare();
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
    return seedPageData(appSettings.mongodbConnectionString, appSettings.mongodbDatabseName);

  },
  afterLaunch: function () {
    retry.afterLaunch(NUMBER_OF_RETRIES);
    return cleanUpSeededPageData(appSettings.mongodbConnectionString, appSettings.mongodbDatabseName);
  },
  onCleanUp: function (results) {
    retry.onCleanUp(results);
  }
};`
dreuxl commented 6 years ago

Hi @shivark

Are u launching / using the protractor retry pkg from a windows machine? If yes unfortunately it s not yet supported. please see https://github.com/yahoo/protractor-retry/pull/16 for more infos.

Thanks

ghost commented 6 years ago

oh that's a shame! Thanks.

dreuxl commented 6 years ago

thanks for your kind feedback. PRs are welcome