@@ -55,7 +55,7 @@ test.describe('Server-Side landing page', async () => {
5555 await expect ( serverSidePage . heroCaseStudiesLink ) . toBeVisible ( ) ;
5656 await serverSidePage . heroCaseStudiesLink . click ( ) ;
5757
58- expect ( page . url ( ) ) . toContain ( '/lp/server-side/ case-studies/' ) ;
58+ expect ( page . url ( ) ) . toContain ( '/case-studies/?type=server-side ' ) ;
5959 } ) ;
6060
6161 test ( 'Server-side: check Ktor get started link' , async ( { page } ) => {
@@ -66,7 +66,7 @@ test.describe('Server-Side landing page', async () => {
6666 await expect ( serverSidePage . ktorGetStartedLink ) . toBeVisible ( ) ;
6767 await serverSidePage . ktorGetStartedLink . click ( ) ;
6868
69- // the url is hardcoded due to reditect
69+ // the url is hardcoded due to redirect
7070 const ktorGetStartedLinkURL = 'https://ktor.io/docs/welcome.html' ;
7171
7272 await page . waitForURL ( url => url . toString ( ) . includes ( ktorGetStartedLinkURL ) ) ;
@@ -109,11 +109,18 @@ test.describe('Server-Side landing page', async () => {
109109
110110 await newPage . waitForLoadState ( ) ;
111111
112- const originalDomain = new URL ( customerLinkURL ) . hostname ;
112+ // Handle both relative and absolute URLs
113+ const baseURL = 'https://kotlinlang.org' ;
114+ const fullURL = customerLinkURL . startsWith ( 'http' )
115+ ? customerLinkURL
116+ : new URL ( customerLinkURL , baseURL ) . toString ( ) ;
117+
118+ const originalDomain = new URL ( fullURL ) . hostname ;
113119 const finalDomain = new URL ( newPage . url ( ) ) . hostname ;
114120
115121 if ( originalDomain === finalDomain ) {
116- expect ( newPage . url ( ) ) . toContain ( customerLinkURL ) ;
122+ const expectedPath = new URL ( fullURL ) . pathname ;
123+ expect ( newPage . url ( ) ) . toContain ( expectedPath ) ;
117124 }
118125
119126 await newPage . close ( ) ;
@@ -133,4 +140,4 @@ test.describe('Server-Side landing page', async () => {
133140
134141 expect ( page . url ( ) ) . toContain ( downloadIdeaButtonURL ) ;
135142 } ) ;
136- } ) ;
143+ } ) ;
0 commit comments