Skip to content

Commit d1ff212

Browse files
working check group
1 parent 7138bec commit d1ff212

8 files changed

Lines changed: 152 additions & 1 deletion

File tree

.env.prod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Created by Checkly CLI
2+
# Environment variables
3+
prod-base-url=https://danube-web.shop/
4+
# Secret variables
5+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { AlertEscalationBuilder, BrowserCheck, RetryStrategyBuilder } from 'checkly/constructs'
2+
import { prodShopGroup } from '../../check-group/prod-eshop/prod-eshop.check'
3+
4+
new BrowserCheck('browse-add-to-cart-v3', {
5+
name: 'Browse and Add to cart',
6+
code: {
7+
entrypoint: './browse.spec.ts',
8+
},
9+
activated: true,
10+
muted: false,
11+
shouldFail: false,
12+
frequency: 120,
13+
group: prodShopGroup,
14+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
15+
amount: 0,
16+
interval: 5,
17+
}, {
18+
enabled: false,
19+
percentage: 10,
20+
}),
21+
retryStrategy: RetryStrategyBuilder.linearStrategy({
22+
baseBackoffSeconds: 60,
23+
maxRetries: 2,
24+
maxDurationSeconds: 600,
25+
sameRegion: true,
26+
}),
27+
runParallel: true,
28+
})
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { test, expect, type Page } from '@playwright/test';
2+
3+
test.describe.configure({ mode: 'serial' });
4+
5+
let page: Page;
6+
7+
test.beforeAll(async ({ browser }) => {
8+
page = await browser.newPage();
9+
});
10+
11+
test.afterAll(async () => {
12+
await page.close();
13+
});
14+
15+
test('runs first', async () => {
16+
await page.goto('https://danube-webshop.herokuapp.com/');
17+
await page.getByText('Celsius').click();
18+
await expect(page.locator('#app-content')).toContainText('Genre: scifi');
19+
});
20+
21+
test('runs second', async () => {
22+
await expect(page.locator('#app-content')).toContainText('Left in stock: 1');
23+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { AlertEscalationBuilder, BrowserCheck, RetryStrategyBuilder } from 'checkly/constructs'
2+
import { prodShopGroup } from '../../check-group/prod-eshop/prod-eshop.check'
3+
4+
new BrowserCheck('checkout-v3', {
5+
name: 'Checkout',
6+
code: {
7+
entrypoint: './checkout.spec.ts',
8+
},
9+
activated: true,
10+
muted: false,
11+
shouldFail: false,
12+
frequency: 120,
13+
group: prodShopGroup,
14+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
15+
amount: 0,
16+
interval: 5,
17+
}, {
18+
enabled: false,
19+
percentage: 10,
20+
}),
21+
retryStrategy: RetryStrategyBuilder.linearStrategy({
22+
baseBackoffSeconds: 60,
23+
maxRetries: 2,
24+
maxDurationSeconds: 600,
25+
sameRegion: true,
26+
}),
27+
runParallel: true,
28+
})
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test(`ordering a book`, async ({ page }) => {
4+
await page.goto('https://danube-webshop.herokuapp.com/');
5+
await page.getByText('Business').click();
6+
await page.locator('a').filter({ hasText: 'Crime & Thrillers' }).click();
7+
await page.getByRole('textbox').click();
8+
await page.getByRole('textbox').fill('parry');
9+
await page.getByRole('button', { name: 'Search' }).click();
10+
await page.getByRole('button', { name: 'Log in' }).click();
11+
await page.getByRole('textbox', { name: 'Email' }).click();
12+
await page.getByRole('textbox', { name: 'Email' }).fill('nica@checklyhq.com');
13+
await page.getByRole('textbox', { name: 'Email' }).press('Tab');
14+
await page.getByRole('textbox', { name: 'Password' }).fill('12345');
15+
await page.getByRole('button', { name: 'Sign In' }).click();
16+
17+
})
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { AlertEscalationBuilder, BrowserCheck, RetryStrategyBuilder } from 'checkly/constructs'
2+
import { prodShopGroup } from '../../check-group/prod-eshop/prod-eshop.check'
3+
4+
new BrowserCheck('navigate-eshop-v3', {
5+
name: 'Navigate eShop',
6+
code: {
7+
entrypoint: './navigate-eshop.spec.ts',
8+
},
9+
activated: true,
10+
muted: false,
11+
shouldFail: false,
12+
frequency: 120,
13+
group: prodShopGroup,
14+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
15+
amount: 0,
16+
interval: 5,
17+
}, {
18+
enabled: false,
19+
percentage: 10,
20+
}),
21+
retryStrategy: RetryStrategyBuilder.linearStrategy({
22+
baseBackoffSeconds: 60,
23+
maxRetries: 2,
24+
maxDurationSeconds: 600,
25+
sameRegion: true,
26+
}),
27+
runParallel: true,
28+
})
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test.setTimeout(210000)
4+
5+
6+
test.use({ actionTimeout: 10000 })
7+
8+
test('navigate around shop site', async ({ page }) => {
9+
await page.goto('https://danube-webshop.herokuapp.com/');
10+
await page.getByText('Business').click();
11+
await page.locator('a').filter({ hasText: 'Crime & Thrillers' }).click();
12+
await page.getByRole('textbox').click();
13+
await page.getByRole('textbox').fill('parry');
14+
await page.getByRole('button', { name: 'Search' }).click();
15+
await page.getByRole('button', { name: 'Log in' }).click();
16+
await page.getByRole('textbox', { name: 'Email' }).click();
17+
await page.getByRole('textbox', { name: 'Email' }).fill('nica@checklyhq.com');
18+
await page.getByRole('textbox', { name: 'Email' }).press('Tab');
19+
await page.getByRole('textbox', { name: 'Password' }).fill('12345');
20+
await page.getByRole('button', { name: 'Sign In' }).click();
21+
22+
})

ignoreplz/one-page-for-two-tests/one-page-for-two-tests.check.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AlertEscalationBuilder, BrowserCheck, RetryStrategyBuilder } from 'checkly/constructs'
2-
import { prodShopGroup } from '../check-group/prod-eshop/prod-eshop.check'
2+
import { prodShopGroup } from '../../__checks__/check-group/prod-eshop/prod-eshop.check'
33

44
new BrowserCheck('one-page-for-two-tests-s8oAhPqb', {
55
name: 'One Page for Two Tests',

0 commit comments

Comments
 (0)