testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

Custom CLI arguments are parsed incorrectly if specified before browsers and test files

Open AndreyBelym opened this issue 3 years ago • 0 comments

What is your Scenario?

Use custom CLI arguments in tests. Specify a custom argument before specifying a browser.

WORKAROUND

Specify custom arguments at the end of the arguments list:

npx testcafe chrome test.js --foo 123

What is the Current behavior?

The following error message is shown:

Cannot find the browser. "--foo" is neither a known browser alias, nor a path to an executable file.

What is the Expected behavior?

There should be no error.

What is your public website URL? (or attach your complete example)

example.com

What is your TestCafe test code?

fixture `IeStackOverflow`
  .page("https://example.com");

 
test("OpenIeOpenDevTools", async t => {
  debugger;
})

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

  1. Run any test with the CLI arguments below

TestCafe version

1.15.2

Node.js version

No response

Command-line arguments

testcafe --foo chrome test.js

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

Regression in https://github.com/DevExpress/testcafe/commit/869d5f624ab2e6304325262191e092ef81b838aa.

AndreyBelym avatar Feb 10 '22 07:02 AndreyBelym