karma-runner / karma-runner/karma
the process of running cases is blocked since No binary for Chrome browser on your platform, but I have configured two browsers, one is available and one is missing.
- Dominant language
- JavaScript
- Stars
- 12k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
### Expected behaviour
I am working on a Centos environment, it has Firefox by default, and I didn't install Chrome browser. I have install the karma-firefox-launcher in devDependencies. I have browsers: `['Firefox','Chrome']` in karma.conf.js, I suppose it can automatically open Firefox and executes cases, and ignore the Chrome not installed error.
And I have tested, once I remove the Chrome from the browsers, and the require of karma-chrome-launcher, it will execute the cases immediately. So my question is, whether does this happen? I am not sure if it's a bug or work-as-design.
And I have tested on Windows environement ,which has both Firefox and Chrome, it works fine.
### Actual behaviour
After I run `npm run test`, it throws below errors, and indeed, I have no chrome in my environment. It will automatically open firefox, but the cases will not run, it has been blocked.
below is the console output,
```bash
[root@localhost]$ npm run test
> ng test
?Browser application bundle generation complete.
12 07 2023 15:14:54.270:WARN [karma]: No captured browser, open http://localhost:9876/
12 07 2023 15:14:54.283:INFO [karma-server]: Karma v6.3.20 server started at http://localhost:9876/
12 07 2023 15:14:54.284:INFO [launcher]: Launching browsers Firefox, Chrome with concurrency unlimited
12 07 2023 15:14:54.288:INFO [launcher]: Starting browser Firefox
12 07 2023 15:14:54.349:INFO [launcher]: Starting browser Chrome
12 07 2023 15:14:54.350:ERROR [launcher]: No binary for Chrome browser on your platform.
Please, set "CHROME_BIN" env variable.
12 07 2023 15:14:59.124:INFO [Firefox 102.0 (Linux x86_64)]: Connected on socket xH76gJECbuD7YSLcAAAB with id 78973281
```
this is the browser screenshot,

### Environment Details
- karma version "~6.3.0",
- Relevant part of `karma.config.js` file
```javascript
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-firefox-launcher'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
...
port: 9876,
autoWatch: true,
browsers: ['Firefox','Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
```
### Steps to reproduce the behaviour
1. install the karma-firefox-launcher in devDependencies
2. add Firefox into browsers option, and add require of karma-firefox-launcher in karma.conf.js
3. run `npm run test` in a Centos ssh terminal
Contributor guide
Research direction
Start with the karma.conf.js configuration shown in the report and reproduce the issue by running npm run test with Firefox and Chrome configured on a system without Chrome. Trace how Karma handles the unavailable Chrome launcher while Firefox connects, then establish whether the intended outcome is to continue with available browsers and define the corresponding testable behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100