mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-19 17:14:45 +00:00
[ACA-1760] use async / await in list-views suite (#669)
This commit is contained in:
parent
4ff92c23e5
commit
23df2ad6a2
@ -42,67 +42,56 @@ describe('Empty list views', () => {
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('empty Personal Files - [C280131]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyDragAndDropText()).toContain('Drag and drop');
|
||||
});
|
||||
it('empty Personal Files - [C280131]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyDragAndDropText()).toContain('Drag and drop');
|
||||
});
|
||||
|
||||
it('empty File Libraries - [C217099]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain(`You aren't a member of any File Libraries yet`);
|
||||
expect(dataTable.getEmptyStateSubtitle()).toContain('Join libraries to upload, view, and share files.');
|
||||
});
|
||||
it('empty File Libraries - [C217099]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain(`You aren't a member of any File Libraries yet`);
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Join libraries to upload, view, and share files.');
|
||||
});
|
||||
|
||||
it('empty Shared Files - [C280132]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain('No shared files or folders');
|
||||
expect(dataTable.getEmptyStateSubtitle()).toContain('Items you share using the Share option are shown here.');
|
||||
});
|
||||
it('empty Shared Files - [C280132]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('No shared files or folders');
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Items you share using the Share option are shown here.');
|
||||
});
|
||||
|
||||
it('empty Recent Files - [C213169]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain('No recent files');
|
||||
expect(dataTable.getEmptyStateSubtitle()).toContain('Items you upload or edit in the last 30 days are shown here.');
|
||||
});
|
||||
it('empty Recent Files - [C213169]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('No recent files');
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Items you upload or edit in the last 30 days are shown here.');
|
||||
});
|
||||
|
||||
it('empty Favorites - [C280133]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain('No favorite files or folders');
|
||||
expect(dataTable.getEmptyStateSubtitle()).toContain('Favorite items that you want to easily find later.');
|
||||
});
|
||||
it('empty Favorites - [C280133]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('No favorite files or folders');
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Favorite items that you want to easily find later.');
|
||||
});
|
||||
|
||||
it('empty Trash - [C280134]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain('Trash is empty');
|
||||
expect(dataTable.getEmptyStateText()).toContain('Items you delete are moved to the Trash.');
|
||||
expect(dataTable.getEmptyStateText()).toContain('Empty Trash to permanently delete items.');
|
||||
});
|
||||
it('empty Trash - [C280134]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('Trash is empty');
|
||||
expect(await dataTable.getEmptyStateText()).toContain('Items you delete are moved to the Trash.');
|
||||
expect(await dataTable.getEmptyStateText()).toContain('Empty Trash to permanently delete items.');
|
||||
});
|
||||
});
|
||||
|
@ -30,7 +30,6 @@ import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Favorites', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const favFolderName = `favFolder-${Utils.random()}`;
|
||||
@ -42,7 +41,7 @@ describe('Favorites', () => {
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@ -58,22 +57,20 @@ describe('Favorites', () => {
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER);
|
||||
|
||||
const file1Id = (await apis.admin.nodes.createFile(fileName1, docLibId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', file1Id);
|
||||
|
||||
const folderId = (await apis.user.nodes.createFolder(favFolderName)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('folder', folderId);
|
||||
|
||||
const parentId = (await apis.user.nodes.createFolder(parentFolder)).entry.id;
|
||||
|
||||
const file2Id = (await apis.user.nodes.createFile(fileName2, parentId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', file2Id);
|
||||
|
||||
const file3Id = (await apis.user.nodes.createFile(fileName3, parentId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.nodes.deleteNodeById(file3Id, false);
|
||||
|
||||
const file4Id = (await apis.user.nodes.createFile(fileName4, parentId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
|
||||
await Promise.all([
|
||||
apis.user.favorites.addFavoriteById('file', file1Id),
|
||||
apis.user.favorites.addFavoriteById('folder', folderId),
|
||||
apis.user.favorites.addFavoriteById('file', file2Id),
|
||||
apis.user.favorites.addFavoriteById('file', file3Id),
|
||||
apis.user.favorites.addFavoriteById('file', file4Id)
|
||||
]);
|
||||
await apis.user.nodes.deleteNodeById(file3Id, false);
|
||||
await apis.user.nodes.deleteNodeById(file4Id, false);
|
||||
await apis.user.trashcan.restore(file4Id);
|
||||
|
||||
@ -130,9 +127,9 @@ describe('Favorites', () => {
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213671]', async () => {
|
||||
expect(dataTable.getItemLocationTileAttr(fileName1)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(dataTable.getItemLocationTileAttr(fileName2)).toEqual(`Personal Files/${parentFolder}`);
|
||||
expect(dataTable.getItemLocationTileAttr(favFolderName)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocationTileAttr(fileName1)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(fileName2)).toEqual(`Personal Files/${parentFolder}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(favFolderName)).toEqual('Personal Files');
|
||||
});
|
||||
|
||||
it('Location column redirect - item in user Home - [C213650]', async () => {
|
||||
|
@ -52,9 +52,8 @@ describe('File Libraries', () => {
|
||||
const fileLibrariesPage = new BrowsingPage();
|
||||
const { dataTable } = fileLibrariesPage;
|
||||
|
||||
beforeAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
beforeAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.people.createUser({ username }),
|
||||
apis.admin.sites.createSite(sitePublic, SITE_VISIBILITY.PUBLIC),
|
||||
apis.admin.sites.createSite(siteModerated, SITE_VISIBILITY.MODERATED, siteDescription),
|
||||
@ -62,51 +61,46 @@ describe('File Libraries', () => {
|
||||
apis.admin.sites.createSite(adminSite, SITE_VISIBILITY.PUBLIC),
|
||||
apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC, null, siteId1),
|
||||
apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC, null, siteId2)
|
||||
])
|
||||
.then(() => apis.admin.sites.addSiteMember(sitePublic, username, SITE_ROLES.SITE_CONSUMER))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteModerated, username, SITE_ROLES.SITE_MANAGER))
|
||||
.then(() => apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONTRIBUTOR))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteId1, username, SITE_ROLES.SITE_CONTRIBUTOR))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteId2, username, SITE_ROLES.SITE_CONTRIBUTOR))
|
||||
]);
|
||||
await Promise.all([
|
||||
apis.admin.sites.addSiteMember(sitePublic, username, SITE_ROLES.SITE_CONSUMER),
|
||||
apis.admin.sites.addSiteMember(siteModerated, username, SITE_ROLES.SITE_MANAGER),
|
||||
apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONTRIBUTOR),
|
||||
apis.admin.sites.addSiteMember(siteId1, username, SITE_ROLES.SITE_CONTRIBUTOR),
|
||||
apis.admin.sites.addSiteMember(siteId2, username, SITE_ROLES.SITE_CONTRIBUTOR)
|
||||
]);
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.admin.sites.deleteSites([
|
||||
sitePublic,
|
||||
siteModerated,
|
||||
sitePrivate,
|
||||
adminSite,
|
||||
siteId1,
|
||||
siteId2
|
||||
]),
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSites([ sitePublic, siteModerated, sitePrivate, adminSite, siteId1, siteId2 ]),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C217095]', () => {
|
||||
it('has the correct columns - [C217095]', async () => {
|
||||
const labels = [ 'Title', 'Status' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(2 + 1, 'Incorrect number of columns');
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(2 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('User can see only the sites he is a member of - [C280501]', () => {
|
||||
const sitesCount = dataTable.countRows();
|
||||
it('User can see only the sites he is a member of - [C280501]', async () => {
|
||||
const sitesCount = await dataTable.countRows();
|
||||
|
||||
const expectedSites = {
|
||||
[sitePrivate]: SITE_VISIBILITY.PRIVATE,
|
||||
@ -115,45 +109,39 @@ describe('File Libraries', () => {
|
||||
};
|
||||
|
||||
expect(sitesCount).toEqual(5, 'Incorrect number of sites displayed');
|
||||
expect(dataTable.getRowByName(adminSite).isPresent()).toBe(false, 'Incorrect site appears in list');
|
||||
expect(await dataTable.getRowByName(adminSite).isPresent()).toBe(false, 'Incorrect site appears in list');
|
||||
|
||||
dataTable.getRows()
|
||||
.map((row) => {
|
||||
return row.all(dataTable.cell).map(cell => cell.getText());
|
||||
})
|
||||
.then((rowCells) => {
|
||||
return rowCells.reduce((acc, cell) => {
|
||||
const rowCells = await dataTable.getRows().map((row) => {
|
||||
return row.all(dataTable.cell).map(async cell => await cell.getText());
|
||||
});
|
||||
const sitesList = rowCells.reduce((acc, cell) => {
|
||||
acc[cell[1]] = cell[2].toUpperCase();
|
||||
return acc;
|
||||
}, {});
|
||||
})
|
||||
.then((sitesList) => {
|
||||
|
||||
Object.keys(expectedSites).forEach((site) => {
|
||||
expect(sitesList[site]).toEqual(expectedSites[site]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Site ID is displayed when two sites have the same name - [C217098]', () => {
|
||||
it('Site ID is displayed when two sites have the same name - [C217098]', async () => {
|
||||
const expectedSites = [
|
||||
`${siteName} (${siteId1})`,
|
||||
`${siteName} (${siteId2})`
|
||||
];
|
||||
dataTable.getCellsContainingName(siteName)
|
||||
.then(resp => {
|
||||
const cells = await dataTable.getCellsContainingName(siteName);
|
||||
const expectedJSON = JSON.stringify(expectedSites.sort());
|
||||
const actualJSON = JSON.stringify(resp.sort());
|
||||
const actualJSON = JSON.stringify(cells.sort());
|
||||
expect(actualJSON).toEqual(expectedJSON);
|
||||
});
|
||||
});
|
||||
|
||||
it('Tooltip for sites without description - [C217096]', () => {
|
||||
const tooltip = dataTable.getItemNameTooltip(sitePrivate);
|
||||
it('Tooltip for sites without description - [C217096]', async () => {
|
||||
const tooltip = await dataTable.getItemNameTooltip(sitePrivate);
|
||||
expect(tooltip).toBe(`${sitePrivate}`);
|
||||
});
|
||||
|
||||
it('Tooltip for sites with description - [C217097]', () => {
|
||||
const tooltip = dataTable.getItemNameTooltip(siteModerated);
|
||||
it('Tooltip for sites with description - [C217097]', async () => {
|
||||
const tooltip = await dataTable.getItemNameTooltip(siteModerated);
|
||||
expect(tooltip).toBe(`${siteDescription}`);
|
||||
});
|
||||
});
|
||||
|
@ -77,15 +77,15 @@ describe('Generic errors', () => {
|
||||
await apis.user.nodes.deleteNodeById(file1Id, false);
|
||||
await browser.get(URL);
|
||||
|
||||
expect(page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
expect(await page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(await page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
});
|
||||
|
||||
it('Invalid URL - [C217315]', async () => {
|
||||
await page.load('invalid page');
|
||||
|
||||
expect(page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
expect(await page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(await page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
|
||||
});
|
||||
|
||||
@ -99,8 +99,8 @@ describe('Generic errors', () => {
|
||||
await loginPage.loginWith(username2);
|
||||
await browser.get(URL);
|
||||
|
||||
expect(page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
expect(await page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(await page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
|
||||
await logoutPage.load();
|
||||
await loginPage.loginWith(username);
|
||||
|
@ -46,8 +46,9 @@ describe('Special permissions', () => {
|
||||
|
||||
xit('');
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username }).then(done);
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
done();
|
||||
});
|
||||
|
||||
describe('file not displayed if user no longer has permissions on it', () => {
|
||||
@ -55,71 +56,60 @@ describe('Special permissions', () => {
|
||||
const fileName = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE)
|
||||
.then(() => apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR))
|
||||
.then(() => apis.admin.nodes.createFiles([ fileName ], `Sites/${sitePrivate}/documentLibrary`)
|
||||
.then(resp => fileId = resp.entry.id))
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', fileId))
|
||||
.then(() => apis.admin.shared.shareFileById(fileId))
|
||||
.then(() => apis.user.nodes.editNodeContent(fileId, 'edited by user'))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
fileId = (await apis.admin.nodes.createFile(fileName, docLibId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', fileId);
|
||||
await apis.admin.shared.shareFileById(fileId);
|
||||
await apis.user.nodes.editNodeContent(fileId, 'edited by user');
|
||||
|
||||
.then(() => apis.user.search.waitForApi(username, { expect: 1 }))
|
||||
.then(() => apis.user.shared.waitForApi({ expect: 1 }))
|
||||
await apis.user.search.waitForApi(username, { expect: 1 });
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR).then(done);
|
||||
afterEach(async (done) => {
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(sitePrivate),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('on Recent Files - [C213173]', () => {
|
||||
recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
})
|
||||
.then(() => apis.admin.sites.deleteSiteMember(sitePrivate, username))
|
||||
.then(() => recentFilesPage.refresh())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
it('on Recent Files - [C213173]', async () => {
|
||||
await recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await recentFilesPage.refresh();
|
||||
expect(await dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
|
||||
it('on Favorites - [C213227]', () => {
|
||||
favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
})
|
||||
.then(() => apis.admin.sites.deleteSiteMember(sitePrivate, username))
|
||||
.then(() => favoritesPage.refresh())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
it('on Favorites - [C213227]', async () => {
|
||||
await favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await favoritesPage.refresh();
|
||||
expect(await dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
|
||||
it('on Shared Files - [C213116]', () => {
|
||||
sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
})
|
||||
.then(() => apis.admin.sites.deleteSiteMember(sitePrivate, username))
|
||||
.then(() => sharedPage.refresh())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
it('on Shared Files - [C213116]', async () => {
|
||||
await sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await sharedPage.refresh();
|
||||
expect(await dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
});
|
||||
|
||||
@ -128,54 +118,47 @@ describe('Special permissions', () => {
|
||||
const fileName = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE)
|
||||
.then(() => apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR))
|
||||
.then(() => apis.admin.sites.getDocLibId(sitePrivate))
|
||||
.then(resp => apis.user.nodes.createFile(fileName, resp))
|
||||
.then(resp => fileId = resp.entry.id)
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', fileId))
|
||||
.then(() => apis.user.shared.shareFileById(fileId))
|
||||
.then(() => apis.user.shared.waitForApi({ expect: 1 }))
|
||||
.then(() => apis.user.search.waitForApi(username, { expect: 1 }))
|
||||
.then(() => apis.admin.sites.deleteSiteMember(sitePrivate, username))
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
fileId = (await apis.user.nodes.createFile(fileName, docLibId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', fileId);
|
||||
await apis.user.shared.shareFileById(fileId);
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
await apis.user.search.waitForApi(username, { expect: 1 });
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(sitePrivate),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it(`on Recent Files - [C213178]`, () => {
|
||||
recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
it(`on Recent Files - [C213178]`, async () => {
|
||||
await recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
|
||||
it(`on Favorites - [C213672]`, () => {
|
||||
favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
it(`on Favorites - [C213672]`, async () => {
|
||||
await favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
|
||||
it(`on Shared Files - [C213668]`, () => {
|
||||
sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
it(`on Shared Files - [C213668]`, async () => {
|
||||
await sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -48,126 +48,112 @@ describe('Personal Files', () => {
|
||||
const userFolder = `user-folder-${Utils.random()}`;
|
||||
const userFile = `file-${Utils.random()}.txt`;
|
||||
|
||||
beforeAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
beforeAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.people.createUser({ username }),
|
||||
apis.admin.nodes.createFolders([ adminFolder ])
|
||||
])
|
||||
.then(() => apis.user.nodes.createFolders([ userFolder ]))
|
||||
.then(() => apis.user.nodes.createFiles([ userFile ], userFolder))
|
||||
.then(done);
|
||||
]);
|
||||
await apis.user.nodes.createFolders([ userFolder ]);
|
||||
await apis.user.nodes.createFiles([ userFile ], userFolder);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.nodes.deleteNodes([ adminFolder ]),
|
||||
apis.user.nodes.deleteNodes([ userFolder ])
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe(`Admin user's personal files`, () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWithAdmin().then(done);
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWithAdmin();
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has Data Dictionary and created content - [C213241]', () => {
|
||||
expect(dataTable.getRowByName('Data Dictionary').isPresent()).toBe(true);
|
||||
expect(dataTable.getRowByName(adminFolder).isPresent()).toBe(true);
|
||||
it('has Data Dictionary and created content - [C213241]', async () => {
|
||||
expect(await dataTable.getRowByName('Data Dictionary').isPresent()).toBe(true);
|
||||
expect(await dataTable.getRowByName(adminFolder).isPresent()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe(`Regular user's personal files`, () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWith(username).then(done);
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C217142]', () => {
|
||||
it('has the correct columns - [C217142]', async () => {
|
||||
const labels = [ 'Name', 'Size', 'Modified', 'Modified by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('has default sorted column - [C217143]', () => {
|
||||
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
it('has default sorted column - [C217143]', async () => {
|
||||
expect(await dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
});
|
||||
|
||||
it('has user created content - [C213242]', () => {
|
||||
expect(dataTable.getRowByName(userFolder).isPresent())
|
||||
.toBe(true);
|
||||
it('has user created content - [C213242]', async () => {
|
||||
expect(await dataTable.getRowByName(userFolder).isPresent()).toBe(true);
|
||||
});
|
||||
|
||||
it('navigates to folder - [C213244]', () => {
|
||||
const getNodeIdPromise = apis.user.nodes
|
||||
.getNodeByPath(`/${userFolder}`)
|
||||
.then(response => response.entry.id);
|
||||
it('navigates to folder - [C213244]', async () => {
|
||||
const nodeId = (await apis.user.nodes.getNodeByPath(`/${userFolder}`)).entry.id;
|
||||
|
||||
const navigatePromise = dataTable
|
||||
.doubleClickOnRowByName(userFolder)
|
||||
.then(() => dataTable.waitForHeader());
|
||||
await dataTable.doubleClickOnRowByName(userFolder)
|
||||
await dataTable.waitForHeader();
|
||||
|
||||
Promise
|
||||
.all([
|
||||
getNodeIdPromise,
|
||||
navigatePromise
|
||||
])
|
||||
.then(([ nodeId ]) => {
|
||||
expect(browser.getCurrentUrl())
|
||||
.toContain(nodeId, 'Node ID is not in the URL');
|
||||
|
||||
expect(dataTable.getRowByName(userFile).isPresent())
|
||||
.toBe(true, 'user file is missing');
|
||||
});
|
||||
expect(await browser.getCurrentUrl()).toContain(nodeId, 'Node ID is not in the URL');
|
||||
expect(await dataTable.getRowByName(userFile).isPresent()).toBe(true, 'user file is missing');
|
||||
});
|
||||
|
||||
it('redirects to Personal Files on clicking the link from sidebar - [C213245]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(userFolder)
|
||||
.then(() => personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
|
||||
.then(() => browser.getCurrentUrl())
|
||||
.then(url => expect(url.endsWith(APP_ROUTES.PERSONAL_FILES)).toBe(true, 'incorrect url'));
|
||||
it('redirects to Personal Files on clicking the link from sidebar - [C213245]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(userFolder);
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
const url = await browser.getCurrentUrl();
|
||||
expect(url.endsWith(APP_ROUTES.PERSONAL_FILES)).toBe(true, 'incorrect url');
|
||||
});
|
||||
|
||||
it('page loads correctly after browser refresh - [C213246]', () => {
|
||||
personalFilesPage.refresh()
|
||||
.then(() => expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES));
|
||||
it('page loads correctly after browser refresh - [C213246]', async () => {
|
||||
await personalFilesPage.refresh();
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
it('page load by URL - [C213247]', () => {
|
||||
let url;
|
||||
browser.getCurrentUrl()
|
||||
.then(resp => url = resp)
|
||||
.then(() => personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
|
||||
.then(() => browser.get(url))
|
||||
.then(() => expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES));
|
||||
it('page load by URL - [C213247]', async () => {
|
||||
const url = await browser.getCurrentUrl();
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await browser.get(url);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -50,91 +50,92 @@ describe('Recent Files', () => {
|
||||
const recentFilesPage = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = recentFilesPage;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.user.nodes.createFolders([ folderName ])).then(resp => folderId = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFiles([ fileName1 ], folderName))
|
||||
.then(() => apis.user.nodes.createFiles([ fileName2 ])).then(resp => file2Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFiles([ fileName3 ]).then(resp => apis.user.nodes.deleteNodeById(resp.entry.id, false)))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.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 apis.user.nodes.deleteNodeById(id, false);
|
||||
|
||||
.then(() => apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC))
|
||||
.then(() => apis.user.sites.getDocLibId(siteName))
|
||||
.then(resp => apis.user.nodes.createFolder(folderSite, resp)).then(resp => folderSiteId = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(fileSite, folderSiteId))
|
||||
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);
|
||||
|
||||
.then(() => apis.user.search.waitForApi(username, { expect: 3 }))
|
||||
await apis.user.search.waitForApi(username, { expect: 3 });
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodesById([ folderId, file2Id ]),
|
||||
apis.user.sites.deleteSite(siteName),
|
||||
apis.admin.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C213168]', () => {
|
||||
it('has the correct columns - [C213168]', async () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Modified' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('default sorting column - [C213171]', () => {
|
||||
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
expect(dataTable.getSortingOrder()).toBe('desc');
|
||||
it('default sorting column - [C213171]', async () => {
|
||||
expect(await dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('displays the files added by the current user in the last 30 days - [C213170]', () => {
|
||||
expect(dataTable.countRows()).toEqual(3, 'Incorrect number of files displayed');
|
||||
expect(dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
|
||||
expect(dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
|
||||
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
it('displays the files added by the current user in the last 30 days - [C213170]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(3, 'Incorrect number of files displayed');
|
||||
expect(await dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
|
||||
it(`file not displayed if it's been deleted - [C213174]`, () => {
|
||||
expect(dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
|
||||
it(`file not displayed if it's been deleted - [C213174]`, async () => {
|
||||
expect(await dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
|
||||
});
|
||||
|
||||
it('Location column displays the parent folder of the file - [C213175]', () => {
|
||||
expect(dataTable.getItemLocation(fileName1).getText()).toEqual(folderName);
|
||||
expect(dataTable.getItemLocation(fileName2).getText()).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocation(fileSite).getText()).toEqual(folderSite);
|
||||
it('Location column displays the parent folder of the file - [C213175]', async () => {
|
||||
expect(await dataTable.getItemLocation(fileName1).getText()).toEqual(folderName);
|
||||
expect(await dataTable.getItemLocation(fileName2).getText()).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileSite).getText()).toEqual(folderSite);
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213177]', () => {
|
||||
expect(dataTable.getItemLocationTileAttr(fileName1)).toEqual(`Personal Files/${folderName}`);
|
||||
expect(dataTable.getItemLocationTileAttr(fileName2)).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}/${folderSite}`);
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213177]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(fileName1)).toEqual(`Personal Files/${folderName}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(fileName2)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}/${folderSite}`);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in user Home - [C213176]', () => {
|
||||
dataTable.clickItemLocation(fileName2)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
|
||||
it('Location column redirect - file in user Home - [C213176]', async () => {
|
||||
await dataTable.clickItemLocation(fileName2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in folder - [C280486]', () => {
|
||||
dataTable.clickItemLocation(fileName1)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderName ]));
|
||||
it('Location column redirect - file in folder - [C280486]', async () => {
|
||||
await dataTable.clickItemLocation(fileName1);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderName ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in site - [C280487]', () => {
|
||||
dataTable.clickItemLocation(fileSite)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName, folderSite ]));
|
||||
it('Location column redirect - file in site - [C280487]', async () => {
|
||||
await dataTable.clickItemLocation(fileSite);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName, folderSite ]);
|
||||
});
|
||||
});
|
||||
|
@ -51,103 +51,104 @@ describe('Shared Files', () => {
|
||||
const sharedFilesPage = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = sharedFilesPage;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
||||
.then(() => apis.admin.nodes.createFiles([ fileAdmin ], `Sites/${siteName}/documentLibrary`))
|
||||
.then(resp => apis.admin.shared.shareFileById(resp.entry.id))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
const nodeId = (await apis.admin.nodes.createFile(fileAdmin, docLibId)).entry.id;
|
||||
await apis.admin.shared.shareFileById(nodeId);
|
||||
|
||||
.then(() => apis.user.nodes.createFolders([ folderUser ]))
|
||||
.then(() => apis.user.nodes.createFiles([ file1User ], folderUser)).then(resp => file1Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(file2User)).then(resp => file2Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(file3User)).then(resp => file3Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(file4User)).then(resp => file4Id = resp.entry.id)
|
||||
.then(() => apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id]))
|
||||
const 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]);
|
||||
|
||||
.then(() => apis.user.shared.waitForApi({ expect: 5 }))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file2Id))
|
||||
.then(() => apis.user.shared.unshareFile(file3User))
|
||||
await apis.user.shared.waitForApi({ expect: 5 });
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
await apis.user.shared.unshareFile(file3User);
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
sharedFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await sharedFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
sharedFilesPage.refresh().then(done);
|
||||
afterEach(async (done) => {
|
||||
await sharedFilesPage.refresh();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodes([ folderUser ]),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C213113]', () => {
|
||||
it('has the correct columns - [C213113]', async () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(6 + 1, 'Incorrect number of columns');
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(6 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('default sorting column - [C213115]', () => {
|
||||
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
expect(dataTable.getSortingOrder()).toBe('desc');
|
||||
it('default sorting column - [C213115]', async () => {
|
||||
expect(await dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('displays the files shared by everyone - [C213114]', () => {
|
||||
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(dataTable.getRowByName(file1User).isPresent()).toBe(true, `${file1User} not displayed`);
|
||||
it('displays the files shared by everyone - [C213114]', async () => {
|
||||
expect(await dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(await dataTable.getRowByName(file1User).isPresent()).toBe(true, `${file1User} not displayed`);
|
||||
});
|
||||
|
||||
it(`file not displayed if it's been deleted - [C213117]`, () => {
|
||||
expect(dataTable.getRowByName(file2User).isPresent()).toBe(false, `${file2User} is displayed`);
|
||||
it(`file not displayed if it's been deleted - [C213117]`, async () => {
|
||||
expect(await dataTable.getRowByName(file2User).isPresent()).toBe(false, `${file2User} is displayed`);
|
||||
});
|
||||
|
||||
// TODO: disabled cause the api is slow to update. Find a way to wait until the file is unshared
|
||||
xit('unshared file is not displayed - [C213118]', async () => {
|
||||
apis.user.shared.waitForApi({ expect: 4 })
|
||||
.then(() => {
|
||||
expect(dataTable.getRowByName(file3User).isPresent()).toBe(false, `${file3User} is displayed`);
|
||||
});
|
||||
xit('unshared file is not displayed - [C213118]', async (done) => {
|
||||
await apis.user.shared.waitForApi({ expect: 4 });
|
||||
expect(await dataTable.getRowByName(file3User).isPresent()).toBe(false, `${file3User} is displayed`);
|
||||
done();
|
||||
});
|
||||
|
||||
it('Location column displays the parent folder of the file - [C213665]', () => {
|
||||
expect(dataTable.getItemLocationTileAttr(file4User)).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocation(fileAdmin).getText()).toEqual(siteName);
|
||||
expect(dataTable.getItemLocation(file1User).getText()).toEqual(folderUser);
|
||||
it('Location column displays the parent folder of the file - [C213665]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(file4User)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileAdmin).getText()).toEqual(siteName);
|
||||
expect(await dataTable.getItemLocation(file1User).getText()).toEqual(folderUser);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in user Home - [C213666]', () => {
|
||||
dataTable.clickItemLocation(file4User)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
|
||||
it('Location column redirect - file in user Home - [C213666]', async () => {
|
||||
await dataTable.clickItemLocation(file4User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in folder - [C280490]', () => {
|
||||
dataTable.clickItemLocation(file1User)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderUser ]));
|
||||
it('Location column redirect - file in folder - [C280490]', async () => {
|
||||
await dataTable.clickItemLocation(file1User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderUser ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in site - [C280491]', () => {
|
||||
dataTable.clickItemLocation(fileAdmin)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]));
|
||||
it('Location column redirect - file in site - [C280491]', async () => {
|
||||
await dataTable.clickItemLocation(fileAdmin);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]);
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213667]', () => {
|
||||
expect(dataTable.getItemLocationTileAttr(fileAdmin)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(dataTable.getItemLocationTileAttr(file1User)).toEqual(`Personal Files/${folderUser}`);
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213667]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(fileAdmin)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(file1User)).toEqual(`Personal Files/${folderUser}`);
|
||||
});
|
||||
});
|
||||
|
@ -56,205 +56,198 @@ describe('File / folder tooltips', () => {
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.user.nodes.createFolder( parent ))
|
||||
.then(resp => parentId = resp.entry.id)
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder( parent )).entry.id;
|
||||
|
||||
.then(() => Promise.all([
|
||||
apis.user.nodes.createFile(file, parentId).then(resp => file1Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithDesc, parentId, '', fileDescription).then(resp => file2Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithTitle, parentId, fileTitle).then(resp => file3Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithTitleAndDesc, parentId, fileTitle, fileDescription)
|
||||
.then(resp => file4Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)
|
||||
.then(resp => file5Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentId, fileNameEqTitleDiffDesc, fileDescription)
|
||||
.then(resp => file6Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentId, fileTitle, fileNameEqDescDiffTitle)
|
||||
.then(resp => file7Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileTitleEqDesc, parentId, fileTitle, fileTitle).then(resp => file8Id = resp.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;
|
||||
|
||||
.then(() => apis.user.shared.shareFilesByIds([ file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id ]))
|
||||
await apis.user.shared.shareFilesByIds([ file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id ]);
|
||||
|
||||
.then(() => apis.user.favorites.addFavoritesByIds('file', [
|
||||
await apis.user.favorites.addFavoritesByIds('file', [
|
||||
file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id
|
||||
]))
|
||||
]);
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodes([ parent ]),
|
||||
apis.admin.trashcan.emptyTrash(),
|
||||
apis.user.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeAll(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.doubleClickOnRowByName(parent))
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
done();
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C255871]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
it('File with name, no title, no description - [C255871]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C255872]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
it('File with name and description, no title - [C255872]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C255873]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
it('File with name and title, no description - [C255873]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C255874]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
it('File with name and title and description, all different - [C255874]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C255875]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
it('File with name and title and description, all equal - [C255875]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C255876]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
it('File with name = title, different description - [C255876]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C255877]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
it('File with name = description, different title - [C255877]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C255878]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
it('File with title = description, different name - [C255878]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Recent Files', () => {
|
||||
beforeAll(done => {
|
||||
apis.user.search.waitForApi(username, { expect: 8 })
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES))
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.search.waitForApi(username, { expect: 8 });
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
done();
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280135]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
it('File with name, no title, no description - [C280135]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280136]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
it('File with name and description, no title - [C280136]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280137]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
it('File with name and title, no description - [C280137]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280138]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
it('File with name and title and description, all different - [C280138]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280139]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
it('File with name and title and description, all equal - [C280139]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280140]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
it('File with name = title, different description - [C280140]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280141]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
it('File with name = description, different title - [C280141]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280142]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
it('File with title = description, different name - [C280142]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
// disabled until ACA-518 is done
|
||||
xdescribe('on Shared Files', () => {
|
||||
beforeAll(done => {
|
||||
apis.user.shared.waitForApi({ expect: 8 })
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES))
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.shared.waitForApi({ expect: 8 });
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('File with name, no title, no description - [C280143]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
xit('File with name, no title, no description - [C280143]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
xit('File with name and description, no title - [C280144]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
xit('File with name and description, no title - [C280144]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name and title, no description - [C280145]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
xit('File with name and title, no description - [C280145]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
xit('File with name and title and description, all different - [C280146]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
xit('File with name and title and description, all different - [C280146]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name and title and description, all equal - [C280147]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
xit('File with name and title and description, all equal - [C280147]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
xit('File with name = title, different description - [C280148]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
xit('File with name = title, different description - [C280148]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name = description, different title - [C280149]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
xit('File with name = description, different title - [C280149]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
xit('File with title = description, different name - [C280150]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
xit('File with title = description, different name - [C280150]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
beforeAll(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280151]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
it('File with name, no title, no description - [C280151]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280152]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
it('File with name and description, no title - [C280152]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280153]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
it('File with name and title, no description - [C280153]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280154]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
it('File with name and title and description, all different - [C280154]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280155]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
it('File with name and title and description, all equal - [C280155]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280156]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
it('File with name = title, different description - [C280156]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280157]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
it('File with name = description, different title - [C280157]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280158]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
it('File with title = description, different name - [C280158]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
@ -263,71 +256,62 @@ describe('File / folder tooltips', () => {
|
||||
let parentForTrashId, file1TrashId, file2TrashId, file3TrashId, file4TrashId;
|
||||
let file5TrashId, file6TrashId, file7TrashId, file8TrashId;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.user.nodes.createFolder( parentForTrash )
|
||||
.then(resp => parentForTrashId = resp.entry.id)
|
||||
.then(() => Promise.all([
|
||||
apis.user.nodes.createFile(file, parentForTrashId)
|
||||
.then(resp => file1TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithDesc, parentForTrashId, '', fileDescription)
|
||||
.then(resp => file2TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithTitle, parentForTrashId, fileTitle)
|
||||
.then(resp => file3TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithTitleAndDesc, parentForTrashId, fileTitle, fileDescription)
|
||||
.then(resp => file4TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentForTrashId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)
|
||||
.then(resp => file5TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentForTrashId, fileNameEqTitleDiffDesc, fileDescription)
|
||||
.then(resp => file6TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentForTrashId, fileTitle, fileNameEqDescDiffTitle)
|
||||
.then(resp => file7TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileTitleEqDesc, parentForTrashId, fileTitle, fileTitle)
|
||||
.then(resp => file8TrashId = resp.entry.id)
|
||||
]))
|
||||
beforeAll(async (done) => {
|
||||
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;
|
||||
|
||||
.then(() => apis.user.nodes.deleteNodesById([
|
||||
await apis.user.nodes.deleteNodesById([
|
||||
file1TrashId, file2TrashId, file3TrashId, file4TrashId, file5TrashId, file6TrashId, file7TrashId, file8TrashId
|
||||
], false))
|
||||
], false);
|
||||
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
apis.user.nodes.deleteNodes([ parentForTrash ]).then(done);
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodes([ parentForTrash ]);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280159]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
it('File with name, no title, no description - [C280159]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280160]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
it('File with name and description, no title - [C280160]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280161]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
it('File with name and title, no description - [C280161]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280162]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
it('File with name and title and description, all different - [C280162]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280163]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
it('File with name and title and description, all equal - [C280163]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280164]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
it('File with name = title, different description - [C280164]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280165]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
it('File with name = description, different title - [C280165]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280166]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
it('File with title = description, different name - [C280166]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -23,7 +23,6 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES, SIDEBAR_LABELS } from '../../configs';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
@ -57,146 +56,150 @@ describe('Trash', () => {
|
||||
const trashPage = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = trashPage;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.admin.nodes.createFiles([ fileAdmin ]).then(resp => fileAdminId = resp.entry.id))
|
||||
.then(() => apis.admin.nodes.createFolders([ folderAdmin ]).then(resp => folderAdminId = resp.entry.id))
|
||||
.then(() => apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER))
|
||||
.then(() => apis.admin.nodes.createFiles([ fileSite ], `Sites/${siteName}/documentLibrary`)
|
||||
.then(resp => fileSiteId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFiles([ fileUser ]).then(resp => fileUserId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolders([ folderUser ]).then(resp => folderUserId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolder(folderDeleted).then(resp => folderDeletedId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFiles([ fileDeleted ], folderDeleted).then(resp => fileDeletedId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolder(folderNotDeleted).then(resp => folderNotDeletedId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFiles([ fileInFolder ], folderNotDeleted).then(resp => fileInFolderId = resp.entry.id))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileAdminId = (await apis.admin.nodes.createFiles([ fileAdmin ])).entry.id;
|
||||
folderAdminId = (await apis.admin.nodes.createFolders([ folderAdmin ])).entry.id;
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
fileSiteId = (await apis.admin.nodes.createFile(fileSite, docLibId)).entry.id;
|
||||
fileUserId = (await apis.user.nodes.createFiles([ fileUser ])).entry.id;
|
||||
folderUserId = (await apis.user.nodes.createFolders([ folderUser ])).entry.id;
|
||||
folderDeletedId = (await apis.user.nodes.createFolder(folderDeleted)).entry.id;
|
||||
fileDeletedId = (await apis.user.nodes.createFiles([ fileDeleted ], folderDeleted)).entry.id;
|
||||
folderNotDeletedId = (await apis.user.nodes.createFolder(folderNotDeleted)).entry.id;
|
||||
fileInFolderId = (await apis.user.nodes.createFiles([ fileInFolder ], folderNotDeleted)).entry.id;
|
||||
|
||||
.then(() => apis.admin.nodes.deleteNodesById([ fileAdminId, folderAdminId ], false))
|
||||
.then(() => apis.user.nodes.deleteNodesById([ fileSiteId, fileUserId, folderUserId, fileInFolderId ], false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(fileDeletedId, false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(folderDeletedId, false))
|
||||
await apis.admin.nodes.deleteNodesById([ fileAdminId, folderAdminId ], false);
|
||||
await apis.user.nodes.deleteNodesById([ fileSiteId, fileUserId, folderUserId, fileInFolderId ], false);
|
||||
await apis.user.nodes.deleteNodeById(fileDeletedId, false);
|
||||
await apis.user.nodes.deleteNodeById(folderDeletedId, false);
|
||||
|
||||
.then(done);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodeById(folderNotDeletedId),
|
||||
apis.admin.trashcan.emptyTrash()
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('as admin', () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWithAdmin().then(done);
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWithAdmin();
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
trashPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await trashPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C213217]', () => {
|
||||
it('has the correct columns - [C213217]', async () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(5 + 1, 'Incorrect number of columns');
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(5 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('displays the files and folders deleted by everyone - [C280493]', () => {
|
||||
expect(dataTable.countRows()).toEqual(8, 'Incorrect number of deleted items displayed');
|
||||
it('displays the files and folders deleted by everyone - [C280493]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(8, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(dataTable.getRowByName(folderAdmin).isPresent()).toBe(true, `${folderAdmin} not displayed`);
|
||||
expect(dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
|
||||
expect(dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
|
||||
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(await dataTable.getRowByName(folderAdmin).isPresent()).toBe(true, `${folderAdmin} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
|
||||
expect(await dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('as user', () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWith(username).then(done);
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
trashPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await trashPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C280494]', () => {
|
||||
it('has the correct columns - [C280494]', async () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Deleted'];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('displays the files and folders deleted by the user - [C213218]', () => {
|
||||
expect(dataTable.countRows()).toEqual(6, 'Incorrect number of deleted items displayed');
|
||||
it('displays the files and folders deleted by the user - [C213218]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(6, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
expect(dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
|
||||
expect(dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
|
||||
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(false, `${fileAdmin} is displayed`);
|
||||
expect(await dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
|
||||
expect(await dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileAdmin).isPresent()).toBe(false, `${fileAdmin} is displayed`);
|
||||
});
|
||||
|
||||
it('default sorting column - [C213219]', () => {
|
||||
expect(dataTable.getSortedColumnHeader().getText()).toBe('Deleted');
|
||||
expect(dataTable.getSortingOrder()).toBe('desc');
|
||||
it('default sorting column - [C213219]', async () => {
|
||||
expect(await dataTable.getSortedColumnHeader().getText()).toBe('Deleted');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('Location column displays the parent folder of the file - [C280498]', () => {
|
||||
expect(dataTable.getItemLocation(fileInFolder).getText()).toEqual(folderNotDeleted);
|
||||
expect(dataTable.getItemLocation(fileUser).getText()).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocation(fileSite).getText()).toEqual(siteName);
|
||||
it('Location column displays the parent folder of the file - [C280498]', async () => {
|
||||
expect(await dataTable.getItemLocation(fileInFolder).getText()).toEqual(folderNotDeleted);
|
||||
expect(await dataTable.getItemLocation(fileUser).getText()).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileSite).getText()).toEqual(siteName);
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C280499]', () => {
|
||||
expect(dataTable.getItemLocationTileAttr(fileInFolder)).toEqual(`Personal Files/${folderNotDeleted}`);
|
||||
expect(dataTable.getItemLocationTileAttr(fileUser)).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}`);
|
||||
it('Location column displays a tooltip with the entire path of the file - [C280499]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(fileInFolder)).toEqual(`Personal Files/${folderNotDeleted}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(fileUser)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}`);
|
||||
});
|
||||
|
||||
it('Location column is empty if parent folder no longer exists - [C280500]', () => {
|
||||
expect(dataTable.getItemLocation(fileDeleted).getText()).toEqual('');
|
||||
it('Location column is empty if parent folder no longer exists - [C280500]', async () => {
|
||||
expect(await dataTable.getItemLocation(fileDeleted).getText()).toEqual('');
|
||||
});
|
||||
|
||||
it('Location column redirect - file in user Home - [C217144]', () => {
|
||||
dataTable.clickItemLocation(fileUser)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
|
||||
it('Location column redirect - file in user Home - [C217144]', async () => {
|
||||
await dataTable.clickItemLocation(fileUser);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in folder - [C280496]', () => {
|
||||
dataTable.clickItemLocation(fileInFolder)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderNotDeleted ]));
|
||||
it('Location column redirect - file in folder - [C280496]', async () => {
|
||||
await dataTable.clickItemLocation(fileInFolder);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderNotDeleted ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in site - [C280497]', () => {
|
||||
dataTable.clickItemLocation(fileSite)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]));
|
||||
it('Location column redirect - file in site - [C280497]', async () => {
|
||||
await dataTable.clickItemLocation(fileSite);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user