Skip to content

retryconfig doesn't work #93

@Anyman552

Description

@Anyman552

Hi there!

  • Operating system and version: Windows 7
  • Node.js version: 8.9.4
  • Protractor version: 5.3.2
  • Protractor flake version 3.3.0

everything works fine until i want to use the retryconfig-feature. The first test run works well. But if there is a failure i get an error at the next test attempt:

Using standard to parse output
Re-running tests: test attempt 2
Using provided protractorRetryConfig: C:\seu\workspace\src\test\javascript\retryconfig.js
Re-running the following test files:
C:\seu\workspace\src\test\javascript\e2e\test\startbarkeitAuskunftProzesse.js
Usage: protractor [configFile] [options]
configFile defaults to protractor.conf.js
The [options] object will override values from the config file.
See the reference config for a full list of options.

Options:
  --help                                 Print Protractor help menu
  --version                              Print Protractor version
  --browser, --capabilities.browserName  Browsername, e.g. chrome or firefox
  --seleniumAddress                      A running selenium address to use
  --seleniumSessionId                    Attaching an existing session id
  --seleniumServerJar                    Location of the standalone selenium jar file
  --seleniumPort                         Optional port for the selenium standalone server
  --baseUrl                              URL to prepend to all relative paths
  --rootElement                          Element housing ng-app, if not html or body
  --specs                                Comma-separated list of files to test
  --exclude                              Comma-separated list of files to exclude
  --verbose                              Print full spec names
  --stackTrace                           Print stack trace on error
  --params                               Param object to be passed to the tests
  --framework                            Test framework to use: jasmine, mocha, or custom
  --resultJsonOutputFile                 Path to save JSON test result
  --troubleshoot                         Turn on troubleshooting output
  --elementExplorer                      Interactively test Protractor commands
  --debuggerServerPort                   Start a debugger server at specified port instead of repl
  --disableChecks                        Disable cli checks
  --logLevel                             Define Protractor log level [ERROR, WARN, INFO, DEBUG]

Error: Error: more than one config file specified

Protractor seems to throw the error because of more than one config files. So i looked at protractorArgs in index.js:

    if (parsedOptions.protractorRetryConfig && retry) {
      protractorArgs.push(parsedOptions.protractorRetryConfig);
    }

it adds the retryconfig but do not remove the origin one.
If i remove the origin config from the array everything works fine:

    if (parsedOptions.protractorRetryConfig && retry) {
      protractorArgs.push(parsedOptions.protractorRetryConfig);
      protractorArgs.splice(1, 1);
    }
  • my flake-file:
var protractorFlake = require('protractor-flake');

protractorFlake({
	protractorPath: 'C:\\Users\\Anyman552\\AppData\\Roaming\\npm\\node_modules\\protractor\\bin\\protractor',
	maxAttempts: 3,
	parser: 'standard',
	// expects node to be in path
	// set this to wherever the node bin is located
	nodeBin: 'node',
	// set color to one of the colors available at 'chalk' - https://github.com/chalk/ansi-styles#colors
	color: 'magenta',
	protractorArgs: ["protractor.conf.local.js"],
	// specify a different protractor config to apply after the first execution attempt
	// either specify a config file, or cli args (ex. --capabilities.browser=chrome)
	protractorRetryConfig: 'retryconfig.js'
}, function (status, output) {
	process.exit(status);
});
  • protractor-config:
exports.config = {
	framework: 'jasmine',
	specs: ["e2e/test/*.js"],
	directConnect: true,
	capabilities: {
		browserName: 'firefox',
	        'moz:firefoxOptions': {
		 	args: [ "--headless" ]
		 }
	},
	params: {
		e2e: {
			'config': {
				'helper': '../../e2e/mods/helper',
			}
		}
	}
};

the retryconfig is the same as the origin one with some other params.

Thanks,
Anyman552

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions