testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

Allow creation of browser aliases in .testcaferc.js

Open aayvazyan-tgm opened this issue 2 years ago • 1 comments

What is your Scenario?

  • I want to pre define my browser options easily via .testcaferc.js and select the relevant one via cli eg: testcafe customChromium --headless
  • I need to dynamically set the path to the executable chromium binary as it comes from a npm dependency and cannot do so via cli
  • I want to add options as part of the cli call

What are you suggesting?

.testcaferc.js could be extended like this:

  browsers:
    [{
      alias: 'customChromium'
      path: puppeteer.executablePath(),
    },
    {
      alias: 'chromiumForCI'
      path: 'path/to/chromium',
    },
]

Cli calls would be like this: testcafe customChromium testcafe chromiumForCI --headless

What alternatives have you considered?

Browser providers would be overkill for this simple feature

Additional context

No response

aayvazyan-tgm avatar Sep 19 '22 10:09 aayvazyan-tgm

Hi @aayvazyan-tgm,

I reviewed our support database, but could not find any requests for this feature. I realize it's important, but we are unable to commit to its development at this time. However, a relatively straightforward workaround will help address your requirements. You can create separate testcafe configuration files for each browser path and run them with CLI option --config-file

Aleksey28 avatar Sep 20 '22 10:09 Aleksey28

We decided to close this issue since it is not popular among TestCafe users and we have more priority tasks. As a workaround, we recommend using the solution described in the comment above. If anyone wants to make a PR - we'll check it.

AlexKamaev avatar Aug 24 '23 12:08 AlexKamaev