File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11// @ts -check
22import { test , expect } from "./fixtures.js" ;
33
4- test ( "sitemap" , async ( { page, config } ) => {
5- const response = await page . goto ( config . baseURL + "/sitemap.xml" ) ;
4+ test ( "sitemap" , async ( { request, config } ) => {
5+ // Use request API with XML Accept header to get raw XML instead of HTML
6+ const response = await request . get ( config . baseURL + "/sitemap.xml" , {
7+ headers : {
8+ Accept : "application/xml, text/xml" ,
9+ } ,
10+ } ) ;
611 expect ( response . status ( ) ) . toBe ( 200 ) ;
712 expect ( response . headers ( ) [ "content-type" ] ) . toContain ( "xml" ) ;
8- const content = await page . content ( ) ;
13+ const content = await response . text ( ) ;
914 expect ( content ) . toContain ( "<urlset" ) ;
1015 expect ( content ) . toContain ( "<url>" ) ;
1116 expect ( content ) . toContain ( "<loc>" ) ;
You can’t perform that action at this time.
0 commit comments