@@ -6,11 +6,11 @@ test.describe('Main page buttons', () => {
66 await page . goto ( '/' ) ;
77 } ) ;
88
9- test ( 'Hero section Get started button' , async ( { page } ) => {
9+ test ( 'Hero section Get started button' , async ( { page, baseURL } ) => {
1010 const getStartedButton = page . getByTestId ( 'hero-block' ) . getByRole ( 'link' , { name : 'Get started' } ) ;
1111 await expect ( getStartedButton ) . toBeVisible ( ) ;
1212 await getStartedButton . click ( ) ;
13- await expect ( page . url ( ) ) . toContain ( ' /docs/getting-started.html' ) ;
13+ expect ( page . url ( ) ) . toContain ( ` ${ baseURL } /docs/getting-started.html` ) ;
1414 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
1515 await expect ( pageTitle ) . toContainText ( 'Get started with Kotlin' ) ;
1616 } ) ;
@@ -22,32 +22,32 @@ test.describe('Main page buttons', () => {
2222 await jetBrainsLink . click ( ) ;
2323 const newPage = await newPagePromise ;
2424 await newPage . waitForLoadState ( ) ;
25- await expect ( newPage . url ( ) ) . toContain ( 'https://www.jetbrains.com/' ) ;
25+ expect ( newPage . url ( ) ) . toContain ( 'https://www.jetbrains.com/' ) ;
2626 } ) ;
2727
2828 test ( 'Kotlin blog button' , async ( { page } ) => {
2929 const blogButton = page . getByRole ( 'link' , { name : 'Kotlin blog' } ) . and ( page . locator ( testSelector ( 'button' ) ) ) ;
3030 await expect ( blogButton ) . toBeVisible ( ) ;
3131 await blogButton . click ( ) ;
32- await expect ( page . url ( ) ) . toContain ( 'https://blog.jetbrains.com/kotlin/' ) ;
32+ expect ( page . url ( ) ) . toContain ( 'https://blog.jetbrains.com/kotlin/' ) ;
3333 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
3434 await expect ( pageTitle ) . toContainText ( 'Kotlin' ) ;
3535 } ) ;
3636
37- test ( 'Why Kotlin Get started button' , async ( { page } ) => {
37+ test ( 'Why Kotlin Get started button' , async ( { page, baseURL } ) => {
3838 const whyKotlinButton = page . getByTestId ( 'why-kotlin-block' ) . getByRole ( 'link' , { name : 'Get started' } ) ;
3939 await expect ( whyKotlinButton ) . toBeVisible ( ) ;
4040 await whyKotlinButton . click ( ) ;
41- await expect ( page . url ( ) ) . toContain ( ' /docs/getting-started.html' ) ;
41+ expect ( page . url ( ) ) . toContain ( ` ${ baseURL } /docs/getting-started.html` ) ;
4242 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
4343 await expect ( pageTitle ) . toContainText ( 'Get started with Kotlin' ) ;
4444 } ) ;
4545
46- test ( 'Learn about Kotlin Multiplatform button' , async ( { page } ) => {
46+ test ( 'Learn about Kotlin Multiplatform button' , async ( { page, baseURL } ) => {
4747 const multiplatformButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Learn about Kotlin Multiplatform' } ) ;
4848 await expect ( multiplatformButton ) . toBeVisible ( ) ;
4949 await multiplatformButton . click ( ) ;
50- await expect ( page . url ( ) ) . toContain ( 'https://kotlinlang.org/ multiplatform/' ) ;
50+ expect ( page . url ( ) ) . toContain ( ` ${ baseURL } / multiplatform/` ) ;
5151 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
5252 await expect ( pageTitle ) . toContainText ( 'Kotlin Multiplatform' ) ;
5353 } ) ;
@@ -56,16 +56,16 @@ test.describe('Main page buttons', () => {
5656 const jetbrainsAIButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Learn about JetBrains AI' } ) ;
5757 await expect ( jetbrainsAIButton ) . toBeVisible ( ) ;
5858 await jetbrainsAIButton . click ( ) ;
59- await expect ( page . url ( ) ) . toContain ( 'https://www.jetbrains.com/ai/' ) ;
59+ expect ( page . url ( ) ) . toContain ( 'https://www.jetbrains.com/ai/' ) ;
6060 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
6161 await expect ( pageTitle ) . toContainText ( 'JetBrains AI' ) ;
6262 } ) ;
6363
64- test ( 'Build AI apps with Kotlin button' , async ( { page } ) => {
64+ test ( 'Build AI apps with Kotlin button' , async ( { page, baseURL } ) => {
6565 const buildAIAppsButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Build AI apps with Kotlin' } ) ;
6666 await expect ( buildAIAppsButton ) . toBeVisible ( ) ;
6767 await buildAIAppsButton . click ( ) ;
68- await expect ( page . url ( ) ) . toContain ( ' /docs/kotlin-ai-apps-development-overview.html' ) ;
68+ expect ( page . url ( ) ) . toContain ( ` ${ baseURL } /docs/kotlin-ai-apps-development-overview.html` ) ;
6969 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
7070 await expect ( pageTitle ) . toContainText ( 'Kotlin for AI-powered app development' ) ;
7171 } ) ;
@@ -74,33 +74,33 @@ test.describe('Main page buttons', () => {
7474 const getStartedKoogButton = page . getByTestId ( 'highlighted-cases-section' ) . getByTestId ( 'kotlin-plus-ai-block' ) . getByRole ( 'link' , { name : 'Get started' } ) ;
7575 await expect ( getStartedKoogButton ) . toBeVisible ( ) ;
7676 await getStartedKoogButton . click ( ) ;
77- await expect ( page . url ( ) ) . toContain ( '/docs.koog.ai/' ) ;
77+ expect ( page . url ( ) ) . toContain ( '/docs.koog.ai/' ) ;
7878 await expect ( page . getByText ( 'Koog on GitHub' ) . first ( ) ) . toBeVisible ( ) ;
7979 } ) ;
8080
81- test ( 'Join the community button' , async ( { page } ) => {
81+ test ( 'Join the community button' , async ( { page, baseURL } ) => {
8282 const joinCommunityButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Join the community' } ) ;
8383 await expect ( joinCommunityButton ) . toBeVisible ( ) ;
8484 await joinCommunityButton . click ( ) ;
8585 await page . waitForTimeout ( 2000 ) ;
86- await expect ( page . url ( ) ) . toContain ( ' /community/' ) ;
86+ expect ( page . url ( ) ) . toContain ( ` ${ baseURL } /community/` ) ;
8787 await expect ( page . getByText ( 'Get involved in the community' ) ) . toBeVisible ( ) ;
8888 } ) ;
8989
9090 test ( 'Learn more button in Kotlin Foundation section' , async ( { page } ) => {
9191 const learnMoreButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Learn more' } ) ;
9292 await expect ( learnMoreButton ) . toBeVisible ( ) ;
9393 await learnMoreButton . click ( ) ;
94- await expect ( page . url ( ) ) . toContain ( 'https://kotlinfoundation.org/' ) ;
94+ expect ( page . url ( ) ) . toContain ( 'https://kotlinfoundation.org/' ) ;
9595 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
9696 await expect ( pageTitle ) . toContainText ( 'Protect, promote and advance the development of the Kotlin programming language' ) ;
9797 } ) ;
9898
99- test ( 'Last Get started button' , async ( { page } ) => {
99+ test ( 'Last Get started button' , async ( { page, baseURL } ) => {
100100 const getStartedButton = page . getByTestId ( 'highlighted-cases-section' ) . getByRole ( 'link' , { name : 'Get started' } ) . last ( ) ;
101101 await expect ( getStartedButton ) . toBeVisible ( ) ;
102102 await getStartedButton . click ( ) ;
103- await expect ( page . url ( ) ) . toContain ( ' /docs/getting-started.html' ) ;
103+ expect ( page . url ( ) ) . toContain ( ` ${ baseURL } /docs/getting-started.html` ) ;
104104 const pageTitle = page . locator ( 'h1' ) . first ( ) ;
105105 await expect ( pageTitle ) . toContainText ( 'Get started with Kotlin' ) ;
106106 } ) ;
0 commit comments