Skip to content

Commit 0ce9260

Browse files
authored
Merge pull request #4957 from JetBrains/autotests_solutions_tab
Add Playwright tests for Solutions tab.
2 parents 151ae1a + 98f514f commit 0ce9260

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

test/production/play-tab.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test, expect } from '@playwright/test';
22

3-
test.describe('Solutions tab functionality', () => {
3+
test.describe('Play tab', () => {
44
test.beforeEach(async ({ page }) => {
55
await page.goto('/');
66
await page.waitForSelector('button.ch2-btn.ch2-btn-primary');

test/production/solutions-tab.spec.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test.describe('Solutions tab', () => {
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('Solutions');
10+
await expect(solutionsButton).toBeVisible();
11+
await solutionsButton.click();
12+
});
13+
14+
test('Click on "Multiplatform" button should open the related page', async ({ page }) => {
15+
const multiplatformButton = page.getByText('Multiplatform').first();
16+
await expect(multiplatformButton).toBeVisible();
17+
await multiplatformButton.click();
18+
await expect(page.url()).toContain('https://www.jetbrains.com/kotlin-multiplatform/');
19+
});
20+
21+
test('Click on "Server-side" button should open the related page', async ({ page }) => {
22+
const serverSideButton = page.getByText('Server-side').first();
23+
await expect(serverSideButton).toBeVisible();
24+
await serverSideButton.click();
25+
await expect(page.url()).toContain('/lp/server-side/');
26+
});
27+
28+
test('Click on "Data science" button should open the related page', async ({ page }) => {
29+
const dataScienceButton = page.getByText('Data science');
30+
await expect(dataScienceButton).toBeVisible();
31+
await dataScienceButton.click();
32+
// We need a timeout here because of redirect to another URL.
33+
await page.waitForTimeout(2000);
34+
await expect(page.url()).toContain('/docs/data-analysis-overview.html');
35+
});
36+
37+
test('Click on "Android" button should open the related page', async ({ page }) => {
38+
const androidButton = page.getByText('Android').first();
39+
await expect(androidButton).toBeVisible();
40+
await androidButton.click();
41+
await expect(page.url()).toContain('/docs/android-overview.html');
42+
});
43+
});

0 commit comments

Comments
 (0)