🧪 Add checkly
This commit is contained in:
18
__checks__/api.check.ts
Normal file
18
__checks__/api.check.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ApiCheck, AssertionBuilder } from 'checkly/constructs'
|
||||
|
||||
new ApiCheck('homepage-api-check-1', {
|
||||
name: 'Fetch Book List',
|
||||
alertChannels: [],
|
||||
degradedResponseTime: 10000,
|
||||
maxResponseTime: 20000,
|
||||
request: {
|
||||
url: 'https://danube-web.shop/api/books',
|
||||
method: 'GET',
|
||||
followRedirects: true,
|
||||
skipSSL: false,
|
||||
assertions: [
|
||||
AssertionBuilder.statusCode().equals(200),
|
||||
AssertionBuilder.jsonBody('$[0].id').isNotNull(),
|
||||
],
|
||||
}
|
||||
})
|
||||
11
__checks__/homepage.spec.ts
Normal file
11
__checks__/homepage.spec.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { test, expect } from '@playwright/test'
|
||||
|
||||
// You can override the default Playwright test timeout of 30s
|
||||
// test.setTimeout(60_000);
|
||||
|
||||
test('Checkly Homepage', async ({ page }) => {
|
||||
const response = await page.goto('https://danube-web.shop')
|
||||
expect(response?.status()).toBeLessThan(400)
|
||||
await expect(page).toHaveTitle(/Danube WebShop/)
|
||||
await page.screenshot({ path: 'homepage.jpg' })
|
||||
})
|
||||
Reference in New Issue
Block a user