🧪 Add checkly

This commit is contained in:
ajnart
2023-05-16 15:25:32 +09:00
parent 052a8c9489
commit 841cd6ab28
6 changed files with 39116 additions and 9025 deletions

18
__checks__/api.check.ts Normal file
View 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(),
],
}
})

View 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' })
})