import { AdminActions , LoginPage , BrowsingPage , RepoClient , Utils } from '@alfresco/aca-testing-shared' ; describe ( 'Upload files' , ( ) => { const username = `user-${ Utils . random ( ) }` ; const folder1 = `folder1-${ Utils . random ( ) }` ; let folder1Id ; const apis = { user : new RepoClient ( username , username ) } ; const loginPage = new LoginPage ( ) ; const page = new BrowsingPage ( ) ; const { dataTable } = page ; const adminApiActions = new AdminActions ( ) ; beforeAll ( async ( done ) => { await adminApiActions . createUser ( { username } ) ; folder1Id = ( await apis . user . nodes . createFolder ( folder1 ) ) . entry . id ; await loginPage . loginWith ( username ) ; done ( ) ; } ) ; beforeEach ( async ( done ) => { await page . clickPersonalFilesAndWait ( ) ; done ( ) ; } ) ; afterAll ( async ( done ) => { await apis . user . nodes . deleteNodeById ( folder1Id ) ; done ( ) ; } ) ; it ( 'Upload a file' , async ( ) => { await dataTable . doubleClickOnRowByName ( folder1 ) ; await page . sidenav . openNewMenu ( ) ; await page . sidenav . menu . uploadFilesInput . sendKeys ( `${ __dirname }/upload-file.test.ts` ) ; expect ( await dataTable . isItemPresent ( 'upload-file.test.ts' ) ) . toBe ( true , 'file not uploaded' ) ; } ) ; } ) ;