|
| 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