Skip to content

Commit 42fa7a3

Browse files
committed
Add Playwright tests for Play tab.
1 parent a28d47e commit 42fa7a3

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/production/play-tab.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test.describe('Solutions tab functionality', () => {
4+
test.beforeEach(async ({ page }) => {
5+
await page.goto('/');
6+
await page.waitForSelector('button.ch2-btn.ch2-btn-primary');
7+
await page.click('button.ch2-btn.ch2-btn-primary');
8+
const navbar = page.locator('[data-test="header"]');
9+
const solutionsButton = navbar.getByText('Play').first();
10+
await expect(solutionsButton).toBeVisible();
11+
await solutionsButton.click();
12+
});
13+
14+
test('Click on "Play" button should open the related page', async ({ page }) => {
15+
const multiplatformButton = page.getByText('Playground').first();
16+
await expect(multiplatformButton).toBeVisible();
17+
await multiplatformButton.click();
18+
await expect(page.url()).toContain('https://play.kotlinlang.org/');
19+
});
20+
21+
test('Click on "Examples" button should open the related page', async ({ page }) => {
22+
const multiplatformButton = page.getByText('Examples').first();
23+
await expect(multiplatformButton).toBeVisible();
24+
await multiplatformButton.click();
25+
await expect(page.url()).toContain('https://play.kotlinlang.org/byExample');
26+
27+
});
28+
29+
test('Click on "Koans" button should open the related page', async ({ page }) => {
30+
const multiplatformButton = page.getByText('Koans');
31+
await expect(multiplatformButton).toBeVisible();
32+
await multiplatformButton.click();
33+
await expect(page.url()).toContain('https://play.kotlinlang.org/koans');
34+
});
35+
});

0 commit comments

Comments
 (0)