mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
add more e2e tests (#851)
This commit is contained in:
parent
e020dc4b77
commit
d0ff69c5dc
@ -46,6 +46,7 @@ export class DataTable extends Component {
|
||||
cell: '.adf-data-table-cell',
|
||||
locationLink: '.aca-location-link',
|
||||
nameLink: '.dl-link',
|
||||
libraryRole: 'app-library-role-column',
|
||||
|
||||
selectedIcon: '.mat-icon',
|
||||
|
||||
@ -199,7 +200,6 @@ export class DataTable extends Component {
|
||||
async selectItem(name: string) {
|
||||
try{
|
||||
const item = this.getRowFirstCell(name);
|
||||
// await Utils.waitUntilElementClickable(item);
|
||||
await item.click();
|
||||
|
||||
} catch (e) {
|
||||
@ -315,4 +315,8 @@ export class DataTable extends Component {
|
||||
const count = await this.menu.getItemsCount();
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
async getLibraryRole(name: string) {
|
||||
return await this.getRowByName(name).element(by.css(DataTable.selectors.libraryRole)).getText();
|
||||
}
|
||||
}
|
||||
|
@ -58,11 +58,6 @@ export class Menu extends Component {
|
||||
}
|
||||
|
||||
async closeMenu() {
|
||||
// if (await this.backdrop.isPresent()) {
|
||||
// return await this.backdrop.click();
|
||||
// } else {
|
||||
// return await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
// }
|
||||
return Utils.pressEscape();
|
||||
}
|
||||
|
||||
@ -148,7 +143,7 @@ export class Menu extends Component {
|
||||
}
|
||||
|
||||
async isMenuItemPresent(title: string) {
|
||||
return await this.component.element(by.cssContainingText(Menu.selectors.item, title)).isPresent();
|
||||
return await browser.element(by.cssContainingText(Menu.selectors.item, title)).isPresent();
|
||||
}
|
||||
|
||||
async isSubMenuItemPresent(title: string) {
|
||||
|
@ -30,7 +30,8 @@ import { Component } from '../component';
|
||||
export class Toolbar extends Component {
|
||||
private static selectors = {
|
||||
root: '.adf-toolbar',
|
||||
button: '.mat-icon-button'
|
||||
// button: '.mat-icon-button'
|
||||
button: 'button'
|
||||
};
|
||||
|
||||
menu: Menu = new Menu();
|
||||
|
@ -66,7 +66,7 @@ describe('Context menu actions - multiple selection : ', () => {
|
||||
folder2Id = (await apis.user.nodes.createFolder(folder2)).entry.id;
|
||||
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = (await apis.user.sites.getDocLibId(siteName));
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
await apis.user.nodes.createFile(file1Site, docLibId);
|
||||
await apis.user.nodes.createFile(file2Site, docLibId);
|
||||
await apis.user.nodes.createFolder(folder1Site, docLibId);
|
||||
|
@ -40,6 +40,9 @@ describe('Context menu actions - single selection : ', () => {
|
||||
const fileSiteUser = `fileUser-${Utils.random()}.txt`;
|
||||
const folderSiteUser = `folderUser-${Utils.random()}`;
|
||||
|
||||
const adminPublic = `admin-public-${Utils.random()}`;
|
||||
const adminModerated = `admin-moderated-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
@ -73,6 +76,12 @@ describe('Context menu actions - single selection : ', () => {
|
||||
await apis.user.favorites.addFavoriteById('folder', folderUserId);
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
|
||||
await apis.admin.sites.createSite(adminPublic);
|
||||
await apis.admin.sites.createSite(adminModerated, SITE_VISIBILITY.MODERATED);
|
||||
await apis.user.favorites.addFavoriteById('site', adminPublic);
|
||||
await apis.user.favorites.addFavoriteById('site', adminModerated);
|
||||
await apis.user.sites.requestToJoin(adminModerated);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
@ -81,6 +90,8 @@ describe('Context menu actions - single selection : ', () => {
|
||||
await apis.user.nodes.deleteNodeById(fileUserId);
|
||||
await apis.user.nodes.deleteNodeById(folderUserId);
|
||||
await apis.user.sites.deleteSite(siteName);
|
||||
await apis.admin.sites.deleteSite(adminPublic);
|
||||
await apis.admin.sites.deleteSite(adminModerated);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
@ -125,12 +136,6 @@ describe('Context menu actions - single selection : ', () => {
|
||||
await page.sidenav.getActiveLink().click();
|
||||
expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed');
|
||||
});
|
||||
|
||||
it('Context menu appears for a library - [C286276]', async () => {
|
||||
await page.clickFileLibrariesAndWait();
|
||||
await dataTable.rightClickOnItem(siteName);
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is displayed for a site');
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
@ -171,7 +176,7 @@ describe('Context menu actions - single selection : ', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('File Libraries', () => {
|
||||
describe('on File Libraries', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.clickFileLibrariesAndWait();
|
||||
@ -210,7 +215,51 @@ describe('Context menu actions - single selection : ', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Shared Files', () => {
|
||||
describe('on a library', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Available actions when a library is selected - My Libraries - [C290080]', async () => {
|
||||
await page.goToMyLibraries();
|
||||
await dataTable.rightClickOnItem(siteName);
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Leave library')).toBe(true, `Leave is not displayed for ${siteName}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${siteName}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${siteName}`);
|
||||
});
|
||||
|
||||
it('Available actions when a library is selected - Favorite Libraries - user is a member - [C290081]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.rightClickOnItem(siteName);
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Leave library')).toBe(true, `Leave is not displayed for ${siteName}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${siteName}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${siteName}`);
|
||||
});
|
||||
|
||||
it('Available actions when a library is selected - Favorite Libraries - user is not a member - [C290082]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.rightClickOnItem(adminPublic);
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Join')).toBe(true, `Join is not displayed for ${adminPublic}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${adminPublic}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${adminPublic}`);
|
||||
});
|
||||
|
||||
it('Available actions when a library is selected - Favorite Libraries - user requested to join - [C290089]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.rightClickOnItem(adminModerated);
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Cancel join')).toBe(true, `Cancel join is not displayed for ${adminModerated}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${adminModerated}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${adminModerated}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Shared Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.clickSharedFilesAndWait();
|
||||
@ -234,7 +283,7 @@ describe('Context menu actions - single selection : ', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Recent Files', () => {
|
||||
describe('on Recent Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.clickRecentFilesAndWait();
|
||||
@ -257,7 +306,7 @@ describe('Context menu actions - single selection : ', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Favorites', () => {
|
||||
describe('on Favorites', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.clickFavoritesAndWait();
|
||||
@ -296,7 +345,7 @@ describe('Context menu actions - single selection : ', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Trash', () => {
|
||||
describe('on Trash', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.clickTrashAndWait();
|
||||
|
@ -23,11 +23,9 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { SITE_VISIBILITY, SITE_ROLES } from '../../configs';
|
||||
import { LoginPage, BrowsingPage } from '../../pages/pages';
|
||||
import { CreateOrEditFolderDialog } from '../../components/dialog/create-edit-folder-dialog';
|
||||
import { Menu } from '../../components/menu/menu';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
@ -41,7 +39,12 @@ describe('Create folder', () => {
|
||||
const duplicateFolderName = `folder-${Utils.random()}`;
|
||||
const nameWithSpaces = ` folder-${Utils.random()} `;
|
||||
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
const sitePrivate = `site-private-${Utils.random()}`;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
|
||||
const folderSite = `folder-site-${Utils.random()}`;
|
||||
const duplicateFolderSite = `folder-${Utils.random()}`;
|
||||
let docLibUserSite;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -52,22 +55,29 @@ describe('Create folder', () => {
|
||||
const page = new BrowsingPage();
|
||||
const createDialog = new CreateOrEditFolderDialog();
|
||||
const { dataTable } = page;
|
||||
const menu = new Menu();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = (await apis.admin.sites.getDocLibId(siteName));
|
||||
|
||||
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(siteName, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
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);
|
||||
|
||||
await apis.user.sites.createSite(siteName);
|
||||
docLibUserSite = await apis.user.sites.getDocLibId(siteName);
|
||||
await apis.user.nodes.createFolder(duplicateFolderSite, docLibUserSite);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await apis.admin.sites.deleteSite(sitePrivate);
|
||||
await apis.user.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
done();
|
||||
});
|
||||
@ -83,13 +93,6 @@ describe('Create folder', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('option is enabled when having enough permissions - [C216339]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(parent);
|
||||
await page.sidenav.openNewMenu();
|
||||
const isEnabled = await menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Create folder is not enabled');
|
||||
});
|
||||
|
||||
it('creates new folder with name - [C216341]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(parent);
|
||||
await page.sidenav.openCreateFolderDialog();
|
||||
@ -112,18 +115,11 @@ describe('Create folder', () => {
|
||||
await createDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.getRowByName(folderName2).isPresent()).toBe(true, 'Folder not displayed');
|
||||
const desc = await apis.user.nodes.getNodeDescription(folderName2, parent);
|
||||
const desc = await apis.user.nodes.getNodeDescription(folderName2, parentId);
|
||||
expect(desc).toEqual(folderDescription);
|
||||
done();
|
||||
});
|
||||
|
||||
it('enabled option tooltip - [C216342]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(parent);
|
||||
await page.sidenav.openNewMenu();
|
||||
await browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform();
|
||||
expect(await menu.getItemTooltip('Create folder')).toContain('Create new folder');
|
||||
});
|
||||
|
||||
it('dialog UI elements - [C216345]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(parent);
|
||||
await page.sidenav.openCreateFolderDialog();
|
||||
@ -238,21 +234,39 @@ describe('Create folder', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('option is disabled when not enough permissions - [C280397]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName);
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1);
|
||||
await fileLibrariesPage.sidenav.openNewMenu();
|
||||
const isEnabled = await menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).toBe(false, 'Create folder is not disabled');
|
||||
it('creates new folder with name and description - [C280394]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(siteName);
|
||||
await page.sidenav.openCreateFolderDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(folderSite);
|
||||
await createDialog.enterDescription(folderDescription);
|
||||
await createDialog.clickCreate();
|
||||
await createDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.getRowByName(folderSite).isPresent()).toBe(true, 'Folder not displayed');
|
||||
const desc = await apis.user.nodes.getNodeDescription(folderSite, docLibUserSite);
|
||||
expect(desc).toEqual(folderDescription);
|
||||
});
|
||||
|
||||
it('disabled option tooltip - [C280398]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName);
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1);
|
||||
await fileLibrariesPage.sidenav.openNewMenu();
|
||||
await browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform();
|
||||
const tooltip = await menu.getItemTooltip('Create folder');
|
||||
expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items`);
|
||||
it('cancel folder creation - [C280403]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(siteName);
|
||||
await page.sidenav.openCreateFolderDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName('test');
|
||||
await createDialog.enterDescription('test description');
|
||||
await createDialog.clickCancel();
|
||||
expect(await createDialog.isDialogOpen()).not.toBe(true, 'dialog is not closed');
|
||||
});
|
||||
|
||||
it('duplicate folder name - [C280404]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(siteName);
|
||||
await page.sidenav.openCreateFolderDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(duplicateFolderSite);
|
||||
await createDialog.clickCreate();
|
||||
const message = await page.getSnackBarMessage();
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(await createDialog.isDialogOpen()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -23,11 +23,9 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { SITE_VISIBILITY } from '../../configs';
|
||||
import { LoginPage, BrowsingPage } from '../../pages/pages';
|
||||
import { CreateLibraryDialog } from '../../components/dialog/create-library-dialog';
|
||||
import { Menu } from '../../components/menu/menu';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
@ -62,7 +60,6 @@ describe('Create library', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const createDialog = new CreateLibraryDialog();
|
||||
const menu = new Menu();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
@ -215,10 +212,4 @@ describe('Create library', () => {
|
||||
expect(await apis.user.sites.getTitle(`${duplicateSite.id}-2`)).toEqual(duplicateSite.name);
|
||||
});
|
||||
|
||||
it('Tooltip for "Create Library" button - [C286526]', async () => {
|
||||
await page.sidenav.openNewMenu();
|
||||
await browser.actions().mouseMove(menu.getItemByLabel('Create Library')).perform();
|
||||
expect(await menu.getItemTooltip('Create Library')).toContain('Create a new File Library');
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,7 +23,6 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { protractor, browser } from 'protractor';
|
||||
import { LoginPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SITE_VISIBILITY, SITE_ROLES } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
@ -43,7 +42,17 @@ describe('Edit folder', () => {
|
||||
const folderNameEdited = `folder-${Utils.random()}`;
|
||||
const folderDescriptionEdited = 'description edited';
|
||||
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
const sitePrivate = `site-private-${Utils.random()}`;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
|
||||
const folderSite = `folder-site-${Utils.random()}`;
|
||||
const folderSiteToEdit = `folder-site-${Utils.random()}`; let folderSiteToEditId;
|
||||
const duplicateFolderSite = `folder-${Utils.random()}`;
|
||||
let docLibUserSite;
|
||||
|
||||
const folderFavorite = `folder-fav-${Utils.random()}`; let folderFavoriteId;
|
||||
const folderFavoriteToEdit = `folder-fav-${Utils.random()}`; let folderFavoriteToEditId;
|
||||
const folderFavoriteDuplicate = `folder-fav-${Utils.random()}`; let folderFavoriteDuplicateId;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -58,41 +67,50 @@ describe('Edit folder', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
await apis.admin.nodes.createFolder(folderName, docLibId);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
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(folderName, parentId, '', folderDescription);
|
||||
await apis.user.nodes.createFolder(folderNameToEdit, parentId);
|
||||
await apis.user.nodes.createFolder(duplicateFolderName, parentId);
|
||||
|
||||
await apis.user.sites.createSite(siteName);
|
||||
docLibUserSite = await apis.user.sites.getDocLibId(siteName);
|
||||
await apis.user.nodes.createFolder(folderSite, docLibUserSite);
|
||||
folderSiteToEditId = (await apis.user.nodes.createFolder(folderSiteToEdit, docLibUserSite)).entry.id;
|
||||
await apis.user.nodes.createFolder(duplicateFolderSite, docLibUserSite);
|
||||
|
||||
folderFavoriteId = (await apis.user.nodes.createFolder(folderFavorite)).entry.id;
|
||||
folderFavoriteToEditId = (await apis.user.nodes.createFolder(folderFavoriteToEdit)).entry.id;
|
||||
folderFavoriteDuplicateId = (await apis.user.nodes.createFolder(folderFavoriteDuplicate)).entry.id;
|
||||
|
||||
await apis.user.favorites.addFavoriteById('folder', folderFavoriteId);
|
||||
await apis.user.favorites.addFavoriteById('folder', folderFavoriteToEditId);
|
||||
await apis.user.favorites.addFavoriteById('folder', folderFavoriteDuplicateId);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodeById(parentId)
|
||||
apis.admin.sites.deleteSite(sitePrivate),
|
||||
apis.user.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodesById([ parentId, folderFavoriteToEditId, folderFavoriteDuplicateId ])
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('dialog UI defaults - [C216331]', async () => {
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.selectItem(folderName);
|
||||
await editButton.click();
|
||||
expect(await editDialog.getTitle()).toEqual('Edit folder');
|
||||
@ -102,6 +120,14 @@ describe('Edit folder', () => {
|
||||
expect(await editDialog.cancelButton.isEnabled()).toBe(true, 'cancel button is not enabled');
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('properties are modified when pressing OK - [C216335]', async (done) => {
|
||||
await dataTable.selectItem(folderNameToEdit);
|
||||
await editButton.click();
|
||||
@ -112,7 +138,7 @@ describe('Edit folder', () => {
|
||||
await editDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.getRowByName(folderNameEdited).isPresent()).toBe(true, 'Folder not displayed');
|
||||
const desc = await apis.user.nodes.getNodeDescription(folderNameEdited, parent);
|
||||
const desc = await apis.user.nodes.getNodeDescription(folderNameEdited, parentId);
|
||||
expect(desc).toEqual(folderDescriptionEdited);
|
||||
done();
|
||||
});
|
||||
@ -176,3 +202,71 @@ describe('Edit folder', () => {
|
||||
expect(await dataTable.getRowByName(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.clickFavoritesAndWait();
|
||||
done();
|
||||
});
|
||||
|
||||
it('properties are modified when pressing OK - [C280384]', async (done) => {
|
||||
await dataTable.selectItem(folderFavoriteToEdit);
|
||||
await editButton.click();
|
||||
await editDialog.waitForDialogToOpen();
|
||||
await editDialog.enterDescription(folderDescriptionEdited);
|
||||
await editDialog.enterName(folderNameEdited);
|
||||
await editDialog.clickUpdate();
|
||||
await editDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.getRowByName(folderNameEdited).isPresent()).toBe(true, 'Folder not displayed');
|
||||
const desc = await apis.user.nodes.getNodeProperty(folderFavoriteToEditId, 'cm:description');
|
||||
expect(desc).toEqual(folderDescriptionEdited);
|
||||
done();
|
||||
});
|
||||
|
||||
it('with duplicate folder name - [C280386]', async () => {
|
||||
await dataTable.selectItem(folderFavorite);
|
||||
await editButton.click();
|
||||
await editDialog.waitForDialogToOpen();
|
||||
await editDialog.enterName(folderFavoriteDuplicate);
|
||||
await editDialog.clickUpdate();
|
||||
const message = await page.getSnackBarMessage();
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
|
||||
describe('on My Libraries', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.clickFileLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
done();
|
||||
});
|
||||
|
||||
it('properties are modified when pressing OK - [C280509]', async (done) => {
|
||||
await dataTable.selectItem(folderSiteToEdit);
|
||||
await editButton.click();
|
||||
await editDialog.waitForDialogToOpen();
|
||||
await editDialog.enterDescription(folderDescriptionEdited);
|
||||
await editDialog.enterName(folderNameEdited);
|
||||
await editDialog.clickUpdate();
|
||||
await editDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.getRowByName(folderNameEdited).isPresent()).toBe(true, 'Folder not displayed');
|
||||
const desc = await apis.user.nodes.getNodeProperty(folderSiteToEditId, 'cm:description');
|
||||
expect(desc).toEqual(folderDescriptionEdited);
|
||||
done();
|
||||
});
|
||||
|
||||
it('with duplicate folder name - [C280511]', async () => {
|
||||
await dataTable.selectItem(folderSite);
|
||||
await editButton.click();
|
||||
await editDialog.waitForDialogToOpen();
|
||||
await editDialog.enterName(duplicateFolderSite);
|
||||
await editDialog.clickUpdate();
|
||||
const message = await page.getSnackBarMessage();
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
187
e2e/suites/actions/library-actions.test.ts
Executable file
187
e2e/suites/actions/library-actions.test.ts
Executable file
@ -0,0 +1,187 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { SITE_VISIBILITY, SITE_ROLES } from '../../configs';
|
||||
import { LoginPage, BrowsingPage } from '../../pages/pages';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { ConfirmDialog } from './../../components/components';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Library actions', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const sitePublic1Admin = `admin-public1-${Utils.random()}`;
|
||||
const sitePublic2Admin = `admin-public2-${Utils.random()}`;
|
||||
const sitePublic3Admin = `admin-public3-${Utils.random()}`;
|
||||
const sitePublic4Admin = `admin-public4-${Utils.random()}`;
|
||||
const siteModerated1Admin = `admin-moderated1-${Utils.random()}`;
|
||||
const siteModerated2Admin = `admin-moderated2-${Utils.random()}`;
|
||||
|
||||
const sitePublicUser = `user-public-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
|
||||
const confirmDialog = new ConfirmDialog();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(sitePublic1Admin);
|
||||
await apis.admin.sites.createSite(sitePublic2Admin);
|
||||
await apis.admin.sites.createSite(sitePublic3Admin);
|
||||
await apis.admin.sites.createSite(sitePublic4Admin);
|
||||
await apis.admin.sites.createSite(siteModerated1Admin, SITE_VISIBILITY.MODERATED);
|
||||
await apis.admin.sites.createSite(siteModerated2Admin, SITE_VISIBILITY.MODERATED);
|
||||
|
||||
await apis.user.sites.createSite(sitePublicUser);
|
||||
|
||||
await apis.admin.sites.addSiteMember(sitePublic2Admin, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await apis.admin.sites.addSiteMember(sitePublic3Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.admin.sites.addSiteMember(sitePublic4Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
await apis.user.favorites.addFavoriteById('site', sitePublic1Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', sitePublic3Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', siteModerated1Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', siteModerated2Admin);
|
||||
|
||||
await apis.user.sites.requestToJoin(siteModerated2Admin);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(sitePublic1Admin);
|
||||
await apis.admin.sites.deleteSite(sitePublic2Admin);
|
||||
await apis.admin.sites.deleteSite(sitePublic3Admin);
|
||||
await apis.admin.sites.deleteSite(sitePublic4Admin);
|
||||
await apis.admin.sites.deleteSite(siteModerated1Admin);
|
||||
await apis.admin.sites.deleteSite(siteModerated2Admin);
|
||||
await apis.user.sites.deleteSite(sitePublicUser);
|
||||
done();
|
||||
});
|
||||
|
||||
it('Join a public library - Favorite Libraries - [C290105]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.selectItem(sitePublic1Admin);
|
||||
await toolbar.clickButton('Join');
|
||||
const role = await dataTable.getLibraryRole(sitePublic1Admin);
|
||||
expect(role).toEqual('Consumer');
|
||||
});
|
||||
|
||||
it('Join a moderated library - Favorite Libraries - [C290109]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.selectItem(siteModerated1Admin);
|
||||
await toolbar.clickButton('Join');
|
||||
const role = await dataTable.getLibraryRole(siteModerated1Admin);
|
||||
expect(role).toEqual('');
|
||||
const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteModerated1Admin);
|
||||
expect(hasJoinRequest).toBe(true, `Join request does not exist on ${siteModerated1Admin}`);
|
||||
});
|
||||
|
||||
it('Leave a library - My Libraries - [C290106]', async () => {
|
||||
await page.goToMyLibraries();
|
||||
await dataTable.selectItem(sitePublic2Admin);
|
||||
await toolbar.clickButton('Leave library');
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.clickButton('OK');
|
||||
const text = await page.getSnackBarMessage();
|
||||
|
||||
expect(text).toEqual(`You have left the library`);
|
||||
expect(await dataTable.getRowByName(sitePublic2Admin).isPresent()).toBe(false, `${sitePublic2Admin} is displayed`);
|
||||
});
|
||||
|
||||
it('Leave a library - Favorite Libraries - [C290110]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.selectItem(sitePublic3Admin);
|
||||
await toolbar.clickButton('Leave library');
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.clickButton('OK');
|
||||
const text = await page.getSnackBarMessage();
|
||||
|
||||
expect(text).toEqual(`You have left the library`);
|
||||
expect(await dataTable.getRowByName(sitePublic3Admin).isPresent()).toBe(true, `${sitePublic3Admin} is not displayed`);
|
||||
});
|
||||
|
||||
it('Confirmation dialog UI - [C290136]', async () => {
|
||||
await page.goToMyLibraries();
|
||||
await dataTable.selectItem(sitePublic4Admin);
|
||||
await toolbar.clickButton('Leave library');
|
||||
await page.waitForDialog();
|
||||
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Leave this library?');
|
||||
expect(await confirmDialog.getText()).toContain('This will remove you as a member of this library.');
|
||||
expect(await confirmDialog.isButtonEnabled('OK')).toBe(true, 'OK button is not enabled');
|
||||
expect(await confirmDialog.isButtonEnabled('Cancel')).toBe(true, 'Cancel button is not enabled');
|
||||
});
|
||||
|
||||
it('Cancel Leave library - [C290111]', async () => {
|
||||
await page.goToMyLibraries();
|
||||
await dataTable.selectItem(sitePublic4Admin);
|
||||
await toolbar.clickButton('Leave library');
|
||||
await page.waitForDialog();
|
||||
|
||||
expect(await confirmDialog.isButtonEnabled('Cancel')).toBe(true, 'Cancel button is not enabled');
|
||||
await confirmDialog.clickButton('Cancel');
|
||||
expect(await dataTable.getRowByName(sitePublic4Admin).isPresent()).toBe(true, `${sitePublic4Admin} was deleted`);
|
||||
});
|
||||
|
||||
it('Leave a library - failure notification - [C290107]', async () => {
|
||||
await page.goToMyLibraries();
|
||||
await dataTable.selectItem(sitePublicUser);
|
||||
await toolbar.clickButton('Leave library');
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.clickButton('OK');
|
||||
const text = await page.getSnackBarMessage();
|
||||
|
||||
expect(text).toEqual(`Cannot leave this library`);
|
||||
});
|
||||
|
||||
it('Cancel join - Favorite Libraries - [C290108]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.selectItem(siteModerated2Admin);
|
||||
await toolbar.clickButton('Cancel join');
|
||||
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toEqual(`Canceled the request to join the library`);
|
||||
|
||||
const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteModerated2Admin);
|
||||
expect(hasJoinRequest).toBe(false, `Join request exists on ${siteModerated2Admin}`);
|
||||
});
|
||||
|
||||
});
|
181
e2e/suites/actions/new-menu.test.ts
Executable file
181
e2e/suites/actions/new-menu.test.ts
Executable file
@ -0,0 +1,181 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { SITE_ROLES } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('New menu', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const siteUser = `site-user-${Utils.random()}`;
|
||||
const siteAdmin = `site-admin-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, sidenav } = page;
|
||||
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteAdmin);
|
||||
await apis.admin.sites.addSiteMember(siteAdmin, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
await apis.user.sites.createSite(siteUser);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.sites.deleteSite(siteUser);
|
||||
await apis.admin.sites.deleteSite(siteAdmin);
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has correct actions - [C286524]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
expect(await sidenav.menu.isMenuItemPresent('Create folder')).toBe(true, 'Create Folder option not present');
|
||||
expect(await sidenav.menu.isMenuItemPresent('Create Library')).toBe(true, 'Create Library option not present');
|
||||
expect(await sidenav.menu.isMenuItemPresent('Upload file')).toBe(true, 'Upload File option not present');
|
||||
expect(await sidenav.menu.isMenuItemPresent('Upload folder')).toBe(true, 'Upload Folder option not present');
|
||||
|
||||
expect(await sidenav.menu.getItemByLabel('Create Library').isEnabled()).toBe(true, 'Create Library is not enabled');
|
||||
});
|
||||
|
||||
it('Create folder is enabled when having enough permissions - Personal Files - [C216339]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await page.sidenav.openNewMenu();
|
||||
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Create folder is not enabled');
|
||||
});
|
||||
|
||||
it('Create folder is enabled when having enough permissions - File Libraries - [C280393]', async () => {
|
||||
await page.clickFileLibraries();
|
||||
await page.dataTable.doubleClickOnRowByName(siteUser);
|
||||
await page.sidenav.openNewMenu();
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Create folder is not enabled');
|
||||
});
|
||||
|
||||
it('Create folder is disabled when not enough permissions - [C280397]', async () => {
|
||||
await page.clickFileLibraries();
|
||||
await dataTable.doubleClickOnRowByName(siteAdmin);
|
||||
await sidenav.openNewMenu();
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).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();
|
||||
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Upload file').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Upload file is not enabled in Personal Files');
|
||||
});
|
||||
|
||||
it('Upload File option is enabled when having permissions - on File Libraries - [C290142]', async () => {
|
||||
await page.clickFileLibraries();
|
||||
await dataTable.doubleClickOnRowByName(siteUser);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Upload file').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Upload file is not enabled in File Libraries');
|
||||
});
|
||||
|
||||
it('Upload File option is disabled when user cannot create content in that location - [C217146]', async () => {
|
||||
await page.clickFileLibraries();
|
||||
await dataTable.doubleClickOnRowByName(siteAdmin);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Upload file').isEnabled();
|
||||
expect(isEnabled).toBe(false, 'Upload file is not disabled');
|
||||
});
|
||||
|
||||
it('Upload Folder option is enabled when having enough permissions - on Personal Files - [C213196]', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Upload folder').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Upload folder is not enabled in Personal Files');
|
||||
});
|
||||
|
||||
it('Upload Folder option is enabled when having permissions - on File Libraries - [C290146]', async () => {
|
||||
await page.clickFileLibraries();
|
||||
await dataTable.doubleClickOnRowByName(siteUser);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Upload folder').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Upload folder is not enabled in File Libraries');
|
||||
});
|
||||
|
||||
it('Upload Folder option is disabled when user cannot create content in that location - [C213193]', async () => {
|
||||
await page.clickFileLibraries();
|
||||
await dataTable.doubleClickOnRowByName(siteAdmin);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const isEnabled = await sidenav.menu.getItemByLabel('Upload folder').isEnabled();
|
||||
expect(isEnabled).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');
|
||||
expect(tooltip).toContain('Create new folder');
|
||||
});
|
||||
|
||||
it('Create folder disabled button tooltip - [C280398]', async () => {
|
||||
await page.clickFileLibraries();
|
||||
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`);
|
||||
});
|
||||
|
||||
it('Create Library button tooltip - [C286526]', async () => {
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const tooltip = await sidenav.menu.getItemTooltip('Create Library');
|
||||
expect(tooltip).toContain('Create a new File Library');
|
||||
});
|
||||
|
||||
});
|
@ -40,6 +40,8 @@ describe('Permanently delete from Trash', () => {
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let foldersIds;
|
||||
|
||||
const site = `site-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
@ -55,8 +57,11 @@ describe('Permanently delete from Trash', () => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
filesIds = (await apis.user.nodes.createFiles([ file1, file2, file3 ])).list.entries.map(entries => entries.entry.id);
|
||||
foldersIds = (await apis.user.nodes.createFolders([ folder1, folder2 ])).list.entries.map(entries => entries.entry.id);
|
||||
await apis.user.sites.createSite(site);
|
||||
|
||||
await apis.user.nodes.deleteNodesById(filesIds, false);
|
||||
await apis.user.nodes.deleteNodesById(foldersIds, false);
|
||||
await apis.user.sites.deleteSite(site, false);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
@ -72,7 +77,7 @@ describe('Permanently delete from Trash', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('delete file - [C217091]', async () => {
|
||||
it('delete a file - [C217091]', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await page.waitForDialog();
|
||||
@ -83,7 +88,7 @@ describe('Permanently delete from Trash', () => {
|
||||
expect(await dataTable.getRowByName(file1).isPresent()).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
|
||||
it('delete folder - [C280416]', async () => {
|
||||
it('delete a folder - [C280416]', async () => {
|
||||
await dataTable.selectItem(folder1);
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await page.waitForDialog();
|
||||
@ -94,6 +99,17 @@ describe('Permanently delete from Trash', () => {
|
||||
expect(await dataTable.getRowByName(folder1).isPresent()).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
|
||||
it('delete a library - [C290103]', async () => {
|
||||
await dataTable.selectItem(site);
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.clickButton('Delete');
|
||||
const text = await page.getSnackBarMessage();
|
||||
|
||||
expect(text).toEqual(`${site} deleted`);
|
||||
expect(await dataTable.getRowByName(site).isPresent()).toBe(false, `${site} was not deleted`);
|
||||
});
|
||||
|
||||
it('delete multiple items - [C280417]', async () => {
|
||||
await dataTable.selectMultipleItems([ file2, folder2 ]);
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
|
@ -55,15 +55,17 @@ describe('Restore from Trash', () => {
|
||||
xit('');
|
||||
|
||||
describe('successful restore', () => {
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
let folderId;
|
||||
const file = `file-${Utils.random()}.txt`; let fileId;
|
||||
const folder = `folder-${Utils.random()}`; let folderId;
|
||||
const site = `site-${Utils.random()}`;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
folderId = (await apis.user.nodes.createFolder(folder)).entry.id;
|
||||
await apis.user.sites.createSite(site);
|
||||
|
||||
await apis.user.nodes.deleteNodesById([fileId, folderId], false);
|
||||
await apis.user.sites.deleteSite(site, false);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -103,6 +105,17 @@ describe('Restore from Trash', () => {
|
||||
await apis.user.nodes.deleteNodeById(folderId, false);
|
||||
});
|
||||
|
||||
it('restore library - [C290104]', async () => {
|
||||
await dataTable.selectItem(site);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toContain(`${site} restored`);
|
||||
expect(text).toContain(`View`);
|
||||
expect(await dataTable.getRowByName(site).isPresent()).toBe(false, `${site} was not removed from list`);
|
||||
await page.clickFileLibrariesAndWait();
|
||||
expect(await page.dataTable.getRowByName(site).isPresent()).toBe(true, `${site} not displayed in list`);
|
||||
});
|
||||
|
||||
it('restore multiple items - [C217182]', async () => {
|
||||
await dataTable.selectMultipleItems([file, folder]);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
|
@ -40,6 +40,9 @@ describe('Toolbar actions - single selection : ', () => {
|
||||
const fileInSite = `fileAdmin-${Utils.random()}.txt`;
|
||||
const folderInSite = `folderAdmin-${Utils.random()}`;
|
||||
|
||||
const adminPublic = `admin-public-${Utils.random()}`;
|
||||
const adminModerated = `admin-moderated-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
@ -66,13 +69,18 @@ describe('Toolbar actions - single selection : ', () => {
|
||||
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
|
||||
await apis.user.nodes.createFile(fileInSite, docLibId);
|
||||
await apis.user.nodes.createFolder(folderInSite, docLibId);
|
||||
|
||||
await apis.user.nodes.deleteNodeById(fileForDeleteId, false);
|
||||
await apis.user.nodes.deleteNodeById(folderForDeleteId, false);
|
||||
|
||||
await apis.admin.sites.createSite(adminPublic);
|
||||
await apis.admin.sites.createSite(adminModerated, SITE_VISIBILITY.MODERATED);
|
||||
await apis.user.favorites.addFavoriteById('site', adminPublic);
|
||||
await apis.user.favorites.addFavoriteById('site', adminModerated);
|
||||
await apis.user.sites.requestToJoin(adminModerated);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
@ -82,6 +90,8 @@ describe('Toolbar actions - single selection : ', () => {
|
||||
apis.user.nodes.deleteNodeById(fileUserId),
|
||||
apis.user.nodes.deleteNodeById(folderUserId),
|
||||
apis.user.sites.deleteSite(siteName),
|
||||
apis.admin.sites.deleteSite(adminPublic),
|
||||
apis.admin.sites.deleteSite(adminModerated),
|
||||
apis.user.trashcan.emptyTrash()
|
||||
]);
|
||||
done();
|
||||
@ -96,26 +106,6 @@ describe('Toolbar actions - single selection : ', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('Correct actions appear when a library is selected - My Libraries - [C213135]', async () => {
|
||||
await page.goToMyLibraries();
|
||||
await dataTable.selectItem(siteName);
|
||||
expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed');
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${siteName}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${siteName}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${siteName}`);
|
||||
});
|
||||
|
||||
it('Correct actions appear when a library is selected - Favorite Libraries - [C289892]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.selectItem(siteName);
|
||||
expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed');
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${siteName}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${siteName}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${siteName}`);
|
||||
});
|
||||
|
||||
it('selected row is marked with a check circle icon - [C213134]', async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.selectItem(fileUser);
|
||||
@ -207,6 +197,58 @@ describe('Toolbar actions - single selection : ', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a library', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Available actions when a library is selected - My Libraries - [C213135]', async () => {
|
||||
await page.goToMyLibraries();
|
||||
await dataTable.selectItem(siteName);
|
||||
expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed');
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${siteName}`);
|
||||
expect(await toolbar.isButtonPresent('Leave library')).toBe(true, `Leave is not displayed for ${siteName}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${siteName}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${siteName}`);
|
||||
});
|
||||
|
||||
it('Available actions when a library is selected - Favorite Libraries - user is a member - [C289892]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.selectItem(siteName);
|
||||
expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed');
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${siteName}`);
|
||||
expect(await toolbar.isButtonPresent('Leave library')).toBe(true, `Leave is not displayed for ${siteName}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${siteName}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${siteName}`);
|
||||
});
|
||||
|
||||
it('Available actions when a library is selected - Favorite Libraries - user is not a member - [C290090]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.selectItem(adminPublic);
|
||||
expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed');
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${adminPublic}`);
|
||||
expect(await toolbar.isButtonPresent('Join')).toBe(true, `Join is not displayed for ${adminPublic}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${adminPublic}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${adminPublic}`);
|
||||
});
|
||||
|
||||
it('Available actions when a library is selected - Favorite Libraries - user requested to join - [C290091]', async () => {
|
||||
await page.goToFavoriteLibraries();
|
||||
await dataTable.selectItem(adminModerated);
|
||||
expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed');
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${adminModerated}`);
|
||||
expect(await toolbar.isButtonPresent('Cancel join')).toBe(true, `Cancel join is not displayed for ${adminModerated}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${adminModerated}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${adminModerated}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Shared Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
|
@ -39,6 +39,7 @@ describe('Empty list views', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, pagination } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
@ -148,10 +149,25 @@ describe('Empty list views', () => {
|
||||
it('Trash - pagination controls not displayed - [C280120]', async () => {
|
||||
await page.clickTrash();
|
||||
expect(await pagination.range.isPresent()).toBe(false);
|
||||
expect(pagination.maxItems.isPresent()).toBe(false);
|
||||
expect(pagination.currentPage.isPresent()).toBe(false);
|
||||
expect(pagination.totalPages.isPresent()).toBe(false);
|
||||
expect(pagination.previousButton.isPresent()).toBe(false);
|
||||
expect(pagination.nextButton.isPresent()).toBe(false);
|
||||
expect(await pagination.maxItems.isPresent()).toBe(false);
|
||||
expect(await pagination.currentPage.isPresent()).toBe(false);
|
||||
expect(await pagination.totalPages.isPresent()).toBe(false);
|
||||
expect(await pagination.previousButton.isPresent()).toBe(false);
|
||||
expect(await pagination.nextButton.isPresent()).toBe(false);
|
||||
});
|
||||
|
||||
it('Search results - pagination controls not displayed - [C290123]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkOnlyFiles();
|
||||
/* cspell:disable-next-line */
|
||||
await searchInput.searchFor('qwertyuiop');
|
||||
await dataTable.waitForBody();
|
||||
|
||||
expect(await pagination.range.isPresent()).toBe(false);
|
||||
expect(await pagination.maxItems.isPresent()).toBe(false);
|
||||
expect(await pagination.currentPage.isPresent()).toBe(false);
|
||||
expect(await pagination.totalPages.isPresent()).toBe(false);
|
||||
expect(await pagination.previousButton.isPresent()).toBe(false);
|
||||
expect(await pagination.nextButton.isPresent()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
160
e2e/suites/pagination/pag-search-results.test.ts
Executable file
160
e2e/suites/pagination/pag-search-results.test.ts
Executable file
@ -0,0 +1,160 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Pagination on multiple pages on Search Results', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const files = Array(101)
|
||||
.fill('myFile')
|
||||
.map((name, index): string => `${name}-${index + 1}.txt`);
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, pagination } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user.nodes.createFiles(files, parent);
|
||||
await apis.user.search.waitForApi(username, { expect: 101 });
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkOnlyFiles();
|
||||
await searchInput.searchFor('myFile-');
|
||||
await dataTable.waitForBody();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('Pagination control default values - [C290125]', async () => {
|
||||
expect(await pagination.range.getText()).toContain('1-25 of 101');
|
||||
expect(await pagination.maxItems.getText()).toContain('25');
|
||||
expect(await pagination.currentPage.getText()).toContain('Page 1');
|
||||
expect(await pagination.totalPages.getText()).toContain('of 5');
|
||||
expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled');
|
||||
expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
|
||||
});
|
||||
|
||||
it('Items per page values - [C290126]', async () => {
|
||||
await pagination.openMaxItemsMenu();
|
||||
const [ first, second, third ] = [1, 2, 3]
|
||||
.map(async nth => await pagination.menu.getNthItem(nth).getText());
|
||||
expect(first).toBe('25');
|
||||
expect(second).toBe('50');
|
||||
expect(third).toBe('100');
|
||||
await pagination.menu.closeMenu();
|
||||
});
|
||||
|
||||
it('current page menu items - [C290127]', async () => {
|
||||
await pagination.openMaxItemsMenu();
|
||||
await pagination.menu.clickMenuItem('25');
|
||||
expect(await pagination.getText(pagination.maxItems)).toContain('25');
|
||||
expect(await pagination.getText(pagination.totalPages)).toContain('of 5');
|
||||
await pagination.openCurrentPageMenu();
|
||||
expect(await pagination.menu.getItemsCount()).toBe(5);
|
||||
await pagination.menu.closeMenu();
|
||||
|
||||
await pagination.openMaxItemsMenu();
|
||||
await pagination.menu.clickMenuItem('50');
|
||||
expect(await pagination.getText(pagination.maxItems)).toContain('50');
|
||||
expect(await pagination.getText(pagination.totalPages)).toContain('of 3');
|
||||
await pagination.openCurrentPageMenu();
|
||||
expect(await pagination.menu.getItemsCount()).toBe(3);
|
||||
await pagination.menu.closeMenu();
|
||||
|
||||
await pagination.openMaxItemsMenu();
|
||||
await pagination.menu.clickMenuItem('100');
|
||||
expect(await pagination.getText(pagination.maxItems)).toContain('100');
|
||||
expect(await pagination.getText(pagination.totalPages)).toContain('of 2');
|
||||
await pagination.openCurrentPageMenu();
|
||||
expect(await pagination.menu.getItemsCount()).toBe(2);
|
||||
await pagination.menu.closeMenu();
|
||||
|
||||
await pagination.resetToDefaultPageSize();
|
||||
});
|
||||
|
||||
it('change the current page from menu - [C290128]', async () => {
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(3);
|
||||
await dataTable.waitForBody();
|
||||
expect(await pagination.range.getText()).toContain('51-75 of 101');
|
||||
expect(await pagination.currentPage.getText()).toContain('Page 3');
|
||||
expect(await pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
|
||||
expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
|
||||
|
||||
await pagination.resetToDefaultPageNumber();
|
||||
});
|
||||
|
||||
it('navigate to next and previous pages - [C290131]', async () => {
|
||||
await pagination.nextButton.click();
|
||||
await dataTable.waitForBody();
|
||||
expect(await pagination.range.getText()).toContain('26-50 of 101');
|
||||
await pagination.resetToDefaultPageNumber();
|
||||
|
||||
await pagination.openCurrentPageMenu();
|
||||
await pagination.menu.clickNthItem(2);
|
||||
await dataTable.waitForBody();
|
||||
await pagination.previousButton.click();
|
||||
await dataTable.waitForBody();
|
||||
expect(pagination.range.getText()).toContain('1-25 of 101');
|
||||
|
||||
await pagination.resetToDefaultPageNumber();
|
||||
});
|
||||
|
||||
it('Previous button is disabled on first page - [C290129]', async () => {
|
||||
expect(await pagination.currentPage.getText()).toContain('Page 1');
|
||||
expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page');
|
||||
});
|
||||
|
||||
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 pagination.currentPage.getText()).toContain('Page 5');
|
||||
expect(await pagination.nextButton.isEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
});
|
@ -42,7 +42,8 @@ describe('Pagination on single page', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { pagination } = page;
|
||||
const { pagination, dataTable } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
@ -108,4 +109,12 @@ describe('Pagination on single page', () => {
|
||||
expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed');
|
||||
});
|
||||
|
||||
it('page selector not displayed on Search results - [C290124]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkOnlyFiles();
|
||||
await searchInput.searchFor(file);
|
||||
await dataTable.waitForBody();
|
||||
expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed');
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -46,12 +46,9 @@ export class NodesApi extends RepoApi {
|
||||
return await this.alfrescoJsApi.core.nodesApi.getNode(id);
|
||||
}
|
||||
|
||||
async getNodeDescription(name: string, relativePath: string = '/') {
|
||||
relativePath = (relativePath === '/')
|
||||
? `${name}`
|
||||
: `${relativePath}/${name}`;
|
||||
|
||||
return (await this.getNodeByPath(`${relativePath}`)).entry.properties['cm:description'];
|
||||
async getNodeDescription(name: string, parentId: string) {
|
||||
const children = (await this.getNodeChildren(parentId)).list.entries;
|
||||
return children.find(elem => elem.entry.name === name).entry.properties['cm:description'];
|
||||
}
|
||||
|
||||
async getNodeProperty(nodeId: string, property: string) {
|
||||
@ -93,8 +90,11 @@ export class NodesApi extends RepoApi {
|
||||
// children
|
||||
|
||||
async getNodeChildren(nodeId: string) {
|
||||
const opts = {
|
||||
include: [ 'properties' ]
|
||||
};
|
||||
await this.apiAuth();
|
||||
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId);
|
||||
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId, opts);
|
||||
}
|
||||
|
||||
async deleteNodeChildren(parentId: string) {
|
||||
|
@ -128,6 +128,24 @@ export class SitesApi extends RepoApi {
|
||||
return await this.alfrescoJsApi.core.sitesApi.removeSiteMember(siteId, userId);
|
||||
}
|
||||
|
||||
async requestToJoin(siteId: string) {
|
||||
const body = {
|
||||
id: siteId
|
||||
};
|
||||
await this.apiAuth();
|
||||
try {
|
||||
return await this.alfrescoJsApi.core.peopleApi.addSiteMembershipRequest('-me-', body);
|
||||
} catch (error) {
|
||||
console.log('====== requestToJoin catch ', error);
|
||||
};
|
||||
}
|
||||
|
||||
async hasMembershipRequest(siteId: string) {
|
||||
await this.apiAuth();
|
||||
const requests = (await this.alfrescoJsApi.core.peopleApi.getSiteMembershipRequests('-me-')).list.entries.map(e => e.entry.id);
|
||||
return requests.includes(siteId);
|
||||
}
|
||||
|
||||
async waitForApi(data) {
|
||||
try {
|
||||
const sites = async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user