mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-26 17:24:45 +00:00
[ACA-1767] add viewer actions tests in other list views (#646)
This commit is contained in:
parent
85599f6739
commit
0f3fffcff4
@ -92,12 +92,10 @@ export class CopyMoveDialog extends Component {
|
|||||||
|
|
||||||
async clickCopy() {
|
async clickCopy() {
|
||||||
await this.copyButton.click();
|
await this.copyButton.click();
|
||||||
await this.waitForDialogToClose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickMove() {
|
async clickMove() {
|
||||||
await this.moveButton.click();
|
await this.moveButton.click();
|
||||||
await this.waitForDialogToClose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getRow(folderName: string) {
|
getRow(folderName: string) {
|
||||||
|
@ -35,16 +35,9 @@ import { ManageVersionsDialog } from './../../components/dialog/manage-versions-
|
|||||||
describe('Viewer actions', () => {
|
describe('Viewer actions', () => {
|
||||||
const username = `user-${Utils.random()}`;
|
const username = `user-${Utils.random()}`;
|
||||||
|
|
||||||
const parent = `parent-${Utils.random()}`;
|
|
||||||
let parentId;
|
|
||||||
const docxFile = FILES.docxFile;
|
const docxFile = FILES.docxFile;
|
||||||
let docxFileId;
|
|
||||||
const xlsxFileForMove = FILES.xlsxFile;
|
const xlsxFileForMove = FILES.xlsxFile;
|
||||||
const pdfFileForDelete = FILES.pdfFile;
|
const pdfFileForDelete = FILES.pdfFile;
|
||||||
let pdfFileForDeleteId;
|
|
||||||
|
|
||||||
const destination = `destination-${Utils.random()}`;
|
|
||||||
let destinationId;
|
|
||||||
|
|
||||||
const apis = {
|
const apis = {
|
||||||
admin: new RepoClient(),
|
admin: new RepoClient(),
|
||||||
@ -63,177 +56,781 @@ describe('Viewer actions', () => {
|
|||||||
|
|
||||||
beforeAll(async done => {
|
beforeAll(async done => {
|
||||||
await apis.admin.people.createUser({ username });
|
await apis.admin.people.createUser({ username });
|
||||||
|
|
||||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
|
||||||
docxFileId = (await apis.user.upload.uploadFile(docxFile, parentId)).entry.id;
|
|
||||||
await apis.user.upload.uploadFile(xlsxFileForMove, parentId);
|
|
||||||
pdfFileForDeleteId = (await apis.user.upload.uploadFile(pdfFileForDelete, parentId)).entry.id;
|
|
||||||
|
|
||||||
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id;
|
|
||||||
|
|
||||||
await loginPage.loginWith(username);
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async done => {
|
xit('');
|
||||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
|
||||||
await dataTable.waitForHeader();
|
describe('on Personal Files', () => {
|
||||||
await dataTable.doubleClickOnRowByName(parent);
|
const parent = `parentPF-${Utils.random()}`; let parentId;
|
||||||
await dataTable.waitForHeader();
|
const destination = `destPF-${Utils.random()}`; let destinationId;
|
||||||
done();
|
|
||||||
|
const docxPersonalFiles = `docxPF-${Utils.random()}.docx`; let docxFileId;
|
||||||
|
const xlsxPersonalFiles = `xlsxPF-${Utils.random()}.xlsx`;
|
||||||
|
const pdfPersonalFiles = `pdfPF-${Utils.random()}.pdf`;
|
||||||
|
|
||||||
|
beforeAll(async (done) => {
|
||||||
|
await Promise.all([
|
||||||
|
parentId = (await apis.user.nodes.createFolder(parent)).entry.id,
|
||||||
|
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id
|
||||||
|
]);
|
||||||
|
await Promise.all([
|
||||||
|
docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxPersonalFiles)).entry.id,
|
||||||
|
await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxPersonalFiles),
|
||||||
|
await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfPersonalFiles)
|
||||||
|
]);
|
||||||
|
|
||||||
|
await loginPage.loginWith(username);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(async (done) => {
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(parent);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async (done) => {
|
||||||
|
await Utils.pressEscape();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async (done) => {
|
||||||
|
await Promise.all([
|
||||||
|
apis.user.nodes.deleteNodeById(parentId),
|
||||||
|
apis.user.nodes.deleteNodeById(destinationId),
|
||||||
|
apis.user.trashcan.emptyTrash(),
|
||||||
|
logoutPage.load()
|
||||||
|
]);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Correct actions appear in the viewer toolbar - [C282025]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`);
|
||||||
|
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed`);
|
||||||
|
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed`);
|
||||||
|
expect(await toolbar.isButtonPresent('Print')).toBe(true, `print`);
|
||||||
|
expect(await toolbar.isButtonPresent('Activate full-screen mode')).toBe(true, `full screen`);
|
||||||
|
expect(await toolbar.isButtonPresent('View details')).toBe(true, `view details`);
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `favorite`);
|
||||||
|
expect(await menu.isMenuItemPresent('Share')).toBe(true, `share`);
|
||||||
|
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `copy`);
|
||||||
|
expect(await menu.isMenuItemPresent('Move')).toBe(true, `move`);
|
||||||
|
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `delete`);
|
||||||
|
expect(await menu.isMenuItemPresent('Manage Versions')).toBe(true, `manage versions`);
|
||||||
|
expect(await menu.isMenuItemPresent('Permissions')).toBe(true, `permissions`);
|
||||||
|
await toolbar.closeMoreMenu();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Download action - [C268129]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
await toolbar.clickButton('Download');
|
||||||
|
expect(await Utils.fileExistsOnOS(docxPersonalFiles)).toBe(true, 'File not found in download location');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Copy action - [C268130]', async (done) => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Copy');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickCopy();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Copied 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(docxPersonalFiles).isPresent()).toBe(true, 'Item is not in the list');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(docxPersonalFiles).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
|
||||||
|
await apis.user.nodes.deleteNodeChildren(destinationId);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Move action - [C268131]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(xlsxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Move');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickMove();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Moved 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(xlsxPersonalFiles).isPresent()).toBe(false, 'Item was not moved');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(xlsxPersonalFiles).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Favorite action - [C268132]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Favorite');
|
||||||
|
expect(await apis.user.favorites.isFavorite(docxFileId)).toBe(true, 'Item is not favorite');
|
||||||
|
await viewer.clickClose();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(docxPersonalFiles).isPresent()).toBe(true, 'Item is not present in Favorites list');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Delete action - [C268133]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(pdfPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Delete');
|
||||||
|
expect(await page.getSnackBarMessage()).toContain(`${pdfPersonalFiles} deleted`);
|
||||||
|
// TODO: enable this when ACA-1806 is fixed
|
||||||
|
// expect(await viewer.isViewerOpened()).toBe(false, 'Viewer is opened');
|
||||||
|
await Utils.pressEscape();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(pdfPersonalFiles).isPresent()).toBe(true, 'Item is not present in Trash');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Full screen action - [C279282]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
await Utils.getBrowserLog();
|
||||||
|
|
||||||
|
await toolbar.clickButton('Activate full-screen mode');
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is closed after pressing Full screen');
|
||||||
|
const browserLogAfter = await Utils.getBrowserLog();
|
||||||
|
|
||||||
|
expect(browserLogAfter.length).toEqual(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Share action - [C286313]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Share');
|
||||||
|
expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await shareDialog.clickClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Manage Versions action - [C286316]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Manage Versions');
|
||||||
|
expect(await manageVersionsDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await manageVersionsDialog.clickClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO: enable this once bug is fixed
|
||||||
|
xit('Pressing ESC in the viewer closes only the action dialog - [C286314]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Share');
|
||||||
|
expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await Utils.pressEscape();
|
||||||
|
expect(await shareDialog.isDialogOpen()).toBe(false, 'Dialog is still open');
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async done => {
|
describe('on File Libraries', () => {
|
||||||
await Utils.pressEscape();
|
const siteName = `site-${Utils.random()}`;
|
||||||
done();
|
const destination = `destFL-${Utils.random()}`; let destinationId;
|
||||||
|
|
||||||
|
const docxLibraries = `docxFL-${Utils.random()}.docx`; let docxFileId;
|
||||||
|
const xlsxLibraries = `xlsxFL-${Utils.random()}.xlsx`;
|
||||||
|
const pdfLibraries = `pdfFL-${Utils.random()}.pdf`;
|
||||||
|
|
||||||
|
beforeAll(async (done) => {
|
||||||
|
await apis.user.sites.createSite(siteName);
|
||||||
|
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||||
|
await Promise.all([
|
||||||
|
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id,
|
||||||
|
docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, docLibId, docxLibraries)).entry.id,
|
||||||
|
await apis.user.upload.uploadFileWithRename(xlsxFileForMove, docLibId, xlsxLibraries),
|
||||||
|
await apis.user.upload.uploadFileWithRename(pdfFileForDelete, docLibId, pdfLibraries)
|
||||||
|
]);
|
||||||
|
|
||||||
|
await loginPage.loginWith(username);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(async (done) => {
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(siteName);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async (done) => {
|
||||||
|
await Utils.pressEscape();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async (done) => {
|
||||||
|
await Promise.all([
|
||||||
|
apis.user.sites.deleteSite(siteName),
|
||||||
|
apis.user.nodes.deleteNodeById(destinationId),
|
||||||
|
apis.user.trashcan.emptyTrash(),
|
||||||
|
logoutPage.load()
|
||||||
|
]);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Download action - [C286369]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxLibraries);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
await toolbar.clickButton('Download');
|
||||||
|
expect(await Utils.fileExistsOnOS(docxLibraries)).toBe(true, 'File not found in download location');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Copy action - [C286370]', async (done) => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxLibraries);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Copy');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickCopy();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Copied 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(docxLibraries).isPresent()).toBe(true, 'Item is not in the list');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(docxLibraries).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
|
||||||
|
await apis.user.nodes.deleteNodeChildren(destinationId);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Move action - [C286371]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(xlsxLibraries);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Move');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickMove();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Moved 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(xlsxLibraries).isPresent()).toBe(false, 'Item was not moved');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(xlsxLibraries).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Favorite action - [C286372]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxLibraries);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Favorite');
|
||||||
|
expect(await apis.user.favorites.isFavorite(docxFileId)).toBe(true, 'Item is not favorite');
|
||||||
|
await viewer.clickClose();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(docxLibraries).isPresent()).toBe(true, 'Item is not present in Favorites list');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Delete action - [C286373]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(pdfLibraries);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Delete');
|
||||||
|
expect(await page.getSnackBarMessage()).toContain(`${pdfLibraries} deleted`);
|
||||||
|
// TODO: enable this when ACA-1806 is fixed
|
||||||
|
// expect(await viewer.isViewerOpened()).toBe(false, 'Viewer is opened');
|
||||||
|
await Utils.pressEscape();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(pdfLibraries).isPresent()).toBe(true, 'Item is not present in Trash');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Share action - [C286374]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxLibraries);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Share');
|
||||||
|
expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await shareDialog.clickClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Manage Versions action - [C286375]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxLibraries);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Manage Versions');
|
||||||
|
expect(await manageVersionsDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await manageVersionsDialog.clickClose();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async done => {
|
describe('on Recent Files', () => {
|
||||||
await Promise.all([apis.user.nodes.deleteNodeById(parentId), apis.user.nodes.deleteNodeById(destinationId), logoutPage.load()]);
|
const parent = `parentRF-${Utils.random()}`; let parentId;
|
||||||
done();
|
const destination = `destRF-${Utils.random()}`; let destinationId;
|
||||||
|
|
||||||
|
const docxRecentFiles = `docxRF-${Utils.random()}.docx`; let docxFileId;
|
||||||
|
const xlsxRecentFiles = `xlsxRF-${Utils.random()}.xlsx`;
|
||||||
|
const pdfRecentFiles = `pdfRF-${Utils.random()}.pdf`;
|
||||||
|
|
||||||
|
beforeAll(async (done) => {
|
||||||
|
await Promise.all([
|
||||||
|
parentId = (await apis.user.nodes.createFolder(parent)).entry.id,
|
||||||
|
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id
|
||||||
|
]);
|
||||||
|
await Promise.all([
|
||||||
|
docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxRecentFiles)).entry.id,
|
||||||
|
await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxRecentFiles),
|
||||||
|
await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfRecentFiles)
|
||||||
|
]);
|
||||||
|
|
||||||
|
await apis.user.search.waitForApi(username, {expect: 3});
|
||||||
|
|
||||||
|
await loginPage.loginWith(username);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(async (done) => {
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async (done) => {
|
||||||
|
await Utils.pressEscape();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async (done) => {
|
||||||
|
await Promise.all([
|
||||||
|
apis.user.nodes.deleteNodeById(parentId),
|
||||||
|
apis.user.nodes.deleteNodeById(destinationId),
|
||||||
|
apis.user.trashcan.emptyTrash(),
|
||||||
|
logoutPage.load()
|
||||||
|
]);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Download action - [C286383]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxRecentFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
await toolbar.clickButton('Download');
|
||||||
|
expect(await Utils.fileExistsOnOS(docxRecentFiles)).toBe(true, 'File not found in download location');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Copy action - [C286384]', async (done) => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxRecentFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Copy');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickCopy();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Copied 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(docxRecentFiles).isPresent()).toBe(true, 'Item is not in the list');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(docxRecentFiles).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
|
||||||
|
await apis.user.nodes.deleteNodeChildren(destinationId);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Move action - [C286385]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(xlsxRecentFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Move');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickMove();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Moved 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(xlsxRecentFiles).isPresent()).toBe(true, 'Item is not in the list');
|
||||||
|
expect(await dataTable.getItemLocationTileAttr(xlsxRecentFiles)).toContain(destination, 'Item was not moved');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(xlsxRecentFiles).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Favorite action - [C286386]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxRecentFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Favorite');
|
||||||
|
expect(await apis.user.favorites.isFavorite(docxFileId)).toBe(true, 'Item is not favorite');
|
||||||
|
await viewer.clickClose();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(docxRecentFiles).isPresent()).toBe(true, 'Item is not present in Favorites list');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Delete action - [C286387]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(pdfRecentFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Delete');
|
||||||
|
expect(await page.getSnackBarMessage()).toContain(`${pdfRecentFiles} deleted`);
|
||||||
|
// TODO: enable this when ACA-1806 is fixed
|
||||||
|
// expect(await viewer.isViewerOpened()).toBe(false, 'Viewer is opened');
|
||||||
|
await Utils.pressEscape();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(pdfRecentFiles).isPresent()).toBe(true, 'Item is not present in Trash');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Share action - [C286388]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxRecentFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Share');
|
||||||
|
expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await shareDialog.clickClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Manage Versions action - [C286389]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxRecentFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Manage Versions');
|
||||||
|
expect(await manageVersionsDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await manageVersionsDialog.clickClose();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Correct actions appear in the viewer toolbar - [C282025]', async () => {
|
describe('on Shared Files', () => {
|
||||||
await dataTable.doubleClickOnRowByName(docxFile);
|
const parent = `parentSF-${Utils.random()}`; let parentId;
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
const destination = `destSF-${Utils.random()}`; let destinationId;
|
||||||
|
|
||||||
expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`);
|
const docxSharedFiles = `docxSF-${Utils.random()}.docx`; let docxFileId;
|
||||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed`);
|
const xlsxSharedFiles = `xlsxSF-${Utils.random()}.xlsx`; let xlsxFileId;
|
||||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed`);
|
const pdfSharedFiles = `pdfSF-${Utils.random()}.pdf`; let pdfFileId;
|
||||||
expect(await toolbar.isButtonPresent('Print')).toBe(true, `print`);
|
|
||||||
expect(await toolbar.isButtonPresent('Activate full-screen mode')).toBe(true, `full screen`);
|
beforeAll(async (done) => {
|
||||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `view details`);
|
await Promise.all([
|
||||||
const menu = await toolbar.openMoreMenu();
|
parentId = (await apis.user.nodes.createFolder(parent)).entry.id,
|
||||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `favorite`);
|
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id
|
||||||
expect(await menu.isMenuItemPresent('Share')).toBe(true, `share`);
|
]);
|
||||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `copy`);
|
await Promise.all([
|
||||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `move`);
|
docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxSharedFiles)).entry.id,
|
||||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `delete`);
|
xlsxFileId = (await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxSharedFiles)).entry.id,
|
||||||
expect(await menu.isMenuItemPresent('Manage Versions')).toBe(true, `manage versions`);
|
pdfFileId = (await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfSharedFiles)).entry.id
|
||||||
expect(await menu.isMenuItemPresent('Permissions')).toBe(true, `permissions`);
|
]);
|
||||||
await toolbar.closeMoreMenu();
|
|
||||||
|
await apis.user.shared.shareFilesByIds([docxFileId, xlsxFileId, pdfFileId])
|
||||||
|
await apis.user.shared.waitForApi({expect: 3});
|
||||||
|
|
||||||
|
await loginPage.loginWith(username);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(async (done) => {
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async (done) => {
|
||||||
|
await Utils.pressEscape();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async (done) => {
|
||||||
|
await Promise.all([
|
||||||
|
apis.user.nodes.deleteNodeById(parentId),
|
||||||
|
apis.user.nodes.deleteNodeById(destinationId),
|
||||||
|
apis.user.trashcan.emptyTrash(),
|
||||||
|
logoutPage.load()
|
||||||
|
]);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Download action - [C286376]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxSharedFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
await toolbar.clickButton('Download');
|
||||||
|
expect(await Utils.fileExistsOnOS(docxSharedFiles)).toBe(true, 'File not found in download location');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Copy action - [C286377]', async (done) => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxSharedFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Copy');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickCopy();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Copied 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(docxSharedFiles).isPresent()).toBe(true, 'Item is not in the list');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(docxSharedFiles).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
|
||||||
|
await apis.user.nodes.deleteNodeChildren(destinationId);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Move action - [C286378]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(xlsxSharedFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Move');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickMove();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Moved 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(xlsxSharedFiles).isPresent()).toBe(true, 'Item is not in the list');
|
||||||
|
expect(await dataTable.getItemLocationTileAttr(xlsxSharedFiles)).toContain(destination, 'Item was not moved');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(xlsxSharedFiles).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Favorite action - [C286379]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxSharedFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Favorite');
|
||||||
|
expect(await apis.user.favorites.isFavorite(docxFileId)).toBe(true, 'Item is not favorite');
|
||||||
|
await viewer.clickClose();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(docxSharedFiles).isPresent()).toBe(true, 'Item is not present in Favorites list');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Delete action - [C286380]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(pdfSharedFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Delete');
|
||||||
|
expect(await page.getSnackBarMessage()).toContain(`${pdfSharedFiles} deleted`);
|
||||||
|
// TODO: enable this when ACA-1806 is fixed
|
||||||
|
// expect(await viewer.isViewerOpened()).toBe(false, 'Viewer is opened');
|
||||||
|
await Utils.pressEscape();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(pdfSharedFiles).isPresent()).toBe(true, 'Item is not present in Trash');
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO: enable tis when Unshare is implemented - ACA-122
|
||||||
|
xit('Share action - [C286381]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxSharedFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Share');
|
||||||
|
expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await shareDialog.clickClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Manage Versions action - [C286382]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxSharedFiles);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Manage Versions');
|
||||||
|
expect(await manageVersionsDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await manageVersionsDialog.clickClose();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Download action - [C268129]', async () => {
|
describe('on Favorites', () => {
|
||||||
await dataTable.doubleClickOnRowByName(docxFile);
|
const parent = `parentFav-${Utils.random()}`;
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
let parentId;
|
||||||
|
const destination = `destFav-${Utils.random()}`;
|
||||||
|
let destinationId;
|
||||||
|
|
||||||
await toolbar.clickButton('Download');
|
const docxFavorites = `docxFav-${Utils.random()}.docx`; let docxFileId;
|
||||||
expect(await Utils.fileExistsOnOS(docxFile)).toBe(true, 'File not found in download location');
|
const xlsxFavorites = `xlsxFav-${Utils.random()}.xlsx`; let xlsxFileId;
|
||||||
});
|
const pdfFavorites = `pdfFav-${Utils.random()}.pdf`; let pdfFileId;
|
||||||
|
|
||||||
it('Copy action - [C268130]', async () => {
|
beforeAll(async (done) => {
|
||||||
await dataTable.doubleClickOnRowByName(docxFile);
|
await Promise.all([
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
parentId = (await apis.user.nodes.createFolder(parent)).entry.id,
|
||||||
|
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id
|
||||||
|
]);
|
||||||
|
await Promise.all([
|
||||||
|
docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxFavorites)).entry.id,
|
||||||
|
xlsxFileId = (await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxFavorites)).entry.id,
|
||||||
|
pdfFileId = (await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfFavorites)).entry.id
|
||||||
|
]);
|
||||||
|
|
||||||
const menu = await toolbar.openMoreMenu();
|
await apis.user.favorites.addFavoritesByIds('file', [docxFileId, xlsxFileId, pdfFileId])
|
||||||
await menu.clickMenuItem('Copy');
|
await apis.user.favorites.waitForApi({expect: 3});
|
||||||
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
|
||||||
await copyMoveDialog.selectLocation('Personal Files');
|
|
||||||
await copyMoveDialog.chooseDestination(destination);
|
|
||||||
await copyMoveDialog.clickCopy();
|
|
||||||
expect(await page.getSnackBarMessage()).toContain('Copied 1 item');
|
|
||||||
await viewer.clickClose();
|
|
||||||
expect(await dataTable.getRowByName(docxFile).isPresent()).toBe(true, 'Item is not in the list');
|
|
||||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
|
||||||
await dataTable.waitForHeader();
|
|
||||||
await dataTable.doubleClickOnRowByName(destination);
|
|
||||||
expect(await dataTable.getRowByName(docxFile).isPresent()).toBe(true, 'Item is not present in destination');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Move action - [C268131]', async () => {
|
await loginPage.loginWith(username);
|
||||||
await dataTable.doubleClickOnRowByName(xlsxFileForMove);
|
done();
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
});
|
||||||
|
|
||||||
const menu = await toolbar.openMoreMenu();
|
beforeEach(async (done) => {
|
||||||
await menu.clickMenuItem('Move');
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||||
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
await dataTable.waitForHeader();
|
||||||
await copyMoveDialog.selectLocation('Personal Files');
|
done();
|
||||||
await copyMoveDialog.chooseDestination(destination);
|
});
|
||||||
await copyMoveDialog.clickMove();
|
|
||||||
expect(await page.getSnackBarMessage()).toContain('Moved 1 item');
|
|
||||||
await viewer.clickClose();
|
|
||||||
expect(await dataTable.getRowByName(xlsxFileForMove).isPresent()).toBe(false, 'Item was not moved');
|
|
||||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
|
||||||
await dataTable.waitForHeader();
|
|
||||||
await dataTable.doubleClickOnRowByName(destination);
|
|
||||||
expect(await dataTable.getRowByName(xlsxFileForMove).isPresent()).toBe(true, 'Item is not present in destination');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Favorite action - [C268132]', async () => {
|
afterEach(async (done) => {
|
||||||
await dataTable.doubleClickOnRowByName(docxFile);
|
await Utils.pressEscape();
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
const menu = await toolbar.openMoreMenu();
|
afterAll(async (done) => {
|
||||||
await menu.clickMenuItem('Favorite');
|
await Promise.all([
|
||||||
expect(await apis.user.favorites.isFavorite(docxFileId)).toBe(true, 'Item is not favorite');
|
apis.user.nodes.deleteNodeById(parentId),
|
||||||
await viewer.clickClose();
|
apis.user.nodes.deleteNodeById(destinationId),
|
||||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
apis.user.trashcan.emptyTrash(),
|
||||||
await dataTable.waitForHeader();
|
logoutPage.load()
|
||||||
expect(await dataTable.getRowByName(docxFile).isPresent()).toBe(true, 'Item is not present in Favorites list');
|
]);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
await apis.user.favorites.removeFavoriteById(docxFileId);
|
it('Download action - [C286390]', async () => {
|
||||||
});
|
await dataTable.doubleClickOnRowByName(docxFavorites);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
it('Delete action - [C268133]', async () => {
|
await toolbar.clickButton('Download');
|
||||||
await dataTable.doubleClickOnRowByName(pdfFileForDelete);
|
expect(await Utils.fileExistsOnOS(docxFavorites)).toBe(true, 'File not found in download location');
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
});
|
||||||
|
|
||||||
const menu = await toolbar.openMoreMenu();
|
it('Copy action - [C286391]', async (done) => {
|
||||||
await menu.clickMenuItem('Delete');
|
await dataTable.doubleClickOnRowByName(docxFavorites);
|
||||||
expect(await page.getSnackBarMessage()).toContain(`${pdfFileForDelete} deleted`);
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
// TODO: enable this when ACA-1806 is fixed
|
|
||||||
// expect(await viewer.isViewerOpened()).toBe(false, 'Viewer is opened');
|
|
||||||
await Utils.pressEscape();
|
|
||||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
|
||||||
await dataTable.waitForHeader();
|
|
||||||
expect(await dataTable.getRowByName(pdfFileForDelete).isPresent()).toBe(true, 'Item is not present in Trash');
|
|
||||||
|
|
||||||
await apis.user.trashcan.restore(pdfFileForDeleteId);
|
const menu = await toolbar.openMoreMenu();
|
||||||
});
|
await menu.clickMenuItem('Copy');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickCopy();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Copied 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(docxFavorites).isPresent()).toBe(true, 'Item is not in the list');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(docxFavorites).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
|
||||||
it('Full screen action - [C279282]', async () => {
|
await apis.user.nodes.deleteNodeChildren(destinationId);
|
||||||
await dataTable.doubleClickOnRowByName(docxFile);
|
done();
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
});
|
||||||
await Utils.getBrowserLog();
|
|
||||||
|
|
||||||
await toolbar.clickButton('Activate full-screen mode');
|
it('Move action - [C286392]', async () => {
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is closed after pressing Full screen');
|
await dataTable.doubleClickOnRowByName(xlsxFavorites);
|
||||||
const browserLogAfter = await Utils.getBrowserLog();
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
expect(browserLogAfter.length).toEqual(0);
|
const menu = await toolbar.openMoreMenu();
|
||||||
});
|
await menu.clickMenuItem('Move');
|
||||||
|
expect(await copyMoveDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await copyMoveDialog.selectLocation('Personal Files');
|
||||||
|
await copyMoveDialog.chooseDestination(destination);
|
||||||
|
await copyMoveDialog.clickMove();
|
||||||
|
expect(await page.getSnackBarMessage()).toContain('Moved 1 item');
|
||||||
|
await viewer.clickClose();
|
||||||
|
expect(await dataTable.getRowByName(xlsxFavorites).isPresent()).toBe(true, 'Item is not in the list');
|
||||||
|
expect(await dataTable.getItemLocationTileAttr(xlsxFavorites)).toContain(destination, 'Item was not moved');
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
await dataTable.doubleClickOnRowByName(destination);
|
||||||
|
expect(await dataTable.getRowByName(xlsxFavorites).isPresent()).toBe(true, 'Item is not present in destination');
|
||||||
|
});
|
||||||
|
|
||||||
it('Share action - [C286313]', async () => {
|
it('Favorite action - [C286393]', async () => {
|
||||||
await dataTable.doubleClickOnRowByName(docxFile);
|
await dataTable.doubleClickOnRowByName(xlsxFavorites);
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
const menu = await toolbar.openMoreMenu();
|
const menu = await toolbar.openMoreMenu();
|
||||||
await menu.clickMenuItem('Share');
|
await menu.clickMenuItem('Favorite');
|
||||||
expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
expect(await apis.user.favorites.isFavorite(xlsxFileId)).toBe(false, 'Item is still favorite');
|
||||||
await shareDialog.clickClose();
|
await viewer.clickClose();
|
||||||
});
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(xlsxFavorites).isPresent()).toBe(false, 'Item is still present in Favorites list');
|
||||||
|
});
|
||||||
|
|
||||||
it('Manage Versions action - [C286316]', async () => {
|
it('Delete action - [C286394]', async () => {
|
||||||
await dataTable.doubleClickOnRowByName(docxFile);
|
await dataTable.doubleClickOnRowByName(pdfFavorites);
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
const menu = await toolbar.openMoreMenu();
|
const menu = await toolbar.openMoreMenu();
|
||||||
await menu.clickMenuItem('Manage Versions');
|
await menu.clickMenuItem('Delete');
|
||||||
expect(await manageVersionsDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
expect(await page.getSnackBarMessage()).toContain(`${pdfFavorites} deleted`);
|
||||||
await manageVersionsDialog.clickClose();
|
// TODO: enable this when ACA-1806 is fixed
|
||||||
});
|
// expect(await viewer.isViewerOpened()).toBe(false, 'Viewer is opened');
|
||||||
|
await Utils.pressEscape();
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||||
|
await dataTable.waitForHeader();
|
||||||
|
expect(await dataTable.getRowByName(pdfFavorites).isPresent()).toBe(true, 'Item is not present in Trash');
|
||||||
|
});
|
||||||
|
|
||||||
// TODO: enable this once bug is fixed
|
it('Share action - [C286395]', async () => {
|
||||||
xit('Pressing ESC in the viewer closes only the action dialog - [C286314]', async () => {
|
await dataTable.doubleClickOnRowByName(docxFavorites);
|
||||||
await dataTable.doubleClickOnRowByName(docxFile);
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
|
||||||
|
|
||||||
const menu = await toolbar.openMoreMenu();
|
const menu = await toolbar.openMoreMenu();
|
||||||
await menu.clickMenuItem('Share');
|
await menu.clickMenuItem('Share');
|
||||||
expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
await Utils.pressEscape();
|
await shareDialog.clickClose();
|
||||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Dialog is still open');
|
});
|
||||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
|
||||||
|
it('Manage Versions action - [C286396]', async () => {
|
||||||
|
await dataTable.doubleClickOnRowByName(docxFavorites);
|
||||||
|
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||||
|
|
||||||
|
const menu = await toolbar.openMoreMenu();
|
||||||
|
await menu.clickMenuItem('Manage Versions');
|
||||||
|
expect(await manageVersionsDialog.isDialogOpen()).toBe(true, 'Dialog is not open');
|
||||||
|
await manageVersionsDialog.clickClose();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -85,6 +85,12 @@ export class NodesApi extends RepoApi {
|
|||||||
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId);
|
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async deleteNodeChildren(parentId: string) {
|
||||||
|
const nodeIds = (await this.getNodeChildren(parentId)).list.entries
|
||||||
|
.map(entries => entries.entry.id);
|
||||||
|
return await this.deleteNodesById(nodeIds);
|
||||||
|
}
|
||||||
|
|
||||||
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '') {
|
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '') {
|
||||||
const nodeBody = {
|
const nodeBody = {
|
||||||
name,
|
name,
|
||||||
|
@ -37,7 +37,7 @@ export class UploadApi extends RepoApi {
|
|||||||
async uploadFile(fileName: string, parentFolderId: string = '-my-') {
|
async uploadFile(fileName: string, parentFolderId: string = '-my-') {
|
||||||
const file = fs.createReadStream(`${E2E_ROOT_PATH}/resources/test-files/${fileName}`);
|
const file = fs.createReadStream(`${E2E_ROOT_PATH}/resources/test-files/${fileName}`);
|
||||||
const opts = {
|
const opts = {
|
||||||
mane: file.name,
|
name: file.name,
|
||||||
nodeType: 'cm:content'
|
nodeType: 'cm:content'
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -45,4 +45,15 @@ export class UploadApi extends RepoApi {
|
|||||||
return await this.alfrescoJsApi.upload.uploadFile(file, '', parentFolderId, null, opts);
|
return await this.alfrescoJsApi.upload.uploadFile(file, '', parentFolderId, null, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async uploadFileWithRename(fileName: string, parentFolderId: string = '-my-', newName: string) {
|
||||||
|
const file = fs.createReadStream(`${E2E_ROOT_PATH}/resources/test-files/${fileName}`);
|
||||||
|
const opts = {
|
||||||
|
name: newName,
|
||||||
|
nodeType: 'cm:content'
|
||||||
|
};
|
||||||
|
|
||||||
|
await this.apiAuth();
|
||||||
|
return await this.alfrescoJsApi.upload.uploadFile(file, '', parentFolderId, null, opts);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ export class Utils {
|
|||||||
static random(): string {
|
static random(): string {
|
||||||
return Math.random()
|
return Math.random()
|
||||||
.toString(36)
|
.toString(36)
|
||||||
.substring(3, 10)
|
.substring(5, 10)
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user