Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch tests in Chrome with the console docked at the bottom, not the right?

Whenever I launch Karma on Chrome a new Chrome window pops up. When I bring up the console on this Chrome Window the console comes up attached to the right side. I prefer the console attached to the bottom so I always bring it down - its kind of annoying.

How can I get Karma to launch Chrome with the console docked at the bottom?

like image 452
David says Reinstate Monica Avatar asked Apr 27 '16 13:04

David says Reinstate Monica


People also ask

How do I change the position of the Console in Chrome?

Open the Command Menu. Run one of the following commands: Dock to left , Dock to right , Dock to bottom , Undock into separate window or Restore last dock position . To toggle Restore last dock position with a keyboard shortcut, press Control + Shift + D (Linux/Windows) or Command + Shift + D (Mac).

How do I move my Google Chrome Console to the bottom?

Pressing Ctrl + Shift + D will dock all devtools to left, right, bottom in turn.

How do you move your Console to the side?

1) Press Command+Option+J to open the console. 2) Press Command+Option+D to move the console to another position.

How do I change the inspect layout in Chrome?

In the developer tools, klick the cogwheel icon (or press F1 when focusing the dev tools) to open the settings overlay. Under "Preferences", in the "Appearance" section, find the "Panel layout" option. Set it to your liking.


1 Answers

It seems that there is no straightforward way to do that.

Although you could specify custom launcher options for Chromium, there is no option that controls devtool position. (Though there is --auto-open-devtools-for-tabs that can also be handy in your case.)

However, there's a nice hack described in a related issue:

A brute force approach is to pass the --user-data-dir flag to a custom launcher:

browsers: ['Chrome'],
customLaunchers: {
  Chrome_DevTools_Saved_Prefs: {
    base: 'Chrome',
    flags: ['--user-data-dir=./tests/config/.chrome_dev_user']
  }
}

then

karma start --browsers Chrome_DevTools_Saved_Prefs

This will allow you to reuse the profile. When you want to test using a fresh profile, use the default Chrome launcher or wipe the user-data-dir.

UPDATE: as @KFunk points out, this case is covered in Karma's documentation in a bit nicer way:

customLaunchers: {
  Chrome_with_debugging: {
    base: 'Chrome',
    chromeDataDir: path.resolve(__dirname, '.chrome')
  }
}
like image 61
Роман Парадеев Avatar answered Sep 30 '22 10:09

Роман Парадеев