Skip to content

Commit

Permalink
Add section describing use of Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-osch committed Jul 12, 2023
1 parent fd22223 commit 402a87b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions site/content/docs/browser-checks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ test('Visit Checkly HQ page', async ({ page }) => {

{{< info >}}
Checkly currently supports only using **Chromium** with Playwright Test and Playwright library.
[Read more about using other browsers](/docs/browser-checks/#using-other-browsers).
{{< /info >}}

## Breaking down a Browser check step-by-step
Expand Down Expand Up @@ -219,6 +220,43 @@ While Playwright and Puppeteer share many similarities, they have evolved at dif

We recommend using Playwright Test if you are just starting out or [migrating from Puppeteer to Playwright using `puppeteer-to-playwright`](https://github.com/checkly/puppeteer-to-playwright).

## Using other browsers
{{< info >}}
We strongly recommend using the default `chromium` browser for all your checks [as per the offcial Playwright documentation](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
{{< /info >}}

If your application [has very specific requirements](https://playwright.dev/docs/browsers#when-to-use-google-chrome--microsoft-edge-and-when-not-to),
Checkly enables you to use `Google Chrome` with Playwright in runtimes `2023.02` and newer.
In order to use Google Chrome you need to explicitly opt-in by passing the `channel: 'chrome'` config.

{{< tabs "Google Chrome with Playwright test" >}}
{{< tab "TypeScript" >}}
```ts
import { expect, test } from '@playwright/test'

test.use({ channel: 'chrome' }) // <-- opt-in to use Google Chrome

test('Open the page and take a screenshot', async ({ page }) => {
await page.goto('https://checklyhq.com/')
await page.screenshot({ path: `checkly.png` })
})
```
{{< /tab >}}
{{< tab "JavaScript" >}}
```js
const { expect, test } = require('@playwright/test')

test.use({ channel: 'chrome' }) // <-- opt-in to use Google Chrome

test('Open the page and take a screenshot', async ({ page }) => {
await page.goto('https://checklyhq.com/')
await page.screenshot({ path: `checkly.png` })
})
```
{{< /tab >}}
{{< /tabs >}}


## Next Steps
- Learn more about [built-in functionalities of Playwright Test](/docs/browser-checks/playwright-test/).
- Learn how to deal with [login scenarios and private data](/docs/browser-checks/login-and-secrets/).
Expand Down

0 comments on commit 402a87b

Please sign in to comment.