mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-6435] playwright e2e for list views personal files (#3551)
* [ACS-6435] playwright e2e for list views personal files * e2e test for trash page * e2e test for trash page * e2e test for file-libraries page * e2e test for file-libraries page fix * e2e test for file-libraries page fix * e2e test shared recent page * e2e test shared recent page fix * e2e test review comment fix * e2e test review fix flaky test fix * e2e test fail test fix * e2e test fail fix * test code fix * protractor list-view test enable
This commit is contained in:
@@ -1,145 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AdminActions, UserActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Favorites', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const favFolderName = `favFolder-${Utils.random()}`;
|
||||
const parentFolder = `parent-${Utils.random()}`;
|
||||
const fileName1 = `file1-${Utils.random()}.txt`;
|
||||
const fileName2 = `file2-${Utils.random()}.txt`;
|
||||
const fileName3 = `file3-${Utils.random()}.txt`;
|
||||
const fileName4 = `file4-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
const userActions = new UserActions();
|
||||
|
||||
let parentId: string;
|
||||
let folderId: string;
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await adminApiActions.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(siteName);
|
||||
await adminApiActions.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
const file1Id = (await adminApiActions.nodes.createFile(fileName1, docLibId)).entry.id;
|
||||
folderId = (await apis.user.nodes.createFolder(favFolderName)).entry.id;
|
||||
parentId = (await apis.user.nodes.createFolder(parentFolder)).entry.id;
|
||||
const file2Id = (await apis.user.nodes.createFile(fileName2, parentId)).entry.id;
|
||||
const file3Id = (await apis.user.nodes.createFile(fileName3, parentId)).entry.id;
|
||||
const file4Id = (await apis.user.nodes.createFile(fileName4, parentId)).entry.id;
|
||||
|
||||
await apis.user.favorites.addFavoriteById('file', file1Id);
|
||||
await apis.user.favorites.addFavoriteById('folder', folderId);
|
||||
await apis.user.favorites.addFavoriteById('file', file2Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
|
||||
await userActions.login(username, username);
|
||||
await userActions.deleteNodes([file3Id, file4Id], false);
|
||||
await userActions.trashcanApi.restoreDeletedNode(file4Id);
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userActions.login(username, username);
|
||||
await userActions.deleteNodes([folderId, parentId]);
|
||||
await userActions.emptyTrashcan();
|
||||
|
||||
await adminApiActions.login();
|
||||
await adminApiActions.deleteSites([siteName]);
|
||||
});
|
||||
|
||||
it('[C280482] has the correct columns', async () => {
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Modified', 'Modified by', 'Tags'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
await expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C213226] displays the favorite files and folders', async () => {
|
||||
expect(await dataTable.getRowsCount()).toEqual(4, 'Incorrect number of items displayed');
|
||||
expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`);
|
||||
expect(await dataTable.isItemPresent(favFolderName)).toBe(true, `${favFolderName} not displayed`);
|
||||
});
|
||||
|
||||
it(`[C213228] deleted favorite file does not appear`, async () => {
|
||||
expect(await dataTable.isItemPresent(fileName3)).not.toBe(true, `${fileName3} is displayed`);
|
||||
});
|
||||
|
||||
it(`[C213229] file is displayed after it is restored from Trashcan`, async () => {
|
||||
expect(await dataTable.isItemPresent(fileName4)).toBe(true, `${fileName4} not displayed`);
|
||||
});
|
||||
|
||||
it('[C213231] Location column displays the parent folder of the files', async () => {
|
||||
expect(await dataTable.getItemLocation(fileName1)).toEqual(siteName);
|
||||
expect(await dataTable.getItemLocation(fileName2)).toEqual(parentFolder);
|
||||
expect(await dataTable.getItemLocation(favFolderName)).toEqual('Personal Files');
|
||||
});
|
||||
|
||||
it('[C213671] Location column displays a tooltip with the entire path of the file', async () => {
|
||||
expect(await dataTable.getItemLocationTooltip(fileName1)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(await dataTable.getItemLocationTooltip(fileName2)).toEqual(`Personal Files/${parentFolder}`);
|
||||
expect(await dataTable.getItemLocationTooltip(favFolderName)).toEqual('Personal Files');
|
||||
});
|
||||
|
||||
it('[C213650] Location column redirect - item in user Home', async () => {
|
||||
await dataTable.clickItemLocation(favFolderName);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280484] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(fileName2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', parentFolder]);
|
||||
});
|
||||
|
||||
it('[C280485] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileName1);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName]);
|
||||
});
|
||||
|
||||
it('[C213230] Navigate into folder from Favorites', async () => {
|
||||
await dataTable.doubleClickOnRowByName(favFolderName);
|
||||
await dataTable.waitForEmptyState();
|
||||
expect(await breadcrumb.currentItem.getText()).toBe(favFolderName);
|
||||
});
|
||||
});
|
@@ -1,234 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { Logger } from '@alfresco/adf-testing';
|
||||
|
||||
describe('File Libraries', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const userSitePrivate = `user-private-${Utils.random()}`;
|
||||
const userSiteModerated = `user-moderated-${Utils.random()}`;
|
||||
const userSitePublic = `user-public-${Utils.random()}`;
|
||||
|
||||
const siteName = `siteName-${Utils.random()}`;
|
||||
|
||||
const siteId1 = Utils.random();
|
||||
const siteId2 = Utils.random();
|
||||
|
||||
const adminSite1 = `admin1-${Utils.random()}`;
|
||||
const adminSite2 = `admin2-${Utils.random()}`;
|
||||
const adminSite3 = `admin3-${Utils.random()}`;
|
||||
const adminSite4 = `admin4-${Utils.random()}`;
|
||||
const adminSite5 = `admin5-${Utils.random()}`;
|
||||
const adminSite6 = `admin6-${Utils.random()}`;
|
||||
|
||||
const siteDescription = 'my site description';
|
||||
|
||||
const apis = {
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const sortAlphabetically = (a: string, b: string) => a.localeCompare(b);
|
||||
const sortAndCompare = (actual: string[], expected: string[]) => {
|
||||
actual.sort(sortAlphabetically);
|
||||
expected.sort(sortAlphabetically);
|
||||
expect(actual).toEqual(expected);
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
try {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await apis.user.sites.createSite(userSitePublic, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.user.sites.createSite(userSiteModerated, SITE_VISIBILITY.MODERATED, siteDescription);
|
||||
await apis.user.sites.createSite(userSitePrivate, SITE_VISIBILITY.PRIVATE, null);
|
||||
|
||||
await adminApiActions.sites.createSite(adminSite1, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite2, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite3, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite4, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite5, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite6, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.addSiteMember(adminSite1, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite2, username, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite3, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite4, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite6, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
await apis.user.favorites.addFavoriteById('site', adminSite1);
|
||||
await apis.user.favorites.addFavoriteById('site', adminSite2);
|
||||
await apis.user.favorites.addFavoriteById('site', adminSite3);
|
||||
await apis.user.favorites.addFavoriteById('site', adminSite4);
|
||||
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC, null, siteId1);
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC, null, siteId2);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
} catch (error) {
|
||||
Logger.error(`----- beforeAll failed : ${error}`);
|
||||
}
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apis.user.sites.deleteSites([userSitePublic, userSiteModerated, userSitePrivate, siteId1, siteId2]);
|
||||
await adminApiActions.sites.deleteSites([adminSite1, adminSite2, adminSite3, adminSite4, adminSite5, adminSite6]);
|
||||
});
|
||||
|
||||
describe('My Libraries', () => {
|
||||
beforeEach(async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
});
|
||||
|
||||
it('[C217095] has the correct columns', async () => {
|
||||
const expectedColumns = ['Name', 'Description', 'My Role', 'Visibility'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
await expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C280501] User can see only the sites he is a member of', async () => {
|
||||
const sitesCount = await dataTable.getRowsCount();
|
||||
|
||||
expect(sitesCount).toEqual(10, 'Incorrect number of sites displayed');
|
||||
expect(await dataTable.isItemPresent(adminSite5)).toBe(false, `${adminSite5} should not appear in the list`);
|
||||
});
|
||||
|
||||
it('[C289905] Library visibility is correctly displayed', async () => {
|
||||
const expectedSitesVisibility = {
|
||||
[userSitePrivate]: SITE_VISIBILITY.PRIVATE,
|
||||
[userSiteModerated]: SITE_VISIBILITY.MODERATED,
|
||||
[userSitePublic]: SITE_VISIBILITY.PUBLIC
|
||||
};
|
||||
|
||||
const sitesList = await dataTable.getSitesNameAndVisibility();
|
||||
|
||||
for (const site of Object.keys(expectedSitesVisibility)) {
|
||||
expect(sitesList[site]).toEqual(expectedSitesVisibility[site]);
|
||||
}
|
||||
});
|
||||
|
||||
it('[C289903] User role is correctly displayed', async () => {
|
||||
const expectedSitesRoles = {
|
||||
[adminSite1]: SITE_ROLES.SITE_CONSUMER.LABEL,
|
||||
[adminSite2]: SITE_ROLES.SITE_CONTRIBUTOR.LABEL,
|
||||
[adminSite3]: SITE_ROLES.SITE_COLLABORATOR.LABEL,
|
||||
[adminSite4]: SITE_ROLES.SITE_MANAGER.LABEL
|
||||
};
|
||||
|
||||
const sitesList = await dataTable.getSitesNameAndRole();
|
||||
|
||||
for (const site of Object.keys(expectedSitesRoles)) {
|
||||
expect(sitesList[site]).toEqual(expectedSitesRoles[site]);
|
||||
}
|
||||
});
|
||||
|
||||
it('[C217098] Site ID is displayed when two sites have the same name', async () => {
|
||||
const expectedSites = [`${siteName} (${siteId1})`, `${siteName} (${siteId2})`];
|
||||
const actualSites = await dataTable.getCellsContainingName(siteName);
|
||||
sortAndCompare(actualSites, expectedSites);
|
||||
});
|
||||
|
||||
it('[C217096] Tooltip for sites without description', async () => {
|
||||
const tooltip = await dataTable.getItemNameTooltip(userSitePrivate);
|
||||
expect(tooltip).toBe(`${userSitePrivate}`);
|
||||
});
|
||||
|
||||
it('[C217097] Tooltip for sites with description', async () => {
|
||||
const tooltip = await dataTable.getItemNameTooltip(userSiteModerated);
|
||||
expect(tooltip).toBe(`${siteDescription}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Favorite Libraries', () => {
|
||||
beforeEach(async () => {
|
||||
await page.goToFavoriteLibrariesAndWait();
|
||||
});
|
||||
|
||||
it('[C289893] has the correct columns', async () => {
|
||||
const expectedColumns = ['Name', 'Description', 'My Role', 'Visibility'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
await expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C289897] User can see only his favorite sites', async () => {
|
||||
const sitesCount = await dataTable.getRowsCount();
|
||||
|
||||
expect(sitesCount).toEqual(9, 'Incorrect number of sites displayed');
|
||||
expect(await dataTable.isItemPresent(adminSite6)).toBe(false, `${adminSite6} should not appear`);
|
||||
});
|
||||
|
||||
it('[C289906] Library visibility is correctly displayed', async () => {
|
||||
const expectedSitesVisibility = {
|
||||
[userSitePrivate]: SITE_VISIBILITY.PRIVATE,
|
||||
[userSiteModerated]: SITE_VISIBILITY.MODERATED,
|
||||
[userSitePublic]: SITE_VISIBILITY.PUBLIC
|
||||
};
|
||||
|
||||
const sitesList = await dataTable.getSitesNameAndVisibility();
|
||||
|
||||
for (const site of Object.keys(expectedSitesVisibility)) {
|
||||
expect(sitesList[site]).toEqual(expectedSitesVisibility[site]);
|
||||
}
|
||||
});
|
||||
|
||||
it('[C289904] User role is correctly displayed', async () => {
|
||||
const expectedSitesRoles = {
|
||||
[adminSite1]: SITE_ROLES.SITE_CONSUMER.LABEL,
|
||||
[adminSite2]: SITE_ROLES.SITE_CONTRIBUTOR.LABEL,
|
||||
[adminSite3]: SITE_ROLES.SITE_COLLABORATOR.LABEL,
|
||||
[adminSite4]: SITE_ROLES.SITE_MANAGER.LABEL
|
||||
};
|
||||
|
||||
const sitesList = await dataTable.getSitesNameAndRole();
|
||||
|
||||
for (const site of Object.keys(expectedSitesRoles)) {
|
||||
expect(sitesList[site]).toEqual(expectedSitesRoles[site]);
|
||||
}
|
||||
});
|
||||
|
||||
it('[C289896] Site ID is displayed when two sites have the same name', async () => {
|
||||
const expectedSites = [`${siteName} (${siteId1})`, `${siteName} (${siteId2})`];
|
||||
const actualSites = await dataTable.getCellsContainingName(siteName);
|
||||
sortAndCompare(actualSites, expectedSites);
|
||||
});
|
||||
|
||||
it('[C289894] Tooltip for sites without description', async () => {
|
||||
const tooltip = await dataTable.getItemNameTooltip(userSitePrivate);
|
||||
expect(tooltip).toBe(`${userSitePrivate}`);
|
||||
});
|
||||
|
||||
it('[C289895] Tooltip for sites with description', async () => {
|
||||
const tooltip = await dataTable.getItemNameTooltip(userSiteModerated);
|
||||
expect(tooltip).toBe(`${siteDescription}`);
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,124 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { AdminActions, APP_ROUTES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Personal Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
const adminFolder = `admin-folder-${Utils.random()}`;
|
||||
|
||||
const userFolder = `user-folder-${Utils.random()}`;
|
||||
const userFile = `file-${Utils.random()}.txt`;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await Promise.all([adminApiActions.nodes.deleteNodes([adminFolder]), apis.user.nodes.deleteNodes([userFolder])]);
|
||||
});
|
||||
|
||||
describe(`Admin user's personal files`, () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWithAdmin();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
});
|
||||
|
||||
it('[C213241] has Data Dictionary and created content', async () => {
|
||||
expect(await dataTable.isItemPresent('Data Dictionary')).toBe(true, 'Data Dictionary not displayed');
|
||||
expect(await dataTable.isItemPresent(adminFolder)).toBe(true, 'admin folder not displayed');
|
||||
});
|
||||
});
|
||||
|
||||
describe(`Regular user's personal files`, () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
});
|
||||
|
||||
it('[C217142] has the correct columns', async () => {
|
||||
const expectedColumns = ['Name', 'Size', 'Modified', 'Modified by', 'Tags'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
await expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C217143] has default sorted column', async () => {
|
||||
expect(await dataTable.getSortedColumnHeaderText()).toBe('Name');
|
||||
});
|
||||
|
||||
it('[C213242] has user created content', async () => {
|
||||
expect(await dataTable.isItemPresent(userFolder)).toBe(true, 'user folder not displayed');
|
||||
});
|
||||
|
||||
it('[C213244] navigates to folder', async () => {
|
||||
const nodeId = (await apis.user.nodes.getNodeByPath(`/${userFolder}`)).entry.id;
|
||||
|
||||
await dataTable.doubleClickOnRowByName(userFolder);
|
||||
await dataTable.waitForHeader();
|
||||
|
||||
expect(await browser.getCurrentUrl()).toContain(nodeId, 'Node ID is not in the URL');
|
||||
expect(await dataTable.isItemPresent(userFile)).toBe(true, 'user file is missing');
|
||||
});
|
||||
|
||||
it('[C213245] redirects to Personal Files on clicking the link from sidebar', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(userFolder);
|
||||
await page.clickPersonalFiles();
|
||||
const url = await browser.getCurrentUrl();
|
||||
expect(url.endsWith(APP_ROUTES.PERSONAL_FILES)).toBe(true, 'incorrect url');
|
||||
});
|
||||
|
||||
it('[C213246] page loads correctly after browser refresh', async () => {
|
||||
await page.refresh();
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
it('[C213247] page load by URL', async () => {
|
||||
const url = await browser.getCurrentUrl();
|
||||
await page.clickTrash();
|
||||
await browser.get(url);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,134 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AdminActions, UserActions, SITE_VISIBILITY, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Recent Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const folderName = `folder-${Utils.random()}`;
|
||||
let folderId: string;
|
||||
const fileName1 = `file-${Utils.random()}.txt`;
|
||||
const fileName2 = `file-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const fileName3 = `file-${Utils.random()}.txt`;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const folderSite = `folder2-${Utils.random()}`;
|
||||
let folderSiteId: string;
|
||||
const fileSite = `file-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
const userActions = new UserActions();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
folderId = (await apis.user.nodes.createFolders([folderName])).entry.id;
|
||||
await apis.user.nodes.createFiles([fileName1], folderName);
|
||||
file2Id = (await apis.user.nodes.createFiles([fileName2])).entry.id;
|
||||
const id = (await apis.user.nodes.createFiles([fileName3])).entry.id;
|
||||
|
||||
await userActions.login(username, username);
|
||||
await userActions.deleteNodes([id], false);
|
||||
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
folderSiteId = (await apis.user.nodes.createFolder(folderSite, docLibId)).entry.id;
|
||||
await apis.user.nodes.createFile(fileSite, folderSiteId);
|
||||
|
||||
await apis.user.search.waitForApi(username, { expect: 3 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userActions.login(username, username);
|
||||
await userActions.deleteNodes([folderId, file2Id]);
|
||||
await userActions.deleteSites([siteName]);
|
||||
await userActions.emptyTrashcan();
|
||||
});
|
||||
|
||||
it('[C213168] has the correct columns', async () => {
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Modified', 'Tags'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
await expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C213171] default sorting column', async () => {
|
||||
expect(await dataTable.getSortedColumnHeaderText()).toBe('Modified');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('[C213170] displays the files added by the current user in the last 30 days', async () => {
|
||||
expect(await dataTable.getRowsCount()).toEqual(3, 'Incorrect number of files displayed');
|
||||
expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileSite)).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
|
||||
it(`[C213174] file not displayed if it's been deleted`, async () => {
|
||||
expect(await dataTable.isItemPresent(fileName3)).not.toBe(true, `${fileName3} is displayed`);
|
||||
});
|
||||
|
||||
it('[C213175] Location column displays the parent folder of the file', async () => {
|
||||
expect(await dataTable.getItemLocation(fileName1)).toEqual(folderName);
|
||||
expect(await dataTable.getItemLocation(fileName2)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileSite)).toEqual(folderSite);
|
||||
});
|
||||
|
||||
it('[C213177] Location column displays a tooltip with the entire path of the file', async () => {
|
||||
expect(await dataTable.getItemLocationTooltip(fileName1)).toEqual(`Personal Files/${folderName}`);
|
||||
expect(await dataTable.getItemLocationTooltip(fileName2)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocationTooltip(fileSite)).toEqual(`File Libraries/${siteName}/${folderSite}`);
|
||||
});
|
||||
|
||||
it('[C213176] Location column redirect - file in user Home', async () => {
|
||||
await dataTable.clickItemLocation(fileName2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280486] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(fileName1);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', folderName]);
|
||||
});
|
||||
|
||||
it('[C280487] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileSite);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName, folderSite]);
|
||||
});
|
||||
});
|
@@ -1,141 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Shared Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileAdmin = `fileSite-${Utils.random()}.txt`;
|
||||
|
||||
const folderUser = `folder-${Utils.random()}`;
|
||||
let folderId: string;
|
||||
const file1User = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2User = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3User = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4User = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
const apis = {
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
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);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(siteName);
|
||||
const nodeId = (await adminApiActions.nodes.createFile(fileAdmin, docLibId)).entry.id;
|
||||
|
||||
await adminApiActions.shareNodes([nodeId]);
|
||||
await adminApiActions.shared.waitForFilesToBeShared([nodeId]);
|
||||
|
||||
folderId = (await apis.user.nodes.createFolder(folderUser)).entry.id;
|
||||
file1Id = (await apis.user.nodes.createFile(file1User, folderId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2User)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3User)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4User)).entry.id;
|
||||
|
||||
await apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id]);
|
||||
await apis.user.shared.waitForFilesToBeShared([file1Id, file2Id, file3Id, file4Id]);
|
||||
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
await apis.user.shared.unshareFileById(file3Id);
|
||||
|
||||
await apis.user.shared.waitForFilesToNotBeShared([file2Id, file3Id]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adminApiActions.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodeById(folderId);
|
||||
await apis.user.nodes.deleteNodeById(file4Id);
|
||||
});
|
||||
|
||||
it('[C213113] has the correct columns', async () => {
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by', 'Tags'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
await expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C213115] default sorting column', async () => {
|
||||
expect(await dataTable.getSortedColumnHeaderText()).toBe('Modified');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('[C213114] displays the files shared by everyone', async () => {
|
||||
expect(await dataTable.isItemPresent(fileAdmin)).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(await dataTable.isItemPresent(file1User)).toBe(true, `${file1User} not displayed`);
|
||||
});
|
||||
|
||||
it(`[C213117] file not displayed if it's been deleted`, async () => {
|
||||
expect(await dataTable.isItemPresent(file2User)).toBe(false, `${file2User} is displayed`);
|
||||
});
|
||||
|
||||
it('[C213118] unshared file is not displayed', async () => {
|
||||
expect(await dataTable.isItemPresent(file3User)).toBe(false, `${file3User} is displayed`);
|
||||
});
|
||||
|
||||
it('[C213665] Location column displays the parent folder of the file', async () => {
|
||||
expect(await dataTable.getItemLocationTooltip(file4User)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileAdmin)).toEqual(siteName);
|
||||
expect(await dataTable.getItemLocation(file1User)).toEqual(folderUser);
|
||||
});
|
||||
|
||||
it('[C213666] Location column redirect - file in user Home', async () => {
|
||||
await dataTable.clickItemLocation(file4User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280490] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(file1User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', folderUser]);
|
||||
});
|
||||
|
||||
it('[C280491] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileAdmin);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName]);
|
||||
});
|
||||
|
||||
it('[C213667] Location column displays a tooltip with the entire path of the file', async () => {
|
||||
expect(await dataTable.getItemLocationTooltip(fileAdmin)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(await dataTable.getItemLocationTooltip(file1User)).toEqual(`Personal Files/${folderUser}`);
|
||||
});
|
||||
});
|
@@ -1,278 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AdminActions, UserActions, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('File / folder tooltips', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
|
||||
const file = `file1-${Utils.random()}`;
|
||||
const fileWithDesc = `file2-${Utils.random()}`;
|
||||
const fileWithTitle = `file3-${Utils.random()}`;
|
||||
const fileWithTitleAndDesc = `file4-${Utils.random()}`;
|
||||
const fileNameEqTitleEqDesc = `file5-${Utils.random()}`;
|
||||
const fileNameEqTitleDiffDesc = `file6-${Utils.random()}`;
|
||||
const fileNameEqDescDiffTitle = `file7-${Utils.random()}`;
|
||||
const fileTitleEqDesc = `file8-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
let file1Id: string;
|
||||
let file2Id: string;
|
||||
let file3Id: string;
|
||||
let file4Id: string;
|
||||
let file5Id: string;
|
||||
let file6Id: string;
|
||||
let file7Id: string;
|
||||
let file8Id: string;
|
||||
|
||||
const fileTitle = 'file title';
|
||||
const fileDescription = 'file description';
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
const userActions = new UserActions();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
file1Id = (await apis.user.nodes.createFile(file, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(fileWithDesc, parentId, '', fileDescription)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(fileWithTitle, parentId, fileTitle)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(fileWithTitleAndDesc, parentId, fileTitle, fileDescription)).entry.id;
|
||||
file5Id = (await apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)).entry.id;
|
||||
file6Id = (await apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentId, fileNameEqTitleDiffDesc, fileDescription)).entry.id;
|
||||
file7Id = (await apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentId, fileTitle, fileNameEqDescDiffTitle)).entry.id;
|
||||
file8Id = (await apis.user.nodes.createFile(fileTitleEqDesc, parentId, fileTitle, fileTitle)).entry.id;
|
||||
|
||||
await apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id]);
|
||||
|
||||
await apis.user.shared.waitForFilesToBeShared([file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userActions.login(username, username);
|
||||
await userActions.deleteNodes([parentId]);
|
||||
await userActions.emptyTrashcan();
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
});
|
||||
|
||||
it('[C255871] File with name, no title, no description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('[C255872] File with name and description, no title', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C255873] File with name and title, no description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('[C255874] File with name and title and description, all different', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C255875] File with name and title and description, all equal', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('[C255876] File with name = title, different description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C255877] File with name = description, different title', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('[C255878] File with title = description, different name', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Recent Files', () => {
|
||||
beforeAll(async () => {
|
||||
await apis.user.search.waitForApi(username, { expect: 8 });
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
|
||||
it('[C280135] File with name, no title, no description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('[C280136] File with name and description, no title', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280137] File with name and title, no description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('[C280138] File with name and title and description, all different', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280139] File with name and title and description, all equal', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('[C280140] File with name = title, different description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280141] File with name = description, different title', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('[C280142] File with title = description, different name', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
it('[C280151] File with name, no title, no description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('[C280152] File with name and description, no title', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280153] File with name and title, no description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('[C280154] File with name and title and description, all different', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280155] File with name and title and description, all equal', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('[C280156] File with name = title, different description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280157] File with name = description, different title', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('[C280158] File with title = description, different name', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Trash', () => {
|
||||
const parentForTrash = `parent-${Utils.random()}`;
|
||||
let parentForTrashId: string;
|
||||
let file1TrashId: string;
|
||||
let file2TrashId: string;
|
||||
let file3TrashId: string;
|
||||
let file4TrashId: string;
|
||||
let file5TrashId: string;
|
||||
let file6TrashId: string;
|
||||
let file7TrashId: string;
|
||||
let file8TrashId: string;
|
||||
|
||||
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;
|
||||
file3TrashId = (await apis.user.nodes.createFile(fileWithTitle, parentForTrashId, fileTitle)).entry.id;
|
||||
file4TrashId = (await apis.user.nodes.createFile(fileWithTitleAndDesc, parentForTrashId, fileTitle, fileDescription)).entry.id;
|
||||
file5TrashId = (await apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentForTrashId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)).entry
|
||||
.id;
|
||||
file6TrashId = (await apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentForTrashId, fileNameEqTitleDiffDesc, fileDescription)).entry.id;
|
||||
file7TrashId = (await apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentForTrashId, fileTitle, fileNameEqDescDiffTitle)).entry.id;
|
||||
file8TrashId = (await apis.user.nodes.createFile(fileTitleEqDesc, parentForTrashId, fileTitle, fileTitle)).entry.id;
|
||||
|
||||
await apis.user.nodes.deleteNodesById(
|
||||
[file1TrashId, file2TrashId, file3TrashId, file4TrashId, file5TrashId, file6TrashId, file7TrashId, file8TrashId],
|
||||
false
|
||||
);
|
||||
|
||||
await page.clickTrashAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userActions.login(username, username);
|
||||
await userActions.deleteNodes([parentForTrashId]);
|
||||
await userActions.emptyTrashcan();
|
||||
});
|
||||
|
||||
it('[C280159] File with name, no title, no description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('[C280160] File with name and description, no title', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280161] File with name and title, no description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('[C280162] File with name and title and description, all different', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280163] File with name and title and description, all equal', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('[C280164] File with name = title, different description', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('[C280165] File with name = description, different title', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('[C280166] File with title = description, different name', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
});
|
@@ -58,7 +58,7 @@ describe('Trash', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const { dataTable } = page;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
const userActions = new UserActions();
|
||||
@@ -119,75 +119,5 @@ describe('Trash', () => {
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C280493] displays the files and folders deleted by everyone', async () => {
|
||||
expect(await dataTable.isItemPresent(fileAdmin)).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(await dataTable.isItemPresent(folderAdmin)).toBe(true, `${folderAdmin} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileUser)).toBe(true, `${fileUser} not displayed`);
|
||||
expect(await dataTable.isItemPresent(folderUser)).toBe(true, `${folderUser} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileSite)).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('as user', () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await page.clickTrashAndWait();
|
||||
});
|
||||
|
||||
it('[C280494] has the correct columns', async () => {
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Deleted'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C213218] displays the files and folders deleted by the user', async () => {
|
||||
expect(await dataTable.getRowsCount()).toEqual(6, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(await dataTable.isItemPresent(fileSite)).toBe(true, `${fileSite} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileUser)).toBe(true, `${fileUser} not displayed`);
|
||||
expect(await dataTable.isItemPresent(folderUser)).toBe(true, `${folderUser} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileAdmin)).toBe(false, `${fileAdmin} is displayed`);
|
||||
});
|
||||
|
||||
it('[C213219] default sorting column', async () => {
|
||||
expect(await dataTable.getSortedColumnHeaderText()).toBe('Deleted');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('[C280498] Location column displays the parent folder of the file', async () => {
|
||||
expect(await dataTable.getItemLocation(fileInFolder)).toEqual(folderNotDeleted);
|
||||
expect(await dataTable.getItemLocation(fileUser)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileSite)).toEqual(siteName);
|
||||
});
|
||||
|
||||
it('[C280499] Location column displays a tooltip with the entire path of the file', async () => {
|
||||
expect(await dataTable.getItemLocationTooltip(fileInFolder)).toEqual(`Personal Files/${folderNotDeleted}`);
|
||||
expect(await dataTable.getItemLocationTooltip(fileUser)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocationTooltip(fileSite)).toEqual(`File Libraries/${siteName}`);
|
||||
});
|
||||
|
||||
it('[C280500] Location column is empty if parent folder no longer exists', async () => {
|
||||
expect(await dataTable.getItemLocation(fileDeleted)).toEqual('');
|
||||
});
|
||||
|
||||
it('[C217144] Location column redirect - file in user Home', async () => {
|
||||
await dataTable.clickItemLocation(fileUser);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280496] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(fileInFolder);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', folderNotDeleted]);
|
||||
});
|
||||
|
||||
it('[C280497] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileSite);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user