import * as SUT from '../../playwright-fluent' ; describe ( 'Playwright Fluent - expect does not have class' , ( ) : void => { let p ; beforeEach ( ( ) : void => { p = new SUT . PlaywrightFluent ( ) ; } ) ; afterEach ( async ( ) : Promise < void > => { await p . close ( ) ; } ) ; test ( 'should give back an error on expectThat.doesNotHaveClass when browser has not been launched' , async ( ) : Promise < void > => { let result = undefined ; try { await p . expectThatSelector ( 'foo' ) . doesNotHaveClass ( 'bar' ) ; } catch ( error ) { result = error as Error ; } expect ( result && result . message ) . toContain ( "Cannot check that 'foo' does not have class 'bar' because no browser has been launched" ) ; } ) ; test ( 'should give back an error on expectThat(selector-fluent).doesNotHaveClass when browser has not been launched' , async ( ) : Promise < void > => { const selector = p . selector ( 'foo' ) ; let result = undefined ; try { await p . expectThat ( selector ) . doesNotHaveClass ( 'bar' ) ; } catch ( error ) { result = error as Error ; } expect ( result && result . message ) . toContain ( "Cannot check that 'selector(foo)' does not have class 'bar' because no browser has been launched" ) ; } ) ; } ) ;