import { PlaywrightFluent } from '../../playwright-fluent' ; import { toRequestInfo } from '../../../utils' ; describe ( 'Playwright Fluent - withExtraHttpHeaders' , ( ) : void => { let p ; beforeEach ( ( ) : void => { p = new PlaywrightFluent ( ) ; } ) ; afterEach ( async ( ) : Promise < void > => { await p . close ( ) ; } ) ; test ( 'should set headers - firefox' , async ( ) : Promise < void > => { const browser = 'firefox' ; const url = 'https://reactstrap.github.io' ; await p . withBrowser ( browser ) . withOptions ( { headless : false } ) . withExtraHttpHeaders ( { 'X-FOO' : 'false' , 'X-BAR' : 'true' } ) . recordRequestsTo ( '/reactstrap.github.io' ) . navigateTo ( url ) ; const requests = await p . getRecordedRequestsTo ( url ) ; const firstRequest = requests [ 0 ] ; const request = await toRequestInfo ( firstRequest ) ; expect ( request . headers ) . toMatchObject ( { 'x-foo' : 'false' , 'x-bar' : 'true' } ) ; } ) ; } ) ;