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