import { PlaywrightFluent } from '../../playwright-fluent' ; import { sleep } from '../../../utils/sleep' ; describe ( 'Playwright Fluent - close' , ( ) : void => { beforeEach ( ( ) : void => { } ) ; test ( 'should close firefox' , async ( ) : Promise < void > => { const browser = 'firefox' ; const p = new PlaywrightFluent ( ) ; await p . withBrowser ( browser ) ; let createdBrowser = p . currentBrowser ( ) ; const previousConnectedStatus = createdBrowser && createdBrowser . isConnected ( ) ; await sleep ( 1000 ) ; await p . close ( ) ; await sleep ( 1000 ) ; createdBrowser = p . currentBrowser ( ) ; const currentConnectedStatus = createdBrowser && createdBrowser . isConnected ( ) ; expect ( createdBrowser ) . toBeDefined ( ) ; expect ( previousConnectedStatus ) . toBe ( true ) ; expect ( currentConnectedStatus ) . toBe ( false ) ; } ) ; } ) ;