-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-fromid-construct
- Loading branch information
Showing
50 changed files
with
959 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { test } from '@playwright/test' | ||
import { ChecklySitePage } from './poms/ChecklySitePage' | ||
|
||
test('homepage visual comparison', async ({ page }) => { | ||
const checklyPage = new ChecklySitePage(page) | ||
await checklyPage.goto('/docs') | ||
await checklyPage.doScreenshotCompare() | ||
}) |
Binary file added
BIN
+174 KB
..._/docs-visual.spec.ts-snapshots/homepage-visual-comparison-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
sitemapExclude: true | ||
--- | ||
| variable | description | availability notes | | ||
|-------------------|---------------------------------------------|--------------------------------------| | ||
| `CHECK_ID` | The UUID of the check being executed. | only available after saving a check. | | ||
| `CHECK_NAME` | The name of the check being executed. | | | ||
| `CHECK_RESULT_ID` | The UUID where the result will be saved. | only available on scheduled runs. | | ||
| `CHECK_RUN_ID` | The UUID of the check run execution. | only available on scheduled runs. | | ||
| `CHECK_TYPE` | The type of the check, e.g. `BROWSER`. | | | ||
| `REGION` | The current region, e.g. `us-west-1`. | | | ||
| `RUNTIME_VERSION` | The version of the runtime, e.g, `2023.09`. | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
sitemapExclude: true | ||
--- | ||
Sometimes, you do want to explicitly save a file to disk. This is what you need to know. | ||
|
||
Checkly creates a sandboxed directory for each check run. During the run you can use this directory to save or upload | ||
artifacts. This directory is destroyed after a check is finished. | ||
|
||
{{< tabs "Basic example" >}} | ||
{{< tab "Typescript" >}} | ||
```ts | ||
import path from 'path' | ||
import fs from 'fs' | ||
import { test } from '@playwright/test' | ||
|
||
test('Save file in directory', async ({ page }) => { | ||
const image = await page.goto('https://picsum.photos/200/300') | ||
const imagePath = path.join('example.jpg') | ||
const buffer = await image.body() | ||
fs.writeFileSync(imagePath, buffer) | ||
const readFileFromDisk = fs.readFileSync(imagePath) | ||
}) | ||
``` | ||
{{< /tab >}} | ||
{{< tab "Javascript" >}} | ||
```js | ||
const path = require('path') | ||
const fs = require('fs') | ||
const { test } = require('@playwright/test') | ||
|
||
test('Save file in directory', async ({ page }) => { | ||
const image = await page.goto('https://picsum.photos/200/300') | ||
const imagePath = path.join('example.jpg') | ||
const buffer = await image.body() | ||
fs.writeFileSync(imagePath, buffer) | ||
const readFileFromDisk = fs.readFileSync(imagePath) | ||
}) | ||
``` | ||
{{< /tab >}} | ||
{{< /tabs >}} | ||
|
||
Due to this sandbox, certain Node.js variables are adapted to our platform and have values we set for them. The behaviour | ||
is slightly different when creating a browser check in the Web UI or using the Checkly CLI. | ||
|
||
When creating a browser check in the Web UI, the variables are: | ||
|
||
* `__dirname` will have the value of `/` | ||
* `__filename` will have the value of `/script.js` | ||
|
||
When creating a browser check using the Checkly CLI the variables are: | ||
|
||
* `__dirname` will have the value of `/` | ||
* `__filename` will have the value of the actual file in your code base, relative to the project root. |
Oops, something went wrong.