mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACA-1920] automate tests for Create file from template (#1303)
* change component ancestor from ElementFinder to string for better usability better naming for some methods small code cleanup * add test components and automate tests for Create File from Template action * ignore e2e-downloads folder * add return types * enable check * enable check after issue got fixed
This commit is contained in:
committed by
Cilibiu Bogdan
parent
0bc4a3453b
commit
569ee98e8d
@@ -187,7 +187,7 @@ describe('Generic tests : ', () => {
|
||||
await dataTable.rightClickOnItem(file1);
|
||||
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed for ${file1}`);
|
||||
expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect number of selected rows');
|
||||
expect(await dataTable.getSelectedRowsCount()).toEqual(1, 'incorrect number of selected rows');
|
||||
expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`);
|
||||
expect(await dataTable.hasCheckMarkIcon(file1)).toBe(true, `${file1} is not selected`);
|
||||
expect(await dataTable.hasCheckMarkIcon(file2)).toBe(false, `${file2} is selected`);
|
||||
@@ -197,11 +197,11 @@ describe('Generic tests : ', () => {
|
||||
it('Unselect items with single click - [C280458]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
|
||||
|
||||
expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number');
|
||||
expect(await dataTable.getSelectedRowsCount()).toEqual(4, 'incorrect selected rows number');
|
||||
|
||||
await dataTable.clickItem(file1);
|
||||
|
||||
expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect selected rows number');
|
||||
expect(await dataTable.getSelectedRowsCount()).toEqual(1, 'incorrect selected rows number');
|
||||
});
|
||||
|
||||
it('Select / unselect items by CMD+click - [C217110]', async () => {
|
||||
@@ -212,13 +212,13 @@ describe('Generic tests : ', () => {
|
||||
await dataTable.clickItem(folder2);
|
||||
await browser.actions().sendKeys(protractor.Key.NULL).perform();
|
||||
|
||||
expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number');
|
||||
expect(await dataTable.getSelectedRowsCount()).toEqual(4, 'incorrect selected rows number');
|
||||
|
||||
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
|
||||
await dataTable.clickItem(file1);
|
||||
await dataTable.clickItem(file2);
|
||||
await browser.actions().sendKeys(protractor.Key.NULL).perform();
|
||||
|
||||
expect(await dataTable.countSelectedRows()).toEqual(2, 'incorrect selected rows number');
|
||||
expect(await dataTable.getSelectedRowsCount()).toEqual(2, 'incorrect selected rows number');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -631,7 +631,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(fileName)).toBe(false, `${fileName} present in ${destination} folder`);
|
||||
|
||||
await page.clickTrash();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
|
||||
}
|
||||
|
||||
async function undoCopyFolder(folderName: string, location: string = '', destination: string, doBefore = null) {
|
||||
@@ -654,7 +654,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(folderName)).toBe(false, `${folderName} present in ${destination} folder`);
|
||||
|
||||
await page.clickTrash();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
|
||||
}
|
||||
|
||||
async function undoCopyFileWithExistingName(fileName: string, location: string = '', destination: string, doBefore = null) {
|
||||
@@ -681,7 +681,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(`${fileInFolder2}-1`)).toBe(false, `${fileInFolder2}-1 is present in ${destination} folder`);
|
||||
|
||||
await page.clickTrash();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
|
||||
}
|
||||
|
||||
async function undoCopyFolderWithExistingName(folderName: string, location: string = '', destination: string, doBefore = null) {
|
||||
@@ -708,7 +708,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(file1InFolderExisting)).toBe(false, `${file1InFolderExisting} present in ${folderName} in ${destination} folder`);
|
||||
|
||||
await page.clickTrash();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
+411
@@ -0,0 +1,411 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SelectTemplateDialog } from '../../components/dialog/select-template-dialog';
|
||||
import { CreateFromTemplateDialog } from '../../components/dialog/create-from-template-dialog';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { AdminActions } from '../../utilities/admin-actions';
|
||||
import { RepoClient, NodeContentTree } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Create file from template', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`;
|
||||
|
||||
const restrictedTemplateFolder = `restricted-templates-${random}`;
|
||||
const templateInRestrictedFolder = `template-restricted-${random}.txt`;
|
||||
|
||||
const templatesFolder1 = `templates-folder1-${random}`;
|
||||
const template1InFolder1 = `template1-1-${random}.txt`;
|
||||
const template2InFolder1 = `template1-2-${random}.txt`;
|
||||
|
||||
const templatesFolder2 = `templates-folder2-${random}`;
|
||||
const template1InFolder2 = `template2-1-${random}.txt`;
|
||||
const templatesSubFolder = `template-subFolder-${random}`;
|
||||
|
||||
const template1InRootFolder = `template3-${random}.txt`;
|
||||
const template2InRootFolder = `template4-${random}.txt`;
|
||||
|
||||
const parent = `parent-${random}`; let parentId;
|
||||
const file1 = {
|
||||
name: `file1-${random}.txt`
|
||||
};
|
||||
const file2 = {
|
||||
name: `file2-${random}.txt`,
|
||||
title: `file2 title`,
|
||||
description: `file2 description`
|
||||
};
|
||||
const duplicateFileName = `duplicate-file-${random}.txt`;
|
||||
const nameWithSpaces = ` file-${random}.txt `;
|
||||
|
||||
const siteName = `site-${random}`;
|
||||
const fileSite = {
|
||||
name: `file-site-${random}.txt`,
|
||||
title: `file site title`,
|
||||
description: `file site description`
|
||||
};
|
||||
const duplicateFileSite = `duplicate-file-site-${random}`;
|
||||
let docLibUserSite: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const selectTemplateDialog = new SelectTemplateDialog();
|
||||
const createFromTemplateDialog = new CreateFromTemplateDialog();
|
||||
const { sidenav } = page;
|
||||
|
||||
beforeAll( async (done) => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
await userApi.nodes.createFile(duplicateFileName, parentId);
|
||||
|
||||
await userApi.sites.createSite(siteName);
|
||||
docLibUserSite = await userApi.sites.getDocLibId(siteName);
|
||||
await userApi.nodes.createFolder(duplicateFileSite, docLibUserSite);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await userApi.nodes.deleteNodeById(parentId);
|
||||
await userApi.sites.deleteSite(siteName);
|
||||
await adminApiActions.cleanNodeTemplatesFolder();
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
it('Select template - dialog UI - when no templates exist in the repo - [C325049]', async () => {
|
||||
await sidenav.openCreateFileFromTemplateDialog();
|
||||
await selectTemplateDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await selectTemplateDialog.getTitle()).toEqual('Select a document template');
|
||||
expect(await selectTemplateDialog.dataTable.isEmpty()).toBe(true, 'Datatable is not empty');
|
||||
expect(await selectTemplateDialog.dataTable.getEmptyListText()).toEqual('No results found');
|
||||
expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual('Node Templates');
|
||||
expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is not disabled');
|
||||
expect(await selectTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
|
||||
});
|
||||
|
||||
describe('with existing templates', () => {
|
||||
const templates: NodeContentTree = {
|
||||
folders: [
|
||||
{
|
||||
name: templatesFolder1,
|
||||
files: [template1InFolder1, template2InFolder1]
|
||||
},
|
||||
{
|
||||
name: templatesFolder2,
|
||||
folders: [
|
||||
{
|
||||
name: templatesSubFolder
|
||||
}
|
||||
],
|
||||
files: [template1InFolder2]
|
||||
},
|
||||
{
|
||||
name: restrictedTemplateFolder,
|
||||
files: [templateInRestrictedFolder]
|
||||
}
|
||||
],
|
||||
files: [template1InRootFolder, template2InRootFolder]
|
||||
};
|
||||
let link: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await adminApiActions.createNodeTemplatesHierarchy(templates);
|
||||
await adminApiActions.removeUserAccessOnNode(restrictedTemplateFolder);
|
||||
link = (await adminApiActions.createLinkToFileName(template2InRootFolder, await adminApiActions.getNodeTemplatesFolderId())).entry.name;
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Select Template dialog', () => {
|
||||
beforeEach(async (done) => {
|
||||
await sidenav.openCreateFileFromTemplateDialog();
|
||||
await selectTemplateDialog.waitForDialogToOpen();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Select template - dialog UI - with existing templates - [C325043]', async () => {
|
||||
expect(await selectTemplateDialog.getTitle()).toEqual('Select a document template');
|
||||
expect(await selectTemplateDialog.dataTable.isEmpty()).toBe(false, 'Datatable is empty');
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(templatesFolder1)).toBe(true, 'template folder not displayed');
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(templatesFolder2)).toBe(true, 'template folder not displayed');
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(template1InRootFolder)).toBe(true, 'template not displayed');
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(template2InRootFolder)).toBe(true, 'template not displayed');
|
||||
expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual('Node Templates');
|
||||
expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is not disabled');
|
||||
expect(await selectTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
|
||||
});
|
||||
|
||||
it(`Templates don't appear if user doesn't have permissions to see them - [C325044]`, async () => {
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(restrictedTemplateFolder)).toBe(false, 'restricted templates folder is displayed');
|
||||
});
|
||||
|
||||
it('Navigate through the templates list with folder hierarchy - [C325045]', async () => {
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(templatesFolder2)).toBe(true, 'template folder not displayed');
|
||||
|
||||
await selectTemplateDialog.dataTable.doubleClickOnRowByName(templatesFolder2);
|
||||
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(templatesSubFolder)).toBe(true, 'template sub-folder not displayed');
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(template1InFolder2)).toBe(true, 'template not displayed');
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(template1InRootFolder)).toBe(false, 'template is displayed');
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(template2InRootFolder)).toBe(false, 'template is displayed');
|
||||
expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual(templatesFolder2);
|
||||
|
||||
await selectTemplateDialog.dataTable.doubleClickOnRowByName(templatesSubFolder);
|
||||
|
||||
expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual(templatesSubFolder);
|
||||
expect(await selectTemplateDialog.dataTable.isEmpty()).toBe(true, 'datatable is not empty');
|
||||
|
||||
await selectTemplateDialog.breadcrumb.openPath();
|
||||
|
||||
expect(await selectTemplateDialog.breadcrumb.getPathItems()).toEqual([ templatesFolder2, 'Node Templates' ]);
|
||||
});
|
||||
|
||||
it(`Templates list doesn't allow multiple selection - [C325047]`, async () => {
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(0, 'Incorrect number of selected rows');
|
||||
|
||||
await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ template1InRootFolder ], 'Incorrect selected item');
|
||||
|
||||
await Utils.pressCmd();
|
||||
await selectTemplateDialog.dataTable.selectItem(template2InRootFolder);
|
||||
await Utils.releaseKeyPressed();
|
||||
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ template2InRootFolder ], 'Incorrect selected item');
|
||||
});
|
||||
|
||||
it('Links to files are not displayed - [C325050]', async () => {
|
||||
expect(await selectTemplateDialog.dataTable.isItemPresent(link)).toBe(false, 'Link to file is displayed');
|
||||
});
|
||||
|
||||
it('Cancel the Select template dialog - [C325048]', async () => {
|
||||
expect(await selectTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
|
||||
|
||||
await selectTemplateDialog.clickCancel();
|
||||
|
||||
expect(await selectTemplateDialog.isDialogOpen()).toBe(false, 'Select Template dialog is open');
|
||||
});
|
||||
|
||||
it('Next button is disabled when selecting a folder - [C216339]', async () => {
|
||||
expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is enabled');
|
||||
|
||||
await selectTemplateDialog.dataTable.selectItem(templatesFolder1);
|
||||
|
||||
expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is enabled');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Create from template dialog', () => {
|
||||
beforeEach(async (done) => {
|
||||
await sidenav.openCreateFileFromTemplateDialog();
|
||||
await selectTemplateDialog.waitForDialogToOpen();
|
||||
await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
|
||||
await selectTemplateDialog.clickNext();
|
||||
await createFromTemplateDialog.waitForDialogToOpen();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Create file from template - dialog UI - [C325020]', async () => {
|
||||
expect(await createFromTemplateDialog.getTitle()).toEqual(`Create new document from '${template1InRootFolder}'`);
|
||||
expect(await createFromTemplateDialog.isNameFieldDisplayed()).toBe(true, 'Name field not displayed');
|
||||
expect(await createFromTemplateDialog.isTitleFieldDisplayed()).toBe(true, 'Title field not displayed');
|
||||
expect(await createFromTemplateDialog.isDescriptionFieldDisplayed()).toBe(true, 'Description field not displayed');
|
||||
expect(await createFromTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
|
||||
expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(true, 'Create button is not enabled');
|
||||
});
|
||||
|
||||
it('File name is required - [C325031]', async () => {
|
||||
expect(await createFromTemplateDialog.getName()).toEqual(template1InRootFolder);
|
||||
await createFromTemplateDialog.deleteNameWithBackspace();
|
||||
|
||||
expect(await createFromTemplateDialog.getValidationMessage()).toEqual('File name is required');
|
||||
expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
|
||||
});
|
||||
|
||||
it('Special characters in file name - [C325032]', async () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
|
||||
for (const name of namesWithSpecialChars) {
|
||||
await createFromTemplateDialog.enterName(name);
|
||||
expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
|
||||
expect(await createFromTemplateDialog.getValidationMessage()).toContain(`File name can't contain these characters`);
|
||||
}
|
||||
});
|
||||
|
||||
it('File name ending with a dot - [C325033]', async () => {
|
||||
await createFromTemplateDialog.enterName('file-name.');
|
||||
|
||||
expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
|
||||
expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`File name can't end with a period .`);
|
||||
});
|
||||
|
||||
it('File name containing only spaces - [C325034]', async () => {
|
||||
await createFromTemplateDialog.enterName(' ');
|
||||
|
||||
expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
|
||||
expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`File name can't contain only spaces`);
|
||||
});
|
||||
|
||||
it('Title too long - [C290146]', async () => {
|
||||
await createFromTemplateDialog.enterTitle(Utils.string257);
|
||||
await Utils.pressTab();
|
||||
|
||||
expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
|
||||
expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Use 256 characters or less for title`);
|
||||
});
|
||||
|
||||
it('Description too long - [C290142]', async () => {
|
||||
await createFromTemplateDialog.enterDescription(Utils.string513);
|
||||
await Utils.pressTab();
|
||||
|
||||
expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
|
||||
expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Use 512 characters or less for description`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('On Personal Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await page.dataTable.doubleClickOnRowByName(parent);
|
||||
await sidenav.openCreateFileFromTemplateDialog();
|
||||
await selectTemplateDialog.waitForDialogToOpen();
|
||||
await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
|
||||
await selectTemplateDialog.clickNext();
|
||||
await createFromTemplateDialog.waitForDialogToOpen();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Create a file from a template - with a new Name - [C325030]', async () => {
|
||||
await createFromTemplateDialog.enterName(file1.name);
|
||||
await createFromTemplateDialog.clickCreate();
|
||||
await createFromTemplateDialog.waitForDialogToClose();
|
||||
await page.dataTable.waitForHeader();
|
||||
|
||||
expect(await page.dataTable.isItemPresent(file1.name)).toBe(true, 'File not displayed in list view');
|
||||
});
|
||||
|
||||
it('Create a file from a template - with a Name, Title and Description - [C325026]', async (done) => {
|
||||
await createFromTemplateDialog.enterName(file2.name);
|
||||
await createFromTemplateDialog.enterTitle(file2.title);
|
||||
await createFromTemplateDialog.enterDescription(file2.description);
|
||||
await createFromTemplateDialog.clickCreate();
|
||||
await createFromTemplateDialog.waitForDialogToClose();
|
||||
await page.dataTable.waitForHeader();
|
||||
|
||||
expect(await page.dataTable.isItemPresent(file2.name)).toBe(true, 'File not displayed in list view');
|
||||
const desc = await userApi.nodes.getNodeDescription(file2.name, parentId);
|
||||
expect(desc).toEqual(file2.description);
|
||||
const title = await userApi.nodes.getNodeTitle(file2.name, parentId);
|
||||
expect(title).toEqual(file2.title);
|
||||
done();
|
||||
});
|
||||
|
||||
it('Create a file with a duplicate name - [C325028]', async () => {
|
||||
await createFromTemplateDialog.enterName(duplicateFileName);
|
||||
await createFromTemplateDialog.clickCreate();
|
||||
|
||||
expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
|
||||
expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
|
||||
it('Cancel file creation - [C325027]', async () => {
|
||||
await createFromTemplateDialog.enterName('test');
|
||||
await createFromTemplateDialog.clickCancel();
|
||||
|
||||
expect(await createFromTemplateDialog.isDialogOpen()).not.toBe(true, 'dialog is not closed');
|
||||
expect(await page.dataTable.isItemPresent('test')).toBe(false, 'File should not appear in the list');
|
||||
});
|
||||
|
||||
it('Trim spaces from file Name - [C325042]', async () => {
|
||||
await createFromTemplateDialog.enterName(nameWithSpaces);
|
||||
await createFromTemplateDialog.clickCreate();
|
||||
await createFromTemplateDialog.waitForDialogToClose();
|
||||
await page.dataTable.waitForHeader();
|
||||
|
||||
expect(await page.dataTable.isItemPresent(nameWithSpaces.trim())).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
});
|
||||
|
||||
describe('On File Libraries', () => {
|
||||
const fileLibrariesPage = new BrowsingPage();
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await fileLibrariesPage.goToMyLibrariesAndWait();
|
||||
await page.dataTable.doubleClickOnRowByName(siteName);
|
||||
await sidenav.openCreateFileFromTemplateDialog();
|
||||
await selectTemplateDialog.waitForDialogToOpen();
|
||||
await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
|
||||
await selectTemplateDialog.clickNext();
|
||||
await createFromTemplateDialog.waitForDialogToOpen();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Create a file from a template - with Name, Title and Description - [C325023]', async (done) => {
|
||||
await createFromTemplateDialog.enterName(fileSite.name);
|
||||
await createFromTemplateDialog.enterTitle(fileSite.title);
|
||||
await createFromTemplateDialog.enterDescription(fileSite.description);
|
||||
await createFromTemplateDialog.clickCreate();
|
||||
await createFromTemplateDialog.waitForDialogToClose();
|
||||
await page.dataTable.waitForHeader();
|
||||
|
||||
expect(await page.dataTable.isItemPresent(fileSite.name)).toBe(true, 'File not displayed in list view');
|
||||
const desc = await userApi.nodes.getNodeDescription(fileSite.name, docLibUserSite);
|
||||
expect(desc).toEqual(fileSite.description);
|
||||
const title = await userApi.nodes.getNodeTitle(fileSite.name, docLibUserSite);
|
||||
expect(title).toEqual(fileSite.title);
|
||||
done();
|
||||
});
|
||||
|
||||
it('Cancel file creation - [C325024]', async () => {
|
||||
await createFromTemplateDialog.enterName('test');
|
||||
await createFromTemplateDialog.clickCancel();
|
||||
|
||||
expect(await createFromTemplateDialog.isDialogOpen()).not.toBe(true, 'dialog is not closed');
|
||||
expect(await page.dataTable.isItemPresent('test')).toBe(false, 'File should not appear in the list');
|
||||
});
|
||||
|
||||
it('Create a file with a duplicate name - [C325025]', async () => {
|
||||
await createFromTemplateDialog.enterName(duplicateFileSite);
|
||||
await createFromTemplateDialog.clickCreate();
|
||||
|
||||
expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
|
||||
expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -23,7 +23,6 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES } from '../../configs';
|
||||
import { LoginPage, BrowsingPage } from '../../pages/pages';
|
||||
import { CreateOrEditFolderDialog } from '../../components/dialog/create-edit-folder-dialog';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
@@ -39,7 +38,6 @@ describe('Create folder', () => {
|
||||
const duplicateFolderName = `folder-${Utils.random()}`;
|
||||
const nameWithSpaces = ` folder-${Utils.random()} `;
|
||||
|
||||
const sitePrivate = `site-private-${Utils.random()}`;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
|
||||
const folderSite = `folder-site-${Utils.random()}`;
|
||||
@@ -59,11 +57,6 @@ describe('Create folder', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
await apis.admin.nodes.createFolder(folderName1, docLibId);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user.nodes.createFolder(duplicateFolderName, parentId);
|
||||
|
||||
@@ -76,7 +69,6 @@ describe('Create folder', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(sitePrivate);
|
||||
await apis.user.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
done();
|
||||
|
||||
@@ -126,7 +126,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('delete a file and check notification - [C217125]', async () => {
|
||||
let items = await page.dataTable.countRows();
|
||||
let items = await page.dataTable.getRowsCount();
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
const message = await page.getSnackBarMessage();
|
||||
@@ -140,7 +140,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('delete multiple files and check notification - [C280502]', async () => {
|
||||
let items = await page.dataTable.countRows();
|
||||
let items = await page.dataTable.getRowsCount();
|
||||
await dataTable.selectMultipleItems([file2, file3]);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
const message = await page.getSnackBarMessage();
|
||||
@@ -155,7 +155,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('delete a folder with content - [C217126]', async () => {
|
||||
let items = await page.dataTable.countRows();
|
||||
let items = await page.dataTable.getRowsCount();
|
||||
await dataTable.selectItem(folder1);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
expect(await dataTable.isItemPresent(folder1)).toBe(false, 'Item was not removed from list');
|
||||
@@ -195,7 +195,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('undo delete of file - [C217132]', async () => {
|
||||
const items = await page.dataTable.countRows();
|
||||
const items = await page.dataTable.getRowsCount();
|
||||
|
||||
await dataTable.selectItem(file5);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
@@ -206,7 +206,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('undo delete of folder with content - [C280503]', async () => {
|
||||
const items = await page.dataTable.countRows();
|
||||
const items = await page.dataTable.getRowsCount();
|
||||
|
||||
await dataTable.selectItem(folder6);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
@@ -218,7 +218,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('undo delete of multiple files - [C280504]', async () => {
|
||||
const items = await page.dataTable.countRows();
|
||||
const items = await page.dataTable.getRowsCount();
|
||||
|
||||
await dataTable.selectMultipleItems([file6, file7]);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
@@ -393,7 +393,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('delete a file and check notification - [C280516]', async () => {
|
||||
let items = await page.dataTable.countRows();
|
||||
let items = await page.dataTable.getRowsCount();
|
||||
|
||||
await dataTable.selectItem(favFile1);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
@@ -408,7 +408,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('delete multiple files and check notification - [C280517]', async () => {
|
||||
let items = await page.dataTable.countRows();
|
||||
let items = await page.dataTable.getRowsCount();
|
||||
|
||||
await dataTable.selectMultipleItems([favFile2, favFile3]);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
@@ -425,7 +425,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('delete a folder with content - [C280518]', async () => {
|
||||
let items = await page.dataTable.countRows();
|
||||
let items = await page.dataTable.getRowsCount();
|
||||
await dataTable.selectItem(favFolder1);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
expect(await dataTable.isItemPresent(favFolder1)).toBe(false, 'Item was not removed from list');
|
||||
@@ -464,7 +464,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('undo delete of file - [C280524]', async () => {
|
||||
const items = await page.dataTable.countRows();
|
||||
const items = await page.dataTable.getRowsCount();
|
||||
|
||||
await dataTable.selectItem(favFile5);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
@@ -474,7 +474,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('undo delete of folder with content - [C280526]', async () => {
|
||||
const items = await page.dataTable.countRows();
|
||||
const items = await page.dataTable.getRowsCount();
|
||||
|
||||
await dataTable.selectItem(favFolder6);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
@@ -486,7 +486,7 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
it('undo delete of multiple files - [C280525]', async () => {
|
||||
const items = await page.dataTable.countRows();
|
||||
const items = await page.dataTable.getRowsCount();
|
||||
|
||||
await dataTable.selectMultipleItems([favFile6, favFile7]);
|
||||
await toolbar.clickMoreActionsDelete();
|
||||
|
||||
@@ -42,7 +42,7 @@ describe('New menu', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, sidenav } = page;
|
||||
|
||||
const { menu } = sidenav;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
@@ -66,107 +66,87 @@ describe('New menu', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('has correct actions - [C286524]', async () => {
|
||||
it('Actions in Personal Files - [C286524]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
expect(await sidenav.menu.isCreateFolderPresent()).toBe(true, 'Create Folder option not present');
|
||||
expect(await sidenav.menu.isCreateLibraryPresent()).toBe(true, 'Create Library option not present');
|
||||
expect(await sidenav.menu.isUploadFilePresent()).toBe(true, 'Upload File option not present');
|
||||
expect(await sidenav.menu.isUploadFolderPresent()).toBe(true, 'Upload Folder option not present');
|
||||
expect(await menu.isUploadFileEnabled()).toBe(true, 'Upload File option not enabled');
|
||||
expect(await menu.isUploadFolderEnabled()).toBe(true, 'Upload Folder option not enabled');
|
||||
|
||||
expect(await sidenav.menu.isCreateLibraryEnabled()).toBe(true, 'Create Library is not enabled');
|
||||
expect(await menu.isCreateFolderEnabled()).toBe(true, 'Create Folder option not enabled');
|
||||
expect(await menu.isCreateLibraryEnabled()).toBe(true, 'Create Library option not enabled');
|
||||
|
||||
expect(await menu.isCreateFileFromTemplateEnabled()).toBe(true, 'Create file from template is not enabled');
|
||||
});
|
||||
|
||||
it('Create folder is enabled when having enough permissions - Personal Files - [C216339]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await page.sidenav.openNewMenu();
|
||||
|
||||
expect(await sidenav.menu.isCreateFolderEnabled()).toBe(true, 'Create folder is not enabled');
|
||||
});
|
||||
|
||||
it('Create folder is enabled when having enough permissions - File Libraries - [C280393]', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await page.dataTable.doubleClickOnRowByName(siteUser);
|
||||
await page.sidenav.openNewMenu();
|
||||
expect(await sidenav.menu.isCreateFolderEnabled()).toBe(true, 'Create folder is not enabled');
|
||||
});
|
||||
|
||||
it('Create folder is disabled when not enough permissions - [C280397]', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteAdmin);
|
||||
await sidenav.openNewMenu();
|
||||
expect(await sidenav.menu.isCreateFolderEnabled()).toBe(false, 'Create folder is not disabled');
|
||||
});
|
||||
|
||||
it('Upload File option is enabled when having enough permissions - on Personal Files - [C217145]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
expect(await sidenav.menu.isUploadFileEnabled()).toBe(true, 'Upload file is not enabled in Personal Files');
|
||||
});
|
||||
|
||||
it('Upload File option is enabled when having permissions - on File Libraries - [C290142]', async () => {
|
||||
it('Actions in File Libraries - user with enough permissions - [C280393]', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteUser);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
expect(await sidenav.menu.isUploadFileEnabled()).toBe(true, 'Upload file is not enabled in File Libraries');
|
||||
expect(await menu.isUploadFileEnabled()).toBe(true, 'Upload file is not enabled in File Libraries');
|
||||
expect(await menu.isUploadFolderEnabled()).toBe(true, 'Upload folder is not enabled in File Libraries');
|
||||
|
||||
expect(await menu.isCreateFolderEnabled()).toBe(true, 'Create folder is not enabled');
|
||||
expect(await menu.isCreateLibraryEnabled()).toBe(true, 'Create Library option not enabled');
|
||||
|
||||
expect(await menu.isCreateFileFromTemplateEnabled()).toBe(true, 'Create file from template is not enabled');
|
||||
});
|
||||
|
||||
it('Upload File option is disabled when user cannot create content in that location - [C217146]', async () => {
|
||||
it('Actions in File Libraries - user without enough permissions - [C280397]', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteAdmin);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
expect(await sidenav.menu.isUploadFileEnabled()).toBe(false, 'Upload file is not disabled');
|
||||
expect(await menu.isUploadFileEnabled()).toBe(false, 'Upload file is not disabled');
|
||||
expect(await menu.isUploadFolderEnabled()).toBe(false, 'Upload folder is not disabled');
|
||||
|
||||
expect(await menu.isCreateFolderEnabled()).toBe(false, 'Create folder is not disabled');
|
||||
expect(await menu.isCreateLibraryEnabled()).toBe(true, 'Create Library option not enabled');
|
||||
|
||||
expect(await menu.isCreateFileFromTemplateEnabled()).toBe(false, 'Create file from template is not disabled');
|
||||
});
|
||||
|
||||
it('Upload Folder option is enabled when having enough permissions - on Personal Files - [C213196]', async () => {
|
||||
it('Enabled actions tooltips - [C216342]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
expect(await sidenav.menu.isUploadFolderEnabled()).toBe(true, 'Upload folder is not enabled in Personal Files');
|
||||
});
|
||||
let tooltip: string;
|
||||
|
||||
it('Upload Folder option is enabled when having permissions - on File Libraries - [C290146]', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteUser);
|
||||
await sidenav.openNewMenu();
|
||||
tooltip = await menu.getTooltipForUploadFile();
|
||||
expect(tooltip).toContain('Select files to upload');
|
||||
|
||||
expect(await sidenav.menu.isUploadFolderEnabled()).toBe(true, 'Upload folder is not enabled in File Libraries');
|
||||
});
|
||||
tooltip = await menu.getTooltipForUploadFolder();
|
||||
expect(tooltip).toContain('Select folders to upload');
|
||||
|
||||
it('Upload Folder option is disabled when user cannot create content in that location - [C213193]', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteAdmin);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
expect(await sidenav.menu.isUploadFolderEnabled()).toBe(false, 'Upload folder is not disabled');
|
||||
});
|
||||
|
||||
it('Create folder enabled button tooltip - [C216342]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const tooltip = await sidenav.menu.getItemTooltip('Create Folder');
|
||||
tooltip = await menu.getTooltipForCreateFolder();
|
||||
expect(tooltip).toContain('Create new folder');
|
||||
|
||||
tooltip = await menu.getTooltipForCreateLibrary();
|
||||
expect(tooltip).toContain('Create a new File Library');
|
||||
|
||||
tooltip = await menu.getTooltipForCreateFileFromTemplate();
|
||||
expect(tooltip).toContain('Create file from template');
|
||||
});
|
||||
|
||||
it('Create folder disabled button tooltip - [C280398]', async () => {
|
||||
it('Disabled actions tooltips - [C280398]', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteAdmin);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const tooltip = await sidenav.menu.getItemTooltip('Create Folder');
|
||||
expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items`);
|
||||
});
|
||||
let tooltip: string;
|
||||
|
||||
it('Create Library button tooltip - [C286526]', async () => {
|
||||
await sidenav.openNewMenu();
|
||||
tooltip = await menu.getTooltipForUploadFile();
|
||||
expect(tooltip).toContain('Files cannot be uploaded whilst viewing the current items');
|
||||
|
||||
const tooltip = await sidenav.menu.getItemTooltip('Create Library');
|
||||
expect(tooltip).toContain('Create a new File Library');
|
||||
tooltip = await menu.getTooltipForUploadFolder();
|
||||
expect(tooltip).toContain('Folders cannot be uploaded whilst viewing the current items');
|
||||
|
||||
tooltip = await menu.getTooltipForCreateFolder();
|
||||
expect(tooltip).toContain('Folders cannot be created whilst viewing the current items');
|
||||
|
||||
tooltip = await menu.getTooltipForCreateFileFromTemplate();
|
||||
expect(tooltip).toContain('Files cannot be created whilst viewing the current items');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -50,51 +50,51 @@ describe('Empty list views', () => {
|
||||
|
||||
it('empty Personal Files - [C280131]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyDragAndDropText()).toContain('Drag and drop');
|
||||
});
|
||||
|
||||
it('empty My Libraries - [C217099]', async () => {
|
||||
await page.goToMyLibraries();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).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 Favorite Libraries - [C289911]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain(`No Favorite Libraries`);
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Favorite a library that you want to find easily later.');
|
||||
});
|
||||
|
||||
it('empty Shared Files - [C280132]', async () => {
|
||||
await page.clickSharedFiles();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).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]', async () => {
|
||||
await page.clickRecentFiles();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('No recent files');
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Items you uploaded or edited in the last 30 days are shown here.');
|
||||
});
|
||||
|
||||
it('empty Favorites - [C280133]', async () => {
|
||||
await page.clickFavorites();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).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]', async () => {
|
||||
await page.clickTrash();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).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.');
|
||||
expect(await dataTable.getEmptyListText()).toContain('Items you delete are moved to the Trash.');
|
||||
expect(await dataTable.getEmptyListText()).toContain('Empty Trash to permanently delete items.');
|
||||
});
|
||||
|
||||
it('Favorites - pagination controls not displayed - [C280111]', async () => {
|
||||
@@ -197,7 +197,7 @@ describe('Empty list views', () => {
|
||||
await searchInput.searchFor('qwertyuiop');
|
||||
await dataTable.waitForBody();
|
||||
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptySearchResultsText()).toContain('Your search returned 0 results');
|
||||
});
|
||||
|
||||
@@ -208,7 +208,7 @@ describe('Empty list views', () => {
|
||||
await searchInput.searchFor('qwertyuiop');
|
||||
await dataTable.waitForBody();
|
||||
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptySearchResultsText()).toContain('Your search returned 0 results');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -95,7 +95,7 @@ describe('Favorites', () => {
|
||||
});
|
||||
|
||||
it('displays the favorite files and folders - [C213226]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(4, 'Incorrect number of items displayed');
|
||||
expect(await dataTable.getRowsCount()).toEqual(4, 'Incorrect number of items displayed');
|
||||
expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`);
|
||||
expect(await dataTable.isItemPresent(favFolderName)).toBe(true, `${favFolderName} not displayed`);
|
||||
|
||||
@@ -110,7 +110,7 @@ describe('File Libraries', () => {
|
||||
});
|
||||
|
||||
it('User can see only the sites he is a member of - [C280501]', async () => {
|
||||
const sitesCount = await dataTable.countRows();
|
||||
const sitesCount = await dataTable.getRowsCount();
|
||||
|
||||
expect(sitesCount).toEqual(10, 'Incorrect number of sites displayed');
|
||||
expect(await dataTable.isItemPresent(adminSite5)).toBe(false, `${adminSite5} should not appear in the list`);
|
||||
@@ -150,10 +150,8 @@ describe('File Libraries', () => {
|
||||
`${siteName} (${siteId1})`,
|
||||
`${siteName} (${siteId2})`
|
||||
];
|
||||
const cells = await dataTable.getCellsContainingName(siteName);
|
||||
const expectedJSON = JSON.stringify(expectedSites.sort());
|
||||
const actualJSON = JSON.stringify(cells.sort());
|
||||
expect(actualJSON).toEqual(expectedJSON);
|
||||
const actualSites = await dataTable.getCellsContainingName(siteName);
|
||||
expect(actualSites.sort()).toEqual(expectedSites.sort());
|
||||
});
|
||||
|
||||
it('Tooltip for sites without description - [C217096]', async () => {
|
||||
@@ -181,7 +179,7 @@ describe('File Libraries', () => {
|
||||
});
|
||||
|
||||
it('User can see only his favorite sites - [C289897]', async () => {
|
||||
const sitesCount = await dataTable.countRows();
|
||||
const sitesCount = await dataTable.getRowsCount();
|
||||
|
||||
expect(sitesCount).toEqual(9, 'Incorrect number of sites displayed');
|
||||
expect(await dataTable.isItemPresent(adminSite6)).toBe(false, `${adminSite6} should not appear`);
|
||||
@@ -221,10 +219,8 @@ describe('File Libraries', () => {
|
||||
`${siteName} (${siteId1})`,
|
||||
`${siteName} (${siteId2})`
|
||||
];
|
||||
const cells = await dataTable.getCellsContainingName(siteName);
|
||||
const expectedJSON = JSON.stringify(expectedSites.sort());
|
||||
const actualJSON = JSON.stringify(cells.sort());
|
||||
expect(actualJSON).toEqual(expectedJSON);
|
||||
const actualSites = await dataTable.getCellsContainingName(siteName);
|
||||
expect(actualSites.sort()).toEqual(expectedSites.sort());
|
||||
});
|
||||
|
||||
it('Tooltip for sites without description - [C289894]', async () => {
|
||||
|
||||
@@ -80,26 +80,26 @@ describe('Special permissions', () => {
|
||||
|
||||
it('on Recent Files - [C213173]', async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await page.refresh();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'Items are still displayed');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Items are still displayed');
|
||||
});
|
||||
|
||||
it('on Favorites - [C213227]', async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await page.refresh();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'Items are still displayed');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Items are still displayed');
|
||||
});
|
||||
|
||||
it('on Shared Files - [C213116]', async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await page.refresh();
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'Items are still displayed');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Items are still displayed');
|
||||
});
|
||||
|
||||
it('on Search Results - [C290122]', async () => {
|
||||
@@ -147,19 +147,19 @@ describe('Special permissions', () => {
|
||||
|
||||
it(`on Recent Files - [C213178]`, async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName)).toEqual('Unknown');
|
||||
});
|
||||
|
||||
it(`on Favorites - [C213672]`, async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName)).toEqual('Unknown');
|
||||
});
|
||||
|
||||
it(`on Shared Files - [C213668]`, async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName)).toEqual('Unknown');
|
||||
});
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ describe('Recent Files', () => {
|
||||
});
|
||||
|
||||
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.getRowsCount()).toEqual(3, 'Incorrect number of files displayed');
|
||||
expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileSite)).toBe(true, `${fileSite} not displayed`);
|
||||
|
||||
@@ -106,7 +106,7 @@ describe('Trash', () => {
|
||||
});
|
||||
|
||||
it('displays the files and folders deleted by everyone - [C280493]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(8, 'Incorrect number of deleted items displayed');
|
||||
expect(await dataTable.getRowsCount()).toEqual(8, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(await dataTable.isItemPresent(fileAdmin)).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(await dataTable.isItemPresent(folderAdmin)).toBe(true, `${folderAdmin} not displayed`);
|
||||
@@ -135,7 +135,7 @@ describe('Trash', () => {
|
||||
});
|
||||
|
||||
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(await dataTable.getRowsCount()).toEqual(6, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(await dataTable.isItemPresent(fileSite)).toBe(true, `${fileSite} not displayed`);
|
||||
expect(await dataTable.isItemPresent(fileUser)).toBe(true, `${fileUser} not displayed`);
|
||||
|
||||
@@ -155,7 +155,7 @@ describe('Pagination on multiple pages on Favorites', () => {
|
||||
it('Next button is disabled on last page - [C280118]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(5);
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await pagination.getCurrentPage()).toContain('Page 5');
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
|
||||
@@ -151,7 +151,7 @@ describe('Pagination on multiple pages', () => {
|
||||
it('Next button is disabled on last page - [C280091]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(5);
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await pagination.getCurrentPage()).toContain('Page 5');
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
@@ -252,7 +252,7 @@ describe('Pagination on multiple pages', () => {
|
||||
it('Next button is disabled on last page - [C291880]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(5);
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await pagination.getCurrentPage()).toContain('Page 5');
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
|
||||
@@ -153,7 +153,7 @@ describe('Pagination on multiple pages on Personal Files', () => {
|
||||
it('Next button is disabled on last page - [C280082]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(5);
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await pagination.getCurrentPage()).toContain('Page 5');
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
|
||||
@@ -152,7 +152,7 @@ describe('Pagination on multiple pages on Recent Files', () => {
|
||||
it('Next button is disabled on last page - [C280109]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(5);
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await pagination.getCurrentPage()).toContain('Page 5');
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
|
||||
@@ -151,7 +151,7 @@ describe('Pagination on multiple pages on Search Results', () => {
|
||||
it('Next button is disabled on last page - [C290130]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(5);
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await pagination.getCurrentPage()).toContain('Page 5');
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
|
||||
@@ -155,7 +155,7 @@ describe('Pagination on multiple pages on Shared Files', () => {
|
||||
it('Next button is disabled on last page - [C280100]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(5);
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await pagination.getCurrentPage()).toContain('Page 5');
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
|
||||
@@ -151,7 +151,7 @@ describe('Pagination on multiple pages on Trash', () => {
|
||||
it('Next button is disabled on last page - [C280127]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(5);
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
|
||||
expect(await pagination.getCurrentPage()).toContain('Page 5');
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
|
||||
@@ -155,7 +155,7 @@ describe('Search filters', () => {
|
||||
await sizeFilter.expandPanel();
|
||||
await sizeFilter.checkSizeHuge();
|
||||
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
|
||||
});
|
||||
|
||||
it('Filter by multiple size categories - [C279203]', async () => {
|
||||
|
||||
@@ -225,13 +225,12 @@ describe('Viewer actions', () => {
|
||||
});
|
||||
|
||||
it('Upload new version action when node is locked - [MNT-21058]', async () => {
|
||||
|
||||
await dataTable.doubleClickOnRowByName(fileForUploadNewVersion2);
|
||||
await viewer.waitForViewerToOpen();
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isCancelEditingActionPresent()).toBe(true, `'Cancel Editing' button should be shown`);
|
||||
expect(await toolbar.menu.isEditOfflineActionPresent()).toBe(false, `'Edit Offline' shouldn't be shown`);
|
||||
expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `'Cancel Editing' button should be shown`);
|
||||
expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `'Edit Offline' shouldn't be shown`);
|
||||
|
||||
await toolbar.menu.clickMenuItem('Upload New Version');
|
||||
await Utils.uploadFileNewVersion(docxFile);
|
||||
@@ -240,8 +239,8 @@ describe('Viewer actions', () => {
|
||||
await uploadNewVersionDialog.clickUpload();
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isCancelEditingActionPresent()).toBe(false, `'Cancel Editing' button shouldn't be shown`);
|
||||
expect(await toolbar.menu.isEditOfflineActionPresent()).toBe(true, `'Edit Offline' should be shown`);
|
||||
expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `'Cancel Editing' button shouldn't be shown`);
|
||||
expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `'Edit Offline' should be shown`);
|
||||
});
|
||||
|
||||
it('Full screen action - [C279282]', async () => {
|
||||
|
||||
Reference in New Issue
Block a user