import { LoginPage , BrowsingPage , RepoClient , Utils , AdminActions , UserActions } from '@alfresco/aca-testing-shared' ; import * as testData from './test-data-libraries' ; import * as testUtil from '../test-util' ; describe ( 'Library actions : ' , ( ) => { const username = `user-${ Utils . random ( ) }` ; const userApi = new RepoClient ( username , username ) ; const adminApiActions = new AdminActions ( ) ; const userActions = new UserActions ( ) ; const loginPage = new LoginPage ( ) ; const page = new BrowsingPage ( ) ; beforeAll ( async ( ) => { await adminApiActions . createUser ( { username } ) ; await userApi . sites . createSite ( testData . siteInTrash . name ) ; await userApi . sites . createSite ( testData . site2InTrash . name ) ; await userActions . login ( username , username ) ; await userActions . deleteSites ( [ testData . siteInTrash . name , testData . site2InTrash . name ] , false ) ; await loginPage . loginWith ( username ) ; } ) ; afterAll ( async ( ) => { await userActions . login ( username , username ) ; await userActions . emptyTrashcan ( ) ; } ) ; describe ( 'on Trash' , ( ) => { beforeAll ( async ( ) => { await Utils . pressEscape ( ) ; await page . clickTrashAndWait ( ) ; } ) ; beforeEach ( async ( ) => { await Utils . pressEscape ( ) ; } ) ; it ( '[C326686] single library' , async ( ) => { await testUtil . checkToolbarPrimary ( testData . siteInTrash . name , testData . siteInTrash . trashActions ) ; await testUtil . checkContextMenu ( testData . siteInTrash . name , testData . siteInTrash . trashActions ) ; } ) ; it ( '[C326687] multiple libraries' , async ( ) => { await testUtil . checkMultipleSelContextMenu ( [ testData . siteInTrash . name , testData . site2InTrash . name ] , testData . trashActions ) ; await testUtil . checkMultipleSelToolbarPrimary ( [ testData . siteInTrash . name , testData . site2InTrash . name ] , testData . trashActions ) ; } ) ; } ) ; } ) ;