-
Notifications
You must be signed in to change notification settings - Fork 14
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 nahuelon/gh-800/deps-bad-reference-error
- Loading branch information
Showing
73 changed files
with
1,021 additions
and
294 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
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
21 changes: 21 additions & 0 deletions
21
examples/advanced-project-js/src/__checks__/multi-step-spacex.check.js
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,21 @@ | ||
import * as path from 'path' | ||
import { MultiStepCheck } from 'checkly/constructs' | ||
import { smsChannel, emailChannel } from '../alert-channels' | ||
|
||
const alertChannels = [smsChannel, emailChannel] | ||
|
||
/* | ||
* In this example, we utilize the SpaceX public API to construct a series of chained requests, with the goal of confirming | ||
* that the capsules retrieved from the main endpoint match those obtained from the individual capsule endpoint. | ||
* Read more in our documentation https://www.checklyhq.com/docs/multistep-checks/ | ||
*/ | ||
|
||
// We can define multiple checks in a single *.check.js file. | ||
new MultiStepCheck('spacex-multistep-check', { | ||
name: 'SpaceX MS', | ||
runtimeId: '2023.09', | ||
alertChannels, | ||
code: { | ||
entrypoint: path.join(__dirname, 'spacex-requests.spec.js') | ||
}, | ||
}) |
29 changes: 29 additions & 0 deletions
29
examples/advanced-project-js/src/__checks__/spacex-requests.spec.js
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,29 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
const baseUrl = 'https://api.spacexdata.com/v3' | ||
|
||
test('space-x dragon capsules', async ({ request }) => { | ||
/** | ||
* Get all SpaceX Dragon Capsules | ||
*/ | ||
const [first] = await test.step('get all capsules', async () => { | ||
const response = await request.get(`${baseUrl}/dragons`) | ||
expect(response).toBeOK() | ||
|
||
const data = await response.json() | ||
expect(data.length).toBeGreaterThan(0) | ||
|
||
return data | ||
}) | ||
|
||
/** | ||
* Get a single Dragon Capsule | ||
*/ | ||
await test.step('get single dragon capsule', async () => { | ||
const response = await request.get(`${baseUrl}/dragons/${first.id}`) | ||
expect(response).toBeOK() | ||
|
||
const dragonCapsule = await response.json() | ||
expect(dragonCapsule.name).toEqual(first.name) | ||
}) | ||
}) |
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
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
21 changes: 21 additions & 0 deletions
21
examples/advanced-project/src/__checks__/multi-step-spacex.check.ts
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,21 @@ | ||
import * as path from 'path' | ||
import { MultiStepCheck } from 'checkly/constructs' | ||
import { smsChannel, emailChannel } from '../alert-channels' | ||
|
||
const alertChannels = [smsChannel, emailChannel] | ||
|
||
/* | ||
* In this example, we utilize the SpaceX public API to construct a series of chained requests, with the goal of confirming | ||
* that the capsules retrieved from the main endpoint match those obtained from the individual capsule endpoint. | ||
* Read more in our documentation https://www.checklyhq.com/docs/multistep-checks/ | ||
*/ | ||
|
||
// We can define multiple checks in a single *.check.ts file. | ||
new MultiStepCheck('spacex-multistep-check', { | ||
name: 'SpaceX MS', | ||
runtimeId: '2023.09', | ||
alertChannels, | ||
code: { | ||
entrypoint: path.join(__dirname, 'spacex-requests.spec.ts') | ||
}, | ||
}) |
29 changes: 29 additions & 0 deletions
29
examples/advanced-project/src/__checks__/spacex-requests.spec.ts
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,29 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
const baseUrl = 'https://api.spacexdata.com/v3' | ||
|
||
test('space-x dragon capsules', async ({ request }) => { | ||
/** | ||
* Get all SpaceX Dragon Capsules | ||
*/ | ||
const [first] = await test.step('get all capsules', async () => { | ||
const response = await request.get(`${baseUrl}/dragons`) | ||
expect(response).toBeOK() | ||
|
||
const data = await response.json() | ||
expect(data.length).toBeGreaterThan(0) | ||
|
||
return data | ||
}) | ||
|
||
/** | ||
* Get a single Dragon Capsule | ||
*/ | ||
await test.step('get single dragon capsule', async () => { | ||
const response = await request.get(`${baseUrl}/dragons/${first.id}`) | ||
expect(response).toBeOK() | ||
|
||
const dragonCapsule = await response.json() | ||
expect(dragonCapsule.name).toEqual(first.name) | ||
}) | ||
}) |
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
Oops, something went wrong.