Skip to content

Commit

Permalink
modernize launching browsers content
Browse files Browse the repository at this point in the history
- add explanations of running electron headed
- how to spawn other browsers
  • Loading branch information
brian-mann committed Oct 25, 2017
1 parent a67b6e6 commit 23513e9
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions source/guides/core-concepts/launching-browsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ title: Launching Browsers
comments: false
---

When you run tests in Cypress, we launch a browser for you. Cypress launches a real browser for two main reasons:
When you run tests in Cypress, we launch a browser for you. This enables us to:

1. To create a clean, pristine testing environment.
2. To access the exclusive browser API's for automation.
1. Create a clean, pristine testing environment.
2. Access the privileged browser API's for automation.

# Available Browsers
# Browsers

When Cypress is initially run from the Desktop application, you can choose to run Cypress in a select number of browsers including:

Expand All @@ -20,13 +20,38 @@ When Cypress is initially run from the Desktop application, you can choose to ru
Cypress automatically detects available browsers on your system (based on your OS).

- `Linux`: detects available browsers by their executable binary
- `OSX`: detects available browser (even if not in `/Applications` folder).
- `OSX`: detects available browsers - even outside the `/Applications` folder.

## Electron Browser

In addition to the browsers found on your system, you'll notice that Electron is an available browser. The Electron browser is a version of Chrome that is bundled with {% url "Electron" https://electron.atom.io/ %} (the platform underlying the Cypress app). Cypress runs all headless runs using {% url '`cypress run`' command-line#cypress-run %} in Electron. Launching the Electron browser may be useful for debugging issues that only occur when running headless.
In addition to the browsers found on your system, you'll notice that Electron is an available browser. The Electron browser is a version of Chromium that comes with {% url "Electron" https://electron.atom.io/ %}.

The `Electron` browser does not have its own Dock icon or any chrome (address bar, tabs, bookmarks, etc).
The Electron browser has two unique advantages:

1. It can be run headlessly.
2. It comes baked into Cypress and does not need to be installed separately.

By default, when running {% url '`cypress run`' command-line#cypress-run %} from the CLI we will launch Electron headlessly.

***You can also launch Electron headed:***

```bash
cypress run --headed
```

Because Electron is the default browser - it is typically run in CI. If you are seeing failures in CI, to easily debug them you may want to run locally with the `--headed` option.

## Chrome Browsers

All Chrome* flavored browsers will be detected and are supported.

***You can launch Chrome browsers:***

```bash
cypress run --browser chrome
```

To use this command in CI, you need to install these other browsers - or use one of our {% url 'docker images' docker-images %}.

## Unsupported Browsers

Expand All @@ -41,7 +66,7 @@ Cypress launches the browser in a way that's different from a regular browser en
Cypress generates its own isolated profile apart from your normal browser profile. This means things like `history` entries, `cookies`, and `3rd party extensions` from your regular browsing session will not affect your tests in Cypress.

{% note warning Wait, I need my developer extensions! %}
That's no problem - you just have to reinstall them **once** in the Cypress launched browser. We'll continue to use this Cypress testing profile on subsequent launches so all of your configuration will be preserved. Note that in the {% urlHash "Electron browser" Electron-Browser %}, while it's possible to use the dev tools, it's not possible to install developer extensions.
That's no problem - you just have to reinstall them **once** in the Cypress launched browser. We'll continue to use this Cypress testing profile on subsequent launches so all of your configuration will be preserved.
{% endnote %}

## Disabled Barriers
Expand Down

0 comments on commit 23513e9

Please sign in to comment.