[AAE-8147] e2e jasmine callbacks removal (#2490)

* [AAE-8147] e2e jasmine callbacks removal

* trigger travis
This commit is contained in:
rafalszmit 2022-03-30 16:20:13 +02:00 committed by GitHub
parent 31d677c12d
commit 9f0f4cc61f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 199 additions and 409 deletions

View File

@ -49,7 +49,7 @@ describe('Files - available actions : ', () => {
const { searchInput } = page.header;
const searchResultsPage = new SearchResultsPage();
beforeAll(async (done) => {
beforeAll(async () => {
try {
await adminApiActions.createUser({ username });
@ -71,7 +71,6 @@ describe('Files - available actions : ', () => {
} catch (error) {
Logger.error(`----- beforeEach failed : ${error}`);
}
done();
});
afterAll(async () => {

View File

@ -40,7 +40,7 @@ describe('Library actions : ', () => {
const searchResultsPage = new SearchResultsPage();
const { searchInput } = searchResultsPage.header;
beforeAll(async (done) => {
beforeAll(async () => {
try {
await adminApiActions.createUser({ username });
@ -72,7 +72,6 @@ describe('Library actions : ', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
afterAll(async () => {

View File

@ -42,7 +42,7 @@ describe('New menu', () => {
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await adminApiActions.sites.createSite(siteAdmin);
await adminApiActions.sites.addSiteMember(siteAdmin, username, SITE_ROLES.SITE_CONSUMER.ROLE);
@ -50,18 +50,15 @@ describe('New menu', () => {
await apis.user.sites.createSite(siteUser);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.sites.deleteSite(siteUser);
await adminApiActions.sites.deleteSite(siteAdmin);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await sidenav.closeNewMenu();
done();
});
it('[C286524] Actions in Personal Files', async () => {

View File

@ -125,7 +125,7 @@ describe('Copy content', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
try {
await adminApiActions.createUser({ username });
@ -225,7 +225,6 @@ describe('Copy content', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {

View File

@ -67,7 +67,7 @@ describe('Move content', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await apis.user.sites.createSite(siteName);
@ -90,10 +90,9 @@ describe('Move content', () => {
destinationIdFav = (await apis.user.nodes.createFolder(destinationFav)).entry.id;
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodeById(sourceIdPF);
await apis.user.nodes.deleteNodeById(sourceIdRF);
await apis.user.nodes.deleteNodeById(sourceIdSF);
@ -103,7 +102,6 @@ describe('Move content', () => {
await apis.user.nodes.deleteNodeById(destinationIdSF);
await apis.user.nodes.deleteNodeById(destinationIdFav);
await apis.user.sites.deleteSite(siteName);
done();
});
describe('from Personal Files', () => {
@ -130,7 +128,7 @@ describe('Move content', () => {
const file2InFolder = `file2InFolder-${Utils.random()}.txt`;
const file3InFolder = `file3InFolder-${Utils.random()}.txt`;
beforeAll(async (done) => {
beforeAll(async () => {
await apis.user.nodes.createFile(file1, sourceIdPF);
folder1Id = (await apis.user.nodes.createFolder(folder1, sourceIdPF)).entry.id;
@ -150,15 +148,12 @@ describe('Move content', () => {
await apis.user.nodes.createFile(file4, sourceIdPF);
folder2Id = (await apis.user.nodes.createFolder(folder2, sourceIdPF)).entry.id;
await apis.user.nodes.createFile(fileInFolder2, folder2Id);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(sourcePF);
done();
});
it('[C217316] Move a file', async () => {
@ -300,7 +295,7 @@ describe('Move content', () => {
const existingFile = `existing-${Utils.random()}`;
beforeAll(async (done) => {
beforeAll(async () => {
await apis.user.nodes.createFile(file1, sourceIdRF);
await apis.user.nodes.createFile(file2, sourceIdRF);
await apis.user.nodes.createFile(file3, sourceIdRF);
@ -309,13 +304,11 @@ describe('Move content', () => {
await apis.user.nodes.createFile(file4, sourceIdRF);
await apis.user.search.waitForApi(username, { expect: 16 });
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickRecentFilesAndWait();
done();
});
it('[C280230] Move a file', async () => {
@ -418,7 +411,7 @@ describe('Move content', () => {
const existingFile = `existing-${Utils.random()}`;
let existingFileId;
beforeAll(async (done) => {
beforeAll(async () => {
file1Id = (await apis.user.nodes.createFile(file1, sourceIdSF)).entry.id;
await userActions.login(username, username);
@ -435,8 +428,6 @@ describe('Move content', () => {
file4Id = (await apis.user.nodes.createFile(file4, sourceIdSF)).entry.id;
await userActions.shareNodes([file4Id]);
await apis.user.shared.waitForFilesToBeShared([file1Id, file2Id, file3Id, existingFileId, file4Id]);
done();
});
beforeEach(async () => {
@ -557,7 +548,7 @@ describe('Move content', () => {
const file2InFolder = `file2InFolder-${Utils.random()}.txt`;
const file3InFolder = `file3InFolder-${Utils.random()}.txt`;
beforeAll(async (done) => {
beforeAll(async () => {
file1Id = (await apis.user.nodes.createFile(file1, sourceIdFav)).entry.id;
await apis.user.favorites.addFavoriteById('file', file1Id);
@ -587,14 +578,11 @@ describe('Move content', () => {
await apis.user.favorites.addFavoriteById('folder', folder2Id);
await apis.user.favorites.waitForApi({ expect: 9 });
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickFavoritesAndWait();
done();
});
it('[C280256] Move a file', async () => {

View File

@ -111,7 +111,7 @@ describe('Create file from template', () => {
};
let link: string;
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
@ -122,7 +122,6 @@ describe('Create file from template', () => {
await userApi.nodes.createFile(duplicateFileSite, docLibUserSite);
await loginPage.loginWith(username);
done();
});
afterAll(async () => {

View File

@ -67,7 +67,7 @@ describe('Create folder', () => {
await createDialog.waitForDialogToOpen();
}
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -78,24 +78,20 @@ describe('Create folder', () => {
await apis.user.nodes.createFolder(duplicateFolderSite, docLibUserSite);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.sites.deleteSite(siteName);
await apis.user.nodes.deleteNodeById(parentId);
done();
});
describe('on Personal Files', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
done();
});
it('[C216341] creates new folder with name', async () => {
@ -108,7 +104,7 @@ describe('Create folder', () => {
expect(await dataTable.isItemPresent(folderName1)).toBe(true, 'Folder not displayed in list view');
});
it('[C216340] creates new folder with name and description', async (done) => {
it('[C216340] creates new folder with name and description', async () => {
await openCreateFolderDialog(parent);
await createDialog.enterName(folderName2);
await createDialog.enterDescription(folderDescription);
@ -119,7 +115,6 @@ describe('Create folder', () => {
expect(await dataTable.isItemPresent(folderName2)).toBe(true, 'Folder not displayed');
const desc = await apis.user.nodes.getNodeDescription(folderName2, parentId);
expect(desc).toEqual(folderDescription);
done();
});
it('[C216345] dialog UI elements', async () => {
@ -200,14 +195,12 @@ describe('Create folder', () => {
describe('on File Libraries', () => {
const fileLibrariesPage = new BrowsingPage();
beforeEach(async (done) => {
beforeEach(async () => {
await fileLibrariesPage.goToMyLibrariesAndWait();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
done();
});
it('[C280394] creates new folder with name and description', async () => {

View File

@ -69,26 +69,23 @@ describe('Create library', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await apis.user.sites.createSite(duplicateSite.name, SITE_VISIBILITY.PRIVATE, '', duplicateSite.id);
await apis.user.sites.createSite(siteInTrash.name, SITE_VISIBILITY.PUBLIC, '', siteInTrash.id);
await apis.user.sites.deleteSite(siteInTrash.id, false);
await loginPage.loginWith(username);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.sites.deleteAllUserSites();
await userActions.login(username, username);
await userActions.emptyTrashcan();
done();
});
it('[C280024] Create Library dialog UI', async () => {

View File

@ -61,7 +61,7 @@ describe('Delete and undo delete', () => {
const recentFile5 = `recentFile5-${random}.txt`;
const recentFile6 = `recentFile6-${random}.txt`;
beforeAll(async (done) => {
beforeAll(async () => {
try {
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -77,7 +77,6 @@ describe('Delete and undo delete', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {
@ -180,7 +179,7 @@ describe('Delete and undo delete', () => {
const parent = `parentPF-${Utils.random()}`;
let parentId: string;
beforeAll(async (done) => {
beforeAll(async () => {
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
await apis.user.nodes.createFile(file1, parentId);
@ -211,8 +210,6 @@ describe('Delete and undo delete', () => {
await apis.user.nodes.lockFile(fileLocked4Id, 'FULL');
await loginPage.loginWith(username);
done();
});
beforeEach(async () => {
@ -220,7 +217,7 @@ describe('Delete and undo delete', () => {
await page.dataTable.doubleClickOnRowByName(parent);
});
afterAll(async (done) => {
afterAll(async () => {
try {
await apis.user.nodes.unlockFile(fileLocked1Id);
await apis.user.nodes.unlockFile(fileLocked2Id);
@ -233,7 +230,6 @@ describe('Delete and undo delete', () => {
} catch (error) {
Logger.error(`----- afterAll failed : ${error}`);
}
done();
});
it('[C217125] delete a file and check notification', async () => {
@ -355,7 +351,7 @@ describe('Delete and undo delete', () => {
const parent = `parentSF-${Utils.random()}`;
let parentId: string;
beforeAll(async (done) => {
beforeAll(async () => {
try {
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -373,7 +369,6 @@ describe('Delete and undo delete', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {
@ -475,7 +470,7 @@ describe('Delete and undo delete', () => {
const fileLocked4 = `fileLocked4-${Utils.random()}.txt`;
let fileLocked4Id: string;
beforeAll(async (done) => {
beforeAll(async () => {
try {
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -515,7 +510,6 @@ describe('Delete and undo delete', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {

View File

@ -52,7 +52,7 @@ describe('Permanently delete from Trash', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
filesIds = (await apis.user.nodes.createFiles([file1, file2, file3])).list.entries.map((entries: any) => entries.entry.id);
@ -64,17 +64,15 @@ describe('Permanently delete from Trash', () => {
await userActions.deleteSites([site], false);
await loginPage.loginWith(username);
done();
});
beforeEach(async () => {
await page.clickTrashAndWait();
});
afterAll(async (done) => {
afterAll(async () => {
await userActions.login(username, username);
await userActions.emptyTrashcan();
done();
});
it('[C217091] delete a file', async () => {

View File

@ -40,10 +40,9 @@ describe('Restore from Trash', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await loginPage.loginWith(username);
done();
});
afterAll(async () => {
@ -77,7 +76,7 @@ describe('Restore from Trash', () => {
await userActions.emptyTrashcan();
});
it('[C217177] restore file', async (done) => {
it('[C217177] restore file', async () => {
await dataTable.selectItem(file);
await BrowserActions.click(toolbar.restoreButton);
const text = await page.getSnackBarMessage();
@ -88,10 +87,9 @@ describe('Restore from Trash', () => {
expect(await page.dataTable.isItemPresent(file)).toBe(true, 'Item not displayed in list');
await userActions.deleteNodes([fileId], false);
done();
});
it('[C280438] restore folder', async (done) => {
it('[C280438] restore folder', async () => {
await dataTable.selectItem(folder);
await BrowserActions.click(toolbar.restoreButton);
const text = await page.getSnackBarMessage();
@ -102,7 +100,6 @@ describe('Restore from Trash', () => {
expect(await page.dataTable.isItemPresent(folder)).toBe(true, 'Item not displayed in list');
await userActions.deleteNodes([folderId], false);
done();
});
it('[C290104] restore library', async () => {
@ -116,7 +113,7 @@ describe('Restore from Trash', () => {
expect(await page.dataTable.isItemPresent(site)).toBe(true, `${site} not displayed in list`);
});
it('[C217182] restore multiple items', async (done) => {
it('[C217182] restore multiple items', async () => {
await dataTable.selectMultipleItems([file, folder]);
await BrowserActions.click(toolbar.restoreButton);
const text = await page.getSnackBarMessage();
@ -129,10 +126,9 @@ describe('Restore from Trash', () => {
expect(await page.dataTable.isItemPresent(folder)).toBe(true, 'Item not displayed in list');
await userActions.deleteNodes([fileId, folderId], false);
done();
});
it('[C217181] View from notification', async (done) => {
it('[C217181] View from notification', async () => {
await dataTable.selectItem(file);
await BrowserActions.click(toolbar.restoreButton);
await page.clickSnackBarAction();
@ -141,7 +137,6 @@ describe('Restore from Trash', () => {
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
await userActions.deleteNodes([fileId], false);
done();
});
});
@ -215,7 +210,7 @@ describe('Restore from Trash', () => {
const file5 = `file5-${Utils.random()}.txt`;
let file5Id: string;
beforeAll(async (done) => {
beforeAll(async () => {
try {
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
file1Id = (await apis.user.nodes.createFile(file1, folder1Id)).entry.id;
@ -236,7 +231,6 @@ describe('Restore from Trash', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {

View File

@ -85,7 +85,7 @@ describe('Edit folder', () => {
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await adminApiActions.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
@ -119,7 +119,6 @@ describe('Edit folder', () => {
await apis.user.search.waitForNodes(searchRandom, { expect: 3 });
await loginPage.loginWith(username);
done();
});
afterAll(async () => {
@ -150,14 +149,13 @@ describe('Edit folder', () => {
});
describe('on Personal Files', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
await dataTable.waitForHeader();
done();
});
it('[C216335] properties are modified when pressing OK', async (done) => {
it('[C216335] properties are modified when pressing OK', async () => {
await dataTable.selectItem(folderNameToEdit);
await toolbar.openMoreMenu();
await BrowserActions.click(toolbar.menu.editFolderAction);
@ -171,7 +169,6 @@ describe('Edit folder', () => {
expect(await dataTable.isItemPresent(folderNameEdited)).toBe(true, 'Folder not displayed');
const desc = await apis.user.nodes.getNodeDescription(folderNameEdited, parentId);
expect(desc).toEqual(folderDescriptionEdited);
done();
});
it('[C216332] with empty folder name', async () => {
@ -245,12 +242,11 @@ describe('Edit folder', () => {
});
describe('on Favorites', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickFavoritesAndWait();
done();
});
it('[C280384] properties are modified when pressing OK', async (done) => {
it('[C280384] properties are modified when pressing OK', async () => {
await dataTable.selectItem(folderFavoriteToEdit);
await toolbar.openMoreMenu();
await BrowserActions.click(toolbar.menu.editFolderAction);
@ -264,7 +260,6 @@ describe('Edit folder', () => {
expect(await dataTable.isItemPresent(folderNameEdited)).toBe(true, 'Folder not displayed');
const desc = await apis.user.nodes.getNodeProperty(folderFavoriteToEditId, 'cm:description');
expect(desc).toEqual(folderDescriptionEdited);
done();
});
it('[C280386] with duplicate folder name', async () => {
@ -281,13 +276,12 @@ describe('Edit folder', () => {
});
describe('on My Libraries', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.goToMyLibrariesAndWait();
await dataTable.doubleClickOnRowByName(siteName);
done();
});
it('[C280509] properties are modified when pressing OK', async (done) => {
it('[C280509] properties are modified when pressing OK', async () => {
await dataTable.selectItem(folderSiteToEdit);
await toolbar.openMoreMenu();
await BrowserActions.click(toolbar.menu.editFolderAction);
@ -301,7 +295,6 @@ describe('Edit folder', () => {
expect(await dataTable.isItemPresent(folderNameEdited)).toBe(true, 'Folder not displayed');
const desc = await apis.user.nodes.getNodeProperty(folderSiteToEditId, 'cm:description');
expect(desc).toEqual(folderDescriptionEdited);
done();
});
it('[C280511] with duplicate folder name', async () => {

View File

@ -85,7 +85,7 @@ describe('Mark items as favorites', () => {
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -120,7 +120,6 @@ describe('Mark items as favorites', () => {
]);
await loginPage.loginWith(username);
done();
});
afterAll(async () => {
@ -132,19 +131,17 @@ describe('Mark items as favorites', () => {
});
describe('on Personal Files', () => {
afterAll(async (done) => {
afterAll(async () => {
try {
await apis.user.favorites.addFavoritesByIds('file', [fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
await apis.user.favorites.addFavoriteById('folder', folderId);
await apis.user.favorites.removeFavoritesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]);
} catch (error) {}
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
done();
});
it('[C217186] Favorite action has empty star icon for an item not marked as favorite', async () => {
@ -218,18 +215,16 @@ describe('Mark items as favorites', () => {
});
describe('on Recent Files', () => {
afterAll(async (done) => {
afterAll(async () => {
try {
await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
await apis.user.favorites.removeFavoritesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]);
} catch (error) {}
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickRecentFilesAndWait();
done();
});
it('[C280352] favorite a file', async () => {
@ -272,18 +267,16 @@ describe('Mark items as favorites', () => {
});
describe('on Shared Files', () => {
afterAll(async (done) => {
afterAll(async () => {
try {
await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
await apis.user.favorites.removeFavoritesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]);
} catch (error) {}
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickSharedFilesAndWait();
done();
});
it('[C280362] favorite a file', async () => {
@ -326,11 +319,10 @@ describe('Mark items as favorites', () => {
});
describe('on Favorites', () => {
afterAll(async (done) => {
afterAll(async () => {
try {
await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
} catch (error) {}
done();
});
beforeEach(async () => {
@ -367,7 +359,7 @@ describe('Mark items as favorites', () => {
});
describe('on Search Results', () => {
beforeAll(async (done) => {
beforeAll(async () => {
fileSearchNotFav1Id = (await apis.user.nodes.createFile(fileSearchNotFav1, parentId)).entry.id;
fileSearchNotFav2Id = (await apis.user.nodes.createFile(fileSearchNotFav2, parentId)).entry.id;
fileSearchNotFav3Id = (await apis.user.nodes.createFile(fileSearchNotFav3, parentId)).entry.id;
@ -385,7 +377,6 @@ describe('Mark items as favorites', () => {
await searchInput.checkFilesAndFolders();
await searchInput.searchFor(searchRandom);
await dataTable.waitForBody();
done();
});
afterAll(async () => {
@ -481,7 +472,7 @@ describe('Mark items as favorites', () => {
let fileSiteFav3Id: string;
let fileSiteFav4Id: string;
beforeAll(async (done) => {
beforeAll(async () => {
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
const docLibId = await apis.user.sites.getDocLibId(siteName);
@ -501,21 +492,17 @@ describe('Mark items as favorites', () => {
await apis.user.favorites.isFavoriteWithRetry(fileSiteFav2Id, { expect: true });
await apis.user.favorites.isFavoriteWithRetry(fileSiteFav3Id, { expect: true });
await apis.user.favorites.isFavoriteWithRetry(fileSiteFav4Id, { expect: true });
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.sites.deleteSite(siteName);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.goToMyLibrariesAndWait();
await page.dataTable.doubleClickOnRowByName(siteName);
await page.dataTable.waitForHeader();
done();
});
it('[C280391] Favorite a folder', async () => {

View File

@ -78,7 +78,7 @@ describe('Unshare a file from Search Results', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
try {
await adminApiActions.createUser({ username });
@ -111,7 +111,6 @@ describe('Unshare a file from Search Results', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
afterAll(async () => {

View File

@ -60,7 +60,7 @@ describe('Unshare a file', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
try {
await adminApiActions.createUser({ username });
@ -69,7 +69,6 @@ describe('Unshare a file', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
afterAll(async () => {

View File

@ -80,7 +80,7 @@ describe('Download', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
initialRecentTotalItems = await apis.user.search.getTotalItems(username);
@ -116,26 +116,22 @@ describe('Download', () => {
await apis.user.favorites.waitForApi({ expect: initialFavoritesTotalItems + 2 });
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await userActions.login(username, username);
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await Utils.renameFile(archiveZip, `${random}.zip`);
done();
});
describe('on Personal Files', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
done();
});
it('[C213179] Download a file', async () => {
@ -176,9 +172,8 @@ describe('Download', () => {
});
describe('on Favorites', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickFavoritesAndWait();
done();
});
it('[C280173] Download a file', async () => {
@ -219,9 +214,8 @@ describe('Download', () => {
});
describe('on Shared Files', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickSharedFilesAndWait();
done();
});
it('[C280170] Download a file', async () => {
@ -245,9 +239,8 @@ describe('Download', () => {
});
describe('on Recent Files', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickRecentFilesAndWait();
done();
});
it('[C280167] Download a file', async () => {
@ -271,12 +264,11 @@ describe('Download', () => {
});
describe('on Search Results', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await searchInput.clickSearchButton();
await searchInput.checkFilesAndFolders();
await searchInput.searchFor(random);
done();
});
it('[C279164] Download a file', async () => {

View File

@ -40,22 +40,20 @@ describe('Upload files', () => {
const { dataTable } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(folder1);
await page.sidenav.openNewMenu();
await page.sidenav.menu.uploadFilesInput.sendKeys(`${__dirname}/upload-file.test.ts`);
await page.sidenav.closeNewMenu();
await page.uploadFilesDialog.uploadDialog.isVisible();
done();
});
afterAll(async () => {

View File

@ -116,7 +116,7 @@ describe('Upload new version', () => {
});
describe('on Search Results', () => {
beforeAll(async (done) => {
beforeAll(async () => {
fileId = (await apis.user.upload.uploadFile(file, parentSearchId)).entry.id;
fileSearch1Id = (await apis.user.nodes.createFile(fileSearch1, parentSearchId)).entry.id;
fileSearch2Id = (await apis.user.nodes.createFile(fileSearch2, parentSearchId)).entry.id;
@ -132,7 +132,6 @@ describe('Upload new version', () => {
await apis.user.search.waitForNodes(searchRandom, { expect: 6 });
await loginPage.loginWith(username);
done();
});
afterEach(async () => {
@ -292,7 +291,7 @@ describe('Upload new version', () => {
});
describe('on Personal Files', () => {
beforeAll(async (done) => {
beforeAll(async () => {
fileId = (await apis.user.upload.uploadFile(file, parentPFId)).entry.id;
file1Id = (await apis.user.nodes.createFile(file1, parentPFId)).entry.id;
file2Id = (await apis.user.nodes.createFile(file2, parentPFId)).entry.id;
@ -306,19 +305,16 @@ describe('Upload new version', () => {
await apis.user.nodes.lockFile(fileLocked2Id);
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentPF);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await page.refresh();
done();
});
it('[C297544] dialog UI defaults', async () => {
@ -441,7 +437,7 @@ describe('Upload new version', () => {
});
describe('on Shared Files', () => {
beforeAll(async (done) => {
beforeAll(async () => {
fileId = (await apis.user.upload.uploadFile(file, parentSFId)).entry.id;
file1Id = (await apis.user.nodes.createFile(file1, parentSFId)).entry.id;
file2Id = (await apis.user.nodes.createFile(file2, parentSFId)).entry.id;
@ -458,7 +454,6 @@ describe('Upload new version', () => {
await apis.user.shared.waitForFilesToBeShared([fileId, file1Id, file2Id, file3Id, file4Id, fileLocked1Id, fileLocked2Id]);
await loginPage.loginWith(username);
done();
});
beforeEach(async () => {
@ -589,7 +584,7 @@ describe('Upload new version', () => {
});
describe('on Recent Files', () => {
beforeAll(async (done) => {
beforeAll(async () => {
const initialRecentTotalItems = await apis.user.search.getTotalItems(username);
fileId = (await apis.user.upload.uploadFile(file, parentRFId)).entry.id;
file1Id = (await apis.user.nodes.createFile(file1, parentRFId)).entry.id;
@ -606,7 +601,6 @@ describe('Upload new version', () => {
await apis.user.search.waitForApi(username, { expect: initialRecentTotalItems + 7 });
await loginPage.loginWith(username);
done();
});
beforeEach(async () => {
@ -737,7 +731,7 @@ describe('Upload new version', () => {
});
describe('on Favorite Files', () => {
beforeAll(async (done) => {
beforeAll(async () => {
const initialFavoritesTotalItems = await apis.user.favorites.getFavoritesTotalItems();
fileId = (await apis.user.upload.uploadFile(file, parentFavId)).entry.id;
file1Id = (await apis.user.nodes.createFile(file1, parentFavId)).entry.id;
@ -755,17 +749,14 @@ describe('Upload new version', () => {
await apis.user.favorites.waitForApi({ expect: initialFavoritesTotalItems + 7 });
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickFavoritesAndWait();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await page.refresh();
done();
});
it('[C297565] dialog UI defaults', async () => {

View File

@ -36,14 +36,12 @@ describe('General', () => {
let folderId: string;
describe('on session expire', () => {
beforeAll(async (done) => {
beforeAll(async () => {
folderId = (await adminApi.nodes.createFolder(folder)).entry.id;
done();
});
afterAll(async (done) => {
afterAll(async () => {
await adminApi.nodes.deleteNodeById(folderId);
done();
});
it('[C286473] should close opened dialogs', async () => {

View File

@ -55,15 +55,13 @@ describe('Page titles', () => {
});
describe('on app pages', () => {
beforeAll(async (done) => {
beforeAll(async () => {
fileId = (await adminApi.nodes.createFile(file)).entry.id;
await loginPage.loginWithAdmin();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await adminApi.nodes.deleteNodeById(fileId);
done();
});
it('[C217157] Personal Files page', async () => {

View File

@ -57,25 +57,22 @@ describe('Login', () => {
};
const newPassword = 'new password';
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username: testUser });
await adminApiActions.createUser(russianUser);
await adminApiActions.createUser(johnDoe);
await adminApiActions.createUser({ username: disabledUser });
await adminApiActions.createUser(testUser2);
await adminApiActions.disableUser(disabledUser);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await Utils.clearLocalStorage();
done();
});
describe('general tests', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await loginPage.load();
done();
});
it('[C213089] login page layout', async () => {
@ -149,9 +146,8 @@ describe('Login', () => {
const { login: loginComponent } = loginPage;
const { submitButton } = loginComponent;
beforeEach(async (done) => {
beforeEach(async () => {
await loginPage.load();
done();
});
it('[C280072] disabled submit button when password is empty', async () => {

View File

@ -32,14 +32,12 @@ describe('Logout', () => {
const johnDoe = `user-${Utils.random()}`;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username: johnDoe });
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await loginPage.loginWith(johnDoe);
done();
});
it('[C213143] Sign out option is available', async () => {

View File

@ -53,7 +53,7 @@ describe('Extensions - Context submenu', () => {
const contextMenu = dataTable.menu;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
fileId = (await apis.user.nodes.createFile(file)).entry.id;
folderId = (await apis.user.nodes.createFolder(folder)).entry.id;
@ -61,21 +61,17 @@ describe('Extensions - Context submenu', () => {
await loginPage.load();
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.CONTEXT_SUBMENUS);
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await dataTable.clearSelection();
await page.clickPersonalFilesAndWait();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodeById(fileId, true);
await apis.user.nodes.deleteNodeById(folderId, true);
done();
});
it('[C286717] Displays the submenu actions set from config', async () => {

View File

@ -59,25 +59,21 @@ describe('Extensions - DocumentList presets', () => {
const { dataTable } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
fileId = (await apis.user.nodes.createFile(file)).entry.id;
await loginPage.load();
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.DOCUMENT_LIST_PRESETS);
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodeById(fileId);
done();
});
it('[C286700] Sets the columns to display', async () => {

View File

@ -48,17 +48,15 @@ describe('Extensions - Header', () => {
const loginPage = new LoginPage();
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await loginPage.load();
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.HEADER);
await loginPage.loginWith(username);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await header.closeMoreMenu();
done();
});
it('[C286474] Add a new button in the header', async () => {

View File

@ -64,29 +64,25 @@ describe('Extensions - Info Drawer', () => {
const page = new BrowsingPage();
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
fileId = (await apis.user.nodes.createFile(file)).entry.id;
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodeById(fileId);
done();
});
describe('', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.load();
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.INFO_DRAWER);
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await page.dataTable.clearSelection();
done();
});
it('[C284646] Add a new tab with icon and title ', async () => {
@ -137,12 +133,11 @@ describe('Extensions - Info Drawer', () => {
});
describe('', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.load();
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.INFO_DRAWER_EMPTY);
await loginPage.loginWith(username);
await page.clickPersonalFilesAndWait();
done();
});
it('[C284650] Remove all tabs', async () => {

View File

@ -73,18 +73,16 @@ describe('Extensions - Metadata presets', () => {
const page = new BrowsingPage();
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
fileId = (await apis.user.nodes.createImage(file)).entry.id;
await loginPage.load();
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.METADATA_PRESETS);
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.refresh();
await page.dataTable.selectItem(file);
@ -94,13 +92,10 @@ describe('Extensions - Metadata presets', () => {
await infoDrawer.clickTab(PROPERTIES_TAB.title);
await BrowserActions.click(metadataCard.expandButton);
await metadataCard.waitForFirstExpansionPanel();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodeById(fileId);
done();
});
it('[C286636] Set groups of properties to display', async () => {

View File

@ -74,7 +74,7 @@ describe('Extensions - Viewer', () => {
const { toolbar } = viewer;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
pdfFileId = (await apis.user.upload.uploadFile(pdfFile.fileName)).entry.id;
docxFileId = (await apis.user.upload.uploadFile(docxFile.fileName)).entry.id;
@ -82,22 +82,18 @@ describe('Extensions - Viewer', () => {
await loginPage.load();
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.VIEWER);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodesById([pdfFileId, docxFileId]);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
done();
});
describe('content', () => {

View File

@ -68,7 +68,7 @@ describe('Comments', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -96,25 +96,21 @@ describe('Comments', () => {
await apis.user.favorites.addFavoriteById('folder', folder2Id);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await userActions.login(username, username);
await userActions.deleteNodes([parentId]);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await page.clickPersonalFiles();
done();
});
describe('from Personal Files', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
done();
});
it('[C299173] Comments tab default fields', async () => {
@ -206,14 +202,12 @@ describe('Comments', () => {
});
describe('from Favorites', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await apis.user.favorites.waitForApi({ expect: 4 });
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickFavoritesAndWait();
done();
});
it('[C299197] Comments are displayed ordered by created date in descending order', async () => {
@ -267,9 +261,8 @@ describe('Comments', () => {
});
describe('from Shared Files', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickSharedFilesAndWait();
done();
});
it('[C299189] Comments are displayed ordered by created date in descending order', async () => {
@ -308,14 +301,12 @@ describe('Comments', () => {
});
describe('from Recent Files', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await apis.user.search.waitForApi(username, { expect: 7 });
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickRecentFilesAndWait();
done();
});
it('[C299193] Comments are displayed ordered by created date in descending order', async () => {
@ -354,14 +345,12 @@ describe('Comments', () => {
});
describe('Comment info display', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await userActions.login(username, username);
commentFile1Entry = await userActions.createComment(fileWith1CommentId, 'this is my comment');
await apis.user.favorites.waitForApi({ expect: 4 });
await apis.user.search.waitForApi(username, { expect: 7 });
done();
});
it('[C280582] File from Personal files', async () => {

View File

@ -82,7 +82,7 @@ describe('File / Folder properties', () => {
const { dataTable } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
file1Id = (await apis.user.nodes.createFile(file1.name, parentId, file1.title, file1.description, file1.author)).entry.id;
@ -90,18 +90,15 @@ describe('File / Folder properties', () => {
image1Id = (await apis.user.upload.uploadFile(image1.name, parentId)).entry.id;
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodeById(parentId);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
done();
});
describe('View properties', () => {

View File

@ -46,7 +46,7 @@ describe('General', () => {
const { dataTable } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -54,25 +54,21 @@ describe('General', () => {
await apis.user.nodes.createFolder(folder1, parentId);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodeById(parentId);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
done();
});
afterEach(async (done) => {
afterEach(async () => {
if (await infoDrawer.isOpen()) {
await BrowserActions.click(page.toolbar.viewDetailsButton);
}
done();
});
it('[C268999] Info drawer closes on page refresh', async () => {

View File

@ -65,7 +65,7 @@ describe('Library properties', () => {
const { dataTable } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await adminApiActions.createUser({ username: user2 });
await adminApiActions.createUser({ username: user3 });
@ -77,26 +77,22 @@ describe('Library properties', () => {
await apis.user.sites.addSiteMember(site.id, user3, SITE_ROLES.SITE_MANAGER.ROLE);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.sites.deleteSite(site.id);
await apis.user.sites.deleteSite(siteForUpdate.id);
await apis.user.sites.deleteSite(siteDup);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickFileLibrariesAndWait();
done();
});
afterEach(async (done) => {
afterEach(async () => {
if (await infoDrawer.isOpen()) {
await BrowserActions.click(page.toolbar.viewDetailsButton);
}
done();
});
it('[C289336] Info drawer opens for a library', async () => {
@ -224,9 +220,8 @@ describe('Library properties', () => {
});
describe('Non manager', () => {
afterAll(async (done) => {
afterAll(async () => {
await loginPage.loginWith(username);
done();
});
it('[C289337] Info drawer button is not displayed when user is not the library manager', async () => {

View File

@ -33,10 +33,9 @@ describe('Empty list views', () => {
const { searchInput } = page.header;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await loginPage.loginWith(username);
done();
});
it('[C217099] empty My Libraries', async () => {

View File

@ -50,7 +50,7 @@ describe('Favorites', () => {
let parentId: string;
let folderId: string;
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await adminApiActions.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
@ -74,22 +74,19 @@ describe('Favorites', () => {
await userActions.deleteNodes([file3Id, file4Id], false);
await userActions.trashcanApi.restoreDeletedNode(file4Id);
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickFavoritesAndWait();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await userActions.login(username, username);
await userActions.deleteNodes([folderId, parentId]);
await userActions.emptyTrashcan();
await adminApiActions.login();
await adminApiActions.deleteSites([siteName]);
done();
});
it('[C280482] has the correct columns', async () => {

View File

@ -57,7 +57,7 @@ describe('File Libraries', () => {
const { dataTable } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
try {
await adminApiActions.createUser({ username });
@ -89,7 +89,6 @@ describe('File Libraries', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
afterAll(async () => {

View File

@ -48,7 +48,7 @@ describe('Generic errors', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
try {
await adminApiActions.createUser({ username });
await adminApiActions.createUser({ username: username2 });
@ -61,7 +61,6 @@ describe('Generic errors', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
afterAll(async () => {

View File

@ -49,7 +49,7 @@ describe('Special permissions', () => {
const fileName = `file-${Utils.random()}.txt`;
let fileId: string;
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
await adminApiActions.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
@ -67,7 +67,6 @@ describe('Special permissions', () => {
await adminApiActions.shared.waitForFilesToBeShared([fileId]);
await loginPage.loginWith(username);
done();
});
afterEach(async () => {
@ -126,7 +125,7 @@ describe('Special permissions', () => {
const fileName = `file-${Utils.random()}.txt`;
let fileId;
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
await adminApiActions.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
const docLibId = await adminApiActions.sites.getDocLibId(sitePrivate);
@ -140,12 +139,10 @@ describe('Special permissions', () => {
await apis.user.search.waitForApi(username, { expect: 1 });
await adminApiActions.sites.deleteSiteMember(sitePrivate, username);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await adminApiActions.sites.deleteSite(sitePrivate);
done();
});
it('[C213178] on Recent Files', async () => {

View File

@ -44,27 +44,23 @@ describe('Personal Files', () => {
const userFile = `file-${Utils.random()}.txt`;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await Promise.all([adminApiActions.createUser({ username }), adminApiActions.nodes.createFolders([adminFolder])]);
await apis.user.nodes.createFolders([userFolder]);
await apis.user.nodes.createFiles([userFile], userFolder);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await Promise.all([adminApiActions.nodes.deleteNodes([adminFolder]), apis.user.nodes.deleteNodes([userFolder])]);
done();
});
describe(`Admin user's personal files`, () => {
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.loginWithAdmin();
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
done();
});
it('[C213241] has Data Dictionary and created content', async () => {
@ -74,14 +70,12 @@ describe('Personal Files', () => {
});
describe(`Regular user's personal files`, () => {
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
done();
});
it('[C217142] has the correct columns', async () => {

View File

@ -51,7 +51,7 @@ describe('Recent Files', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
folderId = (await apis.user.nodes.createFolders([folderName])).entry.id;
@ -70,20 +70,17 @@ describe('Recent Files', () => {
await apis.user.search.waitForApi(username, { expect: 3 });
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickRecentFilesAndWait();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await userActions.login(username, username);
await userActions.deleteNodes([folderId, file2Id]);
await userActions.deleteSites([siteName]);
await userActions.emptyTrashcan();
done();
});
it('[C213168] has the correct columns', async () => {

View File

@ -52,7 +52,7 @@ describe('Shared Files', () => {
const { dataTable, breadcrumb } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
await adminApiActions.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
await adminApiActions.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER.ROLE);
@ -77,12 +77,10 @@ describe('Shared Files', () => {
await apis.user.shared.waitForFilesToNotBeShared([file2Id, file3Id]);
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.clickSharedFilesAndWait();
done();
});
afterAll(async () => {

View File

@ -62,7 +62,7 @@ describe('File / folder tooltips', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -82,21 +82,18 @@ describe('File / folder tooltips', () => {
await apis.user.shared.waitForFilesToBeShared([file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id]);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await userActions.login(username, username);
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
done();
});
describe('on Personal Files', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
done();
});
it('[C255871] File with name, no title, no description', async () => {
@ -133,10 +130,9 @@ describe('File / folder tooltips', () => {
});
describe('on Recent Files', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await apis.user.search.waitForApi(username, { expect: 8 });
await page.clickRecentFilesAndWait();
done();
});
it('[C280135] File with name, no title, no description', async () => {
@ -173,9 +169,8 @@ describe('File / folder tooltips', () => {
});
describe('on Favorites', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await page.clickFavoritesAndWait();
done();
});
it('[C280151] File with name, no title, no description', async () => {
@ -223,7 +218,7 @@ describe('File / folder tooltips', () => {
let file7TrashId: string;
let file8TrashId: string;
beforeAll(async (done) => {
beforeAll(async () => {
parentForTrashId = (await apis.user.nodes.createFolder(parentForTrash)).entry.id;
file1TrashId = (await apis.user.nodes.createFile(file, parentForTrashId)).entry.id;
file2TrashId = (await apis.user.nodes.createFile(fileWithDesc, parentForTrashId, '', fileDescription)).entry.id;
@ -241,14 +236,12 @@ describe('File / folder tooltips', () => {
);
await page.clickTrashAndWait();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await userActions.login(username, username);
await userActions.deleteNodes([parentForTrashId]);
await userActions.emptyTrashcan();
done();
});
it('[C280159] File with name, no title, no description', async () => {

View File

@ -63,7 +63,7 @@ describe('Breadcrumb', () => {
};
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
subFolder1Id = (await apis.user.nodes.createFolder(subFolder1, parentId)).entry.id;
@ -81,12 +81,10 @@ describe('Breadcrumb', () => {
await apis.user.nodes.createFile(fileName1FromSite, subFolder2FromSiteId);
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await Promise.all([apis.user.nodes.deleteNodeById(parentId), apis.user.nodes.deleteNodeById(parent2Id), apis.user.sites.deleteSite(siteName)]);
done();
});
async function verifyBreadcrumb(expectedCount: number, expectedText: string) {
@ -199,20 +197,17 @@ describe('Breadcrumb', () => {
let userFolderId: string;
const user2Api = new RepoClient(user2, user2);
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username: user2 });
userFolderId = (await user2Api.nodes.createFolder(userFolder)).entry.id;
await loginPage.loginWithAdmin();
await page.dataTable.waitForBody();
await page.dataTable.sortByModified('desc');
done();
});
afterAll(async (done) => {
afterAll(async () => {
await user2Api.nodes.deleteNodeById(userFolderId);
done();
});
it(`[C260970] Breadcrumb on navigation to a user's home`, async () => {

View File

@ -33,15 +33,13 @@ describe('Sidebar', () => {
const searchResultsPage = new SearchResultsPage();
const { searchInput } = searchResultsPage.header;
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.loginWithAdmin();
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await header.expandSideNav();
done();
});
it('[C217149] has "Personal Files" as default', async () => {

View File

@ -54,7 +54,7 @@ describe('Single click on item name', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
const initialRecentTotalItems = await apis.user.search.getTotalItems(username);
@ -75,7 +75,6 @@ describe('Single click on item name', () => {
await userActions.deleteNodes([deletedFile1Id, deletedFolder1Id], false);
await loginPage.loginWith(username);
done();
});
afterAll(async () => {

View File

@ -77,7 +77,7 @@ describe('Search filters', () => {
const modifiedDateFilter = filters.modifiedDate;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username: user1 });
await adminApiActions.createUser({ username: user2 });
parentId = (await apis.user1.nodes.createFolder(parent)).entry.id;
@ -93,22 +93,19 @@ describe('Search filters', () => {
await apis.user1.search.waitForNodes(`search-filters-${random}`, { expect: 2 });
await loginPage.loginWith(user1);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickPersonalFilesAndWait();
await searchInput.clickSearchButton();
await searchInput.searchFor(`search-filters-${random}`);
await dataTable.waitForBody();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await Promise.all([apis.user1.nodes.deleteNodeById(parentId), apis.user1.sites.deleteSite(site)]);
done();
});
it('[C279186] Filters are displayed', async () => {
@ -122,9 +119,8 @@ describe('Search filters', () => {
});
describe('Filter by Size', () => {
afterEach(async (done) => {
afterEach(async () => {
await sizeFilter.resetPanel();
done();
});
it('[C279197] Expand / Collapse the Size filter panel', async () => {
@ -190,10 +186,9 @@ describe('Search filters', () => {
const today = moment().format('DD-MMM-YY');
const future = moment().add(1, 'month').format('DD-MMM-YY');
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279211] Expand / Collapse the Created date filter panel', async () => {
@ -288,10 +283,9 @@ describe('Search filters', () => {
});
describe('Filter by File type', () => {
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279191] Expand / Collapse the File type filter panel', async () => {
@ -348,10 +342,9 @@ describe('Search filters', () => {
});
describe('Filter by Creator', () => {
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279205] Expand / Collapse the Creator filter panel', async () => {
@ -409,10 +402,9 @@ describe('Search filters', () => {
});
describe('Filter by Modifier', () => {
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279224] Expand / Collapse the Modifier filter panel', async () => {
@ -472,10 +464,9 @@ describe('Search filters', () => {
});
describe('Filter by Location', () => {
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279230] Expand / Collapse the Location filter panel', async () => {
@ -536,10 +527,9 @@ describe('Search filters', () => {
describe('Filter by Modified date', () => {
const expectedDateFilters = ['Today (2)', 'This week (2)', 'This month (2)', 'In the last 6 months (2)', 'This year (2)'];
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279219] Expand / Collapse the Modified date filter panel', async () => {
@ -603,10 +593,9 @@ describe('Search filters', () => {
});
describe('Multiple filters', () => {
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C280051] Multiple filters can be applied', async () => {

View File

@ -30,15 +30,13 @@ describe('Search input', () => {
const page = new BrowsingPage();
const { searchInput } = page.header;
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.loginWithAdmin();
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickPersonalFiles();
done();
});
it('[C289847] Search input is displayed in the app header', async () => {

View File

@ -56,7 +56,7 @@ describe('Search results - files and folders', () => {
const { dataTable, breadcrumb } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
fileId = (await apis.user.nodes.createFile(file, '-my-', fileTitle, fileDescription)).entry.id;
@ -69,22 +69,19 @@ describe('Search results - files and folders', () => {
await apis.user.queries.waitForSites(site, { expect: 1 });
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.refresh();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await Promise.all([
apis.user.nodes.deleteNodeById(fileId),
apis.user.nodes.deleteNodeById(fileRussianId),
apis.user.nodes.deleteNodeById(folderId),
apis.user.sites.deleteSite(site)
]);
done();
});
it('[C307002] Results page title', async () => {

View File

@ -46,7 +46,7 @@ describe('Search results general', () => {
const dataTable = page.dataTable;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
fileId = (await apis.user.nodes.createFile(file)).entry.id;
@ -57,17 +57,14 @@ describe('Search results general', () => {
await apis.user.queries.waitForSites(site, { expect: 1 });
await loginPage.loginWith(username);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await Promise.all([apis.user.nodes.deleteNodeById(fileId), apis.user.nodes.deleteNodeById(folderId), apis.user.sites.deleteSite(site)]);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.refresh();
done();
});
it('[C290005] Only files are returned when Files option is the only one checked', async () => {

View File

@ -74,7 +74,7 @@ describe('Search results - libraries', () => {
const dataTable = page.dataTable;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
try {
await adminApiActions.createUser({ username });
@ -120,7 +120,6 @@ describe('Search results - libraries', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
afterAll(async () => {

View File

@ -57,7 +57,7 @@ describe('Search sorting', () => {
const { dataTable } = page;
const adminApiActions = new AdminActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username: user1 });
await adminApiActions.createUser({ username: user2 });
parentId = (await apis.user1.nodes.createFolder(parent)).entry.id;
@ -70,17 +70,15 @@ describe('Search sorting', () => {
await apis.user1.search.waitForNodes(`search-sort-${random}`, { expect: 2 });
await loginPage.loginWith(user1);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickPersonalFilesAndWait();
await searchInput.clickSearchButton();
await searchInput.searchFor(`search sort ${random}`);
await dataTable.waitForBody();
done();
});
afterAll(async () => {

View File

@ -92,7 +92,7 @@ describe('Viewer actions', () => {
const fileForUploadNewVersion2 = `file4-${Utils.random()}.docx`;
let fileForUploadNewVersionId2: string;
beforeAll(async (done) => {
beforeAll(async () => {
try {
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id;
@ -116,7 +116,6 @@ describe('Viewer actions', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {
@ -334,7 +333,7 @@ describe('Viewer actions', () => {
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
let fileForUploadNewVersionId: string;
beforeAll(async (done) => {
beforeAll(async () => {
try {
await apis.user.sites.createSite(siteName);
const docLibId = await apis.user.sites.getDocLibId(siteName);
@ -357,7 +356,6 @@ describe('Viewer actions', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {
@ -394,7 +392,7 @@ describe('Viewer actions', () => {
expect(await Utils.fileExistsOnOS(docxLibraries)).toBe(true, 'File not found in download location');
});
it('[C286370] Copy action', async (done) => {
it('[C286370] Copy action', async () => {
await dataTable.doubleClickOnRowByName(docxLibraries);
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
@ -411,7 +409,6 @@ describe('Viewer actions', () => {
expect(await dataTable.isItemPresent(docxLibraries)).toBe(true, 'Item is not present in destination');
await apis.user.nodes.deleteNodeChildren(destinationId);
done();
});
it('[C286371] Move action', async () => {
@ -531,7 +528,7 @@ describe('Viewer actions', () => {
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
let fileForUploadNewVersionId: string;
beforeAll(async (done) => {
beforeAll(async () => {
try {
await apis.user.search.waitForApi(username, { expect: 0 });
@ -557,7 +554,6 @@ describe('Viewer actions', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {
@ -587,7 +583,7 @@ describe('Viewer actions', () => {
expect(await Utils.fileExistsOnOS(docxRecentFiles)).toBe(true, 'File not found in download location');
});
it('[C286384] Copy action', async (done) => {
it('[C286384] Copy action', async () => {
await dataTable.doubleClickOnRowByName(docxRecentFiles);
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
@ -604,7 +600,6 @@ describe('Viewer actions', () => {
expect(await dataTable.isItemPresent(docxRecentFiles)).toBe(true, 'Item is not present in destination');
await apis.user.nodes.deleteNodeChildren(destinationId);
done();
});
it('[C286385] Move action', async () => {
@ -727,7 +722,7 @@ describe('Viewer actions', () => {
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
let fileForUploadNewVersionId;
beforeAll(async (done) => {
beforeAll(async () => {
try {
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id;
@ -767,7 +762,6 @@ describe('Viewer actions', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {
@ -941,7 +935,7 @@ describe('Viewer actions', () => {
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
let fileForUploadNewVersionId: string;
beforeAll(async (done) => {
beforeAll(async () => {
try {
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id;
@ -973,7 +967,6 @@ describe('Viewer actions', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
done();
});
beforeEach(async () => {
@ -1003,7 +996,7 @@ describe('Viewer actions', () => {
expect(await Utils.fileExistsOnOS(docxFavorites)).toBe(true, 'File not found in download location');
});
it('[C286391] Copy action', async (done) => {
it('[C286391] Copy action', async () => {
await dataTable.doubleClickOnRowByName(docxFavorites);
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
@ -1020,7 +1013,6 @@ describe('Viewer actions', () => {
expect(await dataTable.isItemPresent(docxFavorites)).toBe(true, 'Item is not present in destination');
await apis.user.nodes.deleteNodeChildren(destinationId);
done();
});
it('[C286392] Move action', async () => {

View File

@ -57,7 +57,7 @@ describe('Viewer general', () => {
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@ -79,28 +79,24 @@ describe('Viewer general', () => {
await apis.user.shared.waitForFilesToBeShared([xlsxFileId]);
await loginPage.loginWith(username);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await page.header.expandSideNav();
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
await dataTable.waitForHeader();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await Utils.pressEscape();
await page.header.expandSideNav();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await apis.user.nodes.deleteNodeById(parentId);
await adminApiActions.sites.deleteSite(siteAdmin);
await apis.user.sites.deleteSite(siteUser);
done();
});
it('[C279269] Viewer opens on double clicking on a file from Personal Files', async () => {