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

Browser in configuration file are parsed even if browsers are given on the command line #6618

Closed
piefel opened this issue Oct 14, 2021 · 8 comments
Assignees
Labels
FREQUENCY: level 2 SYSTEM: configuration storage TYPE: bug The described behavior is considered as wrong (bug).

Comments

@piefel
Copy link

piefel commented Oct 14, 2021

Applies to TestCafé 1.16.1

What is your Test Scenario?

I have a .testcaferc.json file such as:

{
    "browsers": ["ie", "firefox"]
}

Also, I do have Firefox installed but not Internet Explorer.

What is the Current behaviour?

I call npx testcafe edge tests/ --skip-js-errors

Now I get: ERROR Cannot find the browser. "ie" is neither a known browser alias, nor a path to an executable file.

What is the Expected behaviour?

Since the browser edge is given on the command line, the browsers from the config file should be ignored.

This is a change from previous behaviour. At least for 1.10.1, the config file browsers list was ignored. It took me ages to pinpoint the problem when our CI broke: We had a .testcaferc.json checked in for local development, but CI tried to use Browserstack instead; now the build broken just saying that chrome was not available.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Oct 14, 2021
@AlexKamaev
Copy link
Contributor

Thank you for reporting this to us. I was able to reproduce the issue.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Oct 15, 2021
@AlexKamaev AlexKamaev added FREQUENCY: level 2 STATE: Need response An issue that requires a response or attention from the team. TYPE: bug The described behavior is considered as wrong (bug). SYSTEM: configuration storage and removed STATE: Need response An issue that requires a response or attention from the team. labels Oct 15, 2021
@piefel
Copy link
Author

piefel commented Oct 15, 2021

I just noticed that under certain circumstances, the browsers list in the configuration file is checked (including a bad exception if the browser is not found), but then ignored:

$ npm run test:browserstack:ie11

> ui-tests@1.0.0 test:browserstack:ie11 /…/ui-tests
> export $(cat .browserstack-config.properties | xargs) && testcafe 'browserstack:ie@11.0:Windows 10' tests/ --reporter teamcity

The "browsers" option from the configuration file will be ignored.

Running testcafe through npx directly, or having it in package.json without the export bit, will still result in the browser from the command line being ignored completely.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Oct 15, 2021
@AlexKamaev AlexKamaev removed the STATE: Need response An issue that requires a response or attention from the team. label Oct 18, 2021
@miherlosev miherlosev self-assigned this Dec 23, 2021
@miherlosev
Copy link
Collaborator

The issue is not reproduced with testcafe@1.18.0.

image

@dboujot
Copy link

dboujot commented Jan 3, 2022

Hello @miherlosev,
I have the same problem than @piefel.
I have a .testcaferc.json such as :
{ "browsers": [ "chrome", "firefox", "edge" ], "src": "tests/e2e/**/*.ts" }

When I launch my tests with testcafe v 1.18.1 from my gitlab pipeline I have the following error "ERROR Cannot find the browser. "edge" is neither a known browser alias, nor a path to an executable file." The browser name provided by the command is ignored.
image

When I launch the same tests with an older version of testcafe, v 1.14.2, everything works fine
image

@miherlosev, cloud you do the test with an other OS than Windows, please?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jan 3, 2022
@AlexanderMoiseev
Copy link
Contributor

Hi @dboujot,

Thank you for pointing this out. I was able to reproduce it on a Mac device. Please stay tuned for further updates.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jan 5, 2022
@dboujot
Copy link

dboujot commented Mar 1, 2022

Hi @AlexanderMoiseev,
I would have liked to know if this bug could soon be taken into account for correction?

Thanks for your feedback

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 1, 2022
@alexfi1in alexfi1in added the STATE: No estimations No estimations can be made at this point. label Mar 3, 2022
@github-actions
Copy link

github-actions bot commented Mar 3, 2022

Any personal estimate may be misleading, so we cannot currently tell it at the moment. Once we get any results, we will post them in this thread.

@github-actions github-actions bot removed STATE: Need response An issue that requires a response or attention from the team. STATE: No estimations No estimations can be made at this point. labels Mar 3, 2022
Artem-Babich added a commit to Artem-Babich/testcafe that referenced this issue Apr 20, 2022
@github-actions
Copy link

github-actions bot commented May 6, 2022

Release v1.19.0-alpha.1 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FREQUENCY: level 2 SYSTEM: configuration storage TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

6 participants