import { AdminActions , LoginPage , BrowsingPage , RepoClient , InfoDrawer , Utils } from '@alfresco/aca-testing-shared' ; import { BrowserActions } from '@alfresco/adf-testing' ; describe ( 'General' , ( ) => { const username = `user1-${ Utils . random ( ) }` ; const parent = `parent-${ Utils . random ( ) }` ; let parentId ; const file1 = `file1-${ Utils . random ( ) }.txt` ; const folder1 = `folder1-${ Utils . random ( ) }` ; const apis = { user : new RepoClient ( username , username ) } ; const infoDrawer = new InfoDrawer ( ) ; const loginPage = new LoginPage ( ) ; const page = new BrowsingPage ( ) ; const { dataTable } = page ; const adminApiActions = new AdminActions ( ) ; beforeAll ( async ( done ) => { await adminApiActions . createUser ( { username } ) ; parentId = ( await apis . user . nodes . createFolder ( parent ) ) . entry . id ; await apis . user . nodes . createFile ( file1 , parentId ) ; await apis . user . nodes . createFolder ( folder1 , parentId ) ; await loginPage . loginWith ( username ) ; done ( ) ; } ) ; afterAll ( async ( done ) => { await apis . user . nodes . deleteNodeById ( parentId ) ; done ( ) ; } ) ; beforeEach ( async ( done ) => { await page . clickPersonalFilesAndWait ( ) ; await dataTable . doubleClickOnRowByName ( parent ) ; done ( ) ; } ) ; afterEach ( async ( done ) => { if ( await infoDrawer . isOpen ( ) ) { await BrowserActions . click ( page . toolbar . viewDetailsButton ) ; } done ( ) ; } ) ; it ( '[C268999] Info drawer closes on page refresh' , async ( ) => { await dataTable . selectItem ( file1 ) ; await BrowserActions . click ( page . toolbar . viewDetailsButton ) ; expect ( await infoDrawer . isOpen ( ) ) . toBe ( true , 'Info drawer not open' ) ; await page . refresh ( ) ; await dataTable . waitForBody ( ) ; expect ( await infoDrawer . isOpen ( ) ) . toBe ( false , 'Info drawer open' ) ; } ) ; } ) ;