1- import { test , expect } from '@playwright/test' ;
1+ import { expect , test } from '@playwright/test' ;
2+ import { testSelector } from '../utils' ;
23
34test . describe ( 'Main page buttons' , ( ) => {
45 test . beforeEach ( async ( { page } ) => {
@@ -27,12 +28,12 @@ test.describe('Main page buttons', () => {
2728 } ) ;
2829
2930 test ( 'Kotlin blog button' , async ( { page } ) => {
30- const blogButton = page . getByTestId ( 'why-kotlin-block' ) . getByRole ( 'link' , { name : 'Kotlin blog' } ) ;
31+ const blogButton = page . locator ( testSelector ( 'button' ) ) . getByRole ( 'link' , { name : 'Kotlin blog' } ) ;
3132 await expect ( blogButton ) . toBeVisible ( ) ;
3233 await blogButton . click ( ) ;
3334 await expect ( page . url ( ) ) . toContain ( 'https://blog.jetbrains.com/kotlin/' ) ;
3435 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
35- await expect ( pageTitle ) . toContainText ( 'Kotlin' )
36+ await expect ( pageTitle ) . toContainText ( 'Kotlin' ) ;
3637 } ) ;
3738
3839 test ( 'Why Kotlin Get started button' , async ( { page } ) => {
@@ -54,28 +55,28 @@ test.describe('Main page buttons', () => {
5455 } ) ;
5556
5657 test ( 'Learn about JetBrains AI button' , async ( { page } ) => {
57- const jetbrainsAIButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Learn about JetBrains AI' } )
58+ const jetbrainsAIButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Learn about JetBrains AI' } ) ;
5859 await expect ( jetbrainsAIButton ) . toBeVisible ( ) ;
5960 await jetbrainsAIButton . click ( ) ;
6061 await expect ( page . url ( ) ) . toContain ( 'https://www.jetbrains.com/ai/' ) ;
61- const pageTitle = page . locator ( 'h1' ) . first ( )
62+ const pageTitle = page . locator ( 'h1' ) . first ( ) ;
6263 await expect ( pageTitle ) . toContainText ( 'JetBrains AI' ) ;
6364 } ) ;
6465
6566 test ( 'Build AI apps with Kotlin button' , async ( { page } ) => {
66- const buildAIAppsButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Build AI apps with Kotlin' } )
67+ const buildAIAppsButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Build AI apps with Kotlin' } ) ;
6768 await expect ( buildAIAppsButton ) . toBeVisible ( ) ;
6869 await buildAIAppsButton . click ( ) ;
6970 await expect ( page . url ( ) ) . toContain ( '/docs/kotlin-ai-apps-development-overview.html' ) ;
70- const pageTitle = page . locator ( 'h1' ) . first ( )
71+ const pageTitle = page . locator ( 'h1' ) . first ( ) ;
7172 await expect ( pageTitle ) . toContainText ( 'Kotlin for AI-powered app development' ) ;
7273 } ) ;
7374
7475 test ( 'Get started in AI section' , async ( { page } ) => {
7576 const getStartedKoogButton = page . getByTestId ( 'highlighted-cases-section' ) . getByTestId ( 'kotlin-plus-ai-block' ) . getByRole ( 'link' , { name : 'Get started' } ) ;
7677 await expect ( getStartedKoogButton ) . toBeVisible ( ) ;
7778 await getStartedKoogButton . click ( ) ;
78- await expect ( page . url ( ) ) . toContain ( '/docs.koog.ai/' )
79+ await expect ( page . url ( ) ) . toContain ( '/docs.koog.ai/' ) ;
7980 await expect ( page . getByText ( 'Koog on GitHub' ) . first ( ) ) . toBeVisible ( ) ;
8081 } ) ;
8182
0 commit comments