mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Test cases for Edit Folder Directive (#4910)
* added tests for Edit Folder Directive * added tests for Copy and Move actions on no permission folder. * moved the checkDisabled function to BrowserActions to make it reusable. * updated method name
This commit is contained in:
committed by
Eugenio Romano
parent
c151d4535c
commit
65dc1a5c31
@@ -94,7 +94,9 @@
|
|||||||
(click)="createLibrary()">
|
(click)="createLibrary()">
|
||||||
<mat-icon>library_add</mat-icon>
|
<mat-icon>library_add</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button mat-icon-button
|
<button
|
||||||
|
data-automation-id="edit-folder"
|
||||||
|
mat-icon-button
|
||||||
[disabled]="!canEditFolder(documentList.selection)"
|
[disabled]="!canEditFolder(documentList.selection)"
|
||||||
title="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}"
|
title="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}"
|
||||||
(error)="openSnackMessage($event)"
|
(error)="openSnackMessage($event)"
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { LoginPage, NotificationHistoryPage } from '@alfresco/adf-testing';
|
import { LoginPage, NotificationHistoryPage } from '@alfresco/adf-testing';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import { CreateFolderDialog } from '../../pages/adf/dialog/createFolderDialog';
|
import { FolderDialog } from '../../pages/adf/dialog/folderDialog';
|
||||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||||
@@ -27,7 +27,7 @@ describe('Create folder directive', function () {
|
|||||||
|
|
||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const contentServicesPage = new ContentServicesPage();
|
const contentServicesPage = new ContentServicesPage();
|
||||||
const createFolderDialog = new CreateFolderDialog();
|
const createFolderDialog = new FolderDialog();
|
||||||
const notificationHistoryPage = new NotificationHistoryPage();
|
const notificationHistoryPage = new NotificationHistoryPage();
|
||||||
const metadataViewPage = new MetadataViewPage();
|
const metadataViewPage = new MetadataViewPage();
|
||||||
const acsUser = new AcsUserModel();
|
const acsUser = new AcsUserModel();
|
||||||
@@ -73,11 +73,11 @@ describe('Create folder directive', function () {
|
|||||||
const folderName = 'NotEnableFolder';
|
const folderName = 'NotEnableFolder';
|
||||||
contentServicesPage.clickOnCreateNewFolder();
|
contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
|
|
||||||
createFolderDialog.addFolderName(folderName);
|
createFolderDialog.addFolderName(folderName);
|
||||||
|
|
||||||
createFolderDialog.checkCreateBtnIsEnabled();
|
createFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260156] Should not be possible create two folder with the same name', () => {
|
it('[C260156] Should not be possible create two folder with the same name', () => {
|
||||||
@@ -112,7 +112,7 @@ describe('Create folder directive', function () {
|
|||||||
createFolderDialog.addFolderName(folderName);
|
createFolderDialog.addFolderName(folderName);
|
||||||
createFolderDialog.addFolderDescription(description);
|
createFolderDialog.addFolderDescription(description);
|
||||||
|
|
||||||
createFolderDialog.clickOnCreateButton();
|
createFolderDialog.clickOnCreateUpdateButton();
|
||||||
|
|
||||||
contentServicesPage.checkContentIsDisplayed(folderName);
|
contentServicesPage.checkContentIsDisplayed(folderName);
|
||||||
|
|
||||||
@@ -126,20 +126,20 @@ describe('Create folder directive', function () {
|
|||||||
contentServicesPage.clickOnCreateNewFolder();
|
contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
createFolderDialog.addFolderName('*');
|
createFolderDialog.addFolderName('*');
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
createFolderDialog.addFolderName('<');
|
createFolderDialog.addFolderName('<');
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
createFolderDialog.addFolderName('>');
|
createFolderDialog.addFolderName('>');
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
createFolderDialog.addFolderName('\\');
|
createFolderDialog.addFolderName('\\');
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
createFolderDialog.addFolderName('/');
|
createFolderDialog.addFolderName('/');
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
createFolderDialog.addFolderName('?');
|
createFolderDialog.addFolderName('?');
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
createFolderDialog.addFolderName(':');
|
createFolderDialog.addFolderName(':');
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
createFolderDialog.addFolderName('|');
|
createFolderDialog.addFolderName('|');
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
250
e2e/content-services/directives/edit-folder-directive.e2e.ts
Normal file
250
e2e/content-services/directives/edit-folder-directive.e2e.ts
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { BrowserActions, LoginPage, NotificationHistoryPage, StringUtil, UploadActions } from '@alfresco/adf-testing';
|
||||||
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
|
import { FolderDialog } from '../../pages/adf/dialog/folderDialog';
|
||||||
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
|
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||||
|
import { browser, protractor } from 'protractor';
|
||||||
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
import resources = require('../../util/resources');
|
||||||
|
|
||||||
|
describe('Edit folder directive', function () {
|
||||||
|
|
||||||
|
const loginPage = new LoginPage();
|
||||||
|
const contentServicesPage = new ContentServicesPage();
|
||||||
|
const editFolderDialog = new FolderDialog();
|
||||||
|
const acsUser = new AcsUserModel();
|
||||||
|
const anotherAcsUser = new AcsUserModel();
|
||||||
|
const navigationBarPage = new NavigationBarPage();
|
||||||
|
const notificationHistoryPage = new NotificationHistoryPage();
|
||||||
|
this.alfrescoJsApi = new AlfrescoApi({
|
||||||
|
provider: 'ECM',
|
||||||
|
hostEcm: browser.params.testConfig.adf.url
|
||||||
|
});
|
||||||
|
|
||||||
|
const pdfFile = new FileModel({
|
||||||
|
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||||
|
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
|
||||||
|
});
|
||||||
|
|
||||||
|
const uploadActions = new UploadActions(this.alfrescoJsApi);
|
||||||
|
const updateFolderName = StringUtil.generateRandomString(5);
|
||||||
|
let editFolder, anotherFolder, filePdfNode, subFolder;
|
||||||
|
|
||||||
|
beforeAll(async (done) => {
|
||||||
|
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||||
|
|
||||||
|
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||||
|
|
||||||
|
await this.alfrescoJsApi.core.peopleApi.addPerson(anotherAcsUser);
|
||||||
|
|
||||||
|
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||||
|
|
||||||
|
editFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
|
||||||
|
|
||||||
|
anotherFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
|
||||||
|
|
||||||
|
subFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), editFolder.entry.id);
|
||||||
|
|
||||||
|
filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
|
||||||
|
|
||||||
|
await this.alfrescoJsApi.core.nodesApi.updateNode(editFolder.entry.id,
|
||||||
|
|
||||||
|
{
|
||||||
|
permissions: {
|
||||||
|
locallySet: [{
|
||||||
|
authorityId: anotherAcsUser.getId(),
|
||||||
|
name: 'Consumer',
|
||||||
|
accessStatus: 'ALLOWED'
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
|
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async (done) => {
|
||||||
|
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||||
|
await uploadActions.deleteFileOrFolder(editFolder.entry.id);
|
||||||
|
await uploadActions.deleteFileOrFolder(anotherFolder.entry.id);
|
||||||
|
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(async (done) => {
|
||||||
|
navigationBarPage.clickHomeButton();
|
||||||
|
navigationBarPage.clickContentServicesButton();
|
||||||
|
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260161] Update folder - Cancel button', async () => {
|
||||||
|
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.clickOnEditFolder();
|
||||||
|
editFolderDialog.checkFolderDialogIsDisplayed();
|
||||||
|
expect(editFolderDialog.getDialogTitle()).toBe('Edit folder');
|
||||||
|
expect(editFolderDialog.getFolderName()).toBe(editFolder.entry.name);
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
editFolderDialog.checkCancelBtnIsEnabled();
|
||||||
|
editFolderDialog.clickOnCancelButton();
|
||||||
|
editFolderDialog.checkFolderDialogIsNotDisplayed();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260162] Update folder - Introducing letters', async () => {
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
|
||||||
|
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
|
||||||
|
contentServicesPage.clickOnEditFolder();
|
||||||
|
editFolderDialog.checkFolderDialogIsDisplayed();
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
editFolderDialog.addFolderName(editFolder.entry.name + 'a');
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
editFolderDialog.clickOnCancelButton();
|
||||||
|
editFolderDialog.checkFolderDialogIsNotDisplayed();
|
||||||
|
contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260163] Update folder name with an existing one', async () => {
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
|
||||||
|
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
|
||||||
|
contentServicesPage.clickOnEditFolder();
|
||||||
|
editFolderDialog.checkFolderDialogIsDisplayed();
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
editFolderDialog.addFolderName(anotherFolder.entry.name);
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
editFolderDialog.clickOnCreateUpdateButton();
|
||||||
|
editFolderDialog.checkFolderDialogIsDisplayed();
|
||||||
|
notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260164] Edit Folder - Unsupported characters', async () => {
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.clickOnEditFolder();
|
||||||
|
editFolderDialog.checkFolderDialogIsDisplayed();
|
||||||
|
|
||||||
|
editFolderDialog.addFolderName('a*"<>\\/?:|');
|
||||||
|
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |');
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
|
|
||||||
|
editFolderDialog.addFolderName('a.a');
|
||||||
|
editFolderDialog.checkValidationMessageIsNotDisplayed();
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
|
||||||
|
editFolderDialog.addFolderName('a.');
|
||||||
|
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .');
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
|
|
||||||
|
editFolderDialog.getFolderNameField().clear();
|
||||||
|
editFolderDialog.getFolderNameField().sendKeys(protractor.Key.SPACE);
|
||||||
|
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces');
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsDisabled();
|
||||||
|
|
||||||
|
editFolderDialog.addFolderName(editFolder.entry.name);
|
||||||
|
editFolderDialog.addFolderDescription('a*"<>\\/?:|');
|
||||||
|
editFolderDialog.checkValidationMessageIsNotDisplayed();
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
|
||||||
|
editFolderDialog.addFolderDescription('a.');
|
||||||
|
editFolderDialog.checkValidationMessageIsNotDisplayed();
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
|
||||||
|
editFolderDialog.addFolderDescription('a.a');
|
||||||
|
editFolderDialog.checkValidationMessageIsNotDisplayed();
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
|
||||||
|
editFolderDialog.getFolderDescriptionField().sendKeys(protractor.Key.SPACE);
|
||||||
|
editFolderDialog.checkValidationMessageIsNotDisplayed();
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
editFolderDialog.clickOnCancelButton();
|
||||||
|
editFolderDialog.checkFolderDialogIsNotDisplayed();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260166] Enable/Disable edit folder icon - when file selected', async () => {
|
||||||
|
expect(contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
|
||||||
|
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', filePdfNode.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', filePdfNode.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', filePdfNode.entry.name);
|
||||||
|
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260166] Enable/Disable edit folder icon - when multiple folders selected', async () => {
|
||||||
|
contentServicesPage.clickMultiSelectToggle();
|
||||||
|
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkAllRowsButtonIsDisplayed().checkAllRows();
|
||||||
|
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsChecked('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsChecked('Display name', anotherFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', filePdfNode.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsNotChecked('Display name', filePdfNode.entry.name);
|
||||||
|
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
|
||||||
|
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260166] Enable/Disable edit folder icon - when single folder selected', async () => {
|
||||||
|
expect(contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
|
||||||
|
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
|
||||||
|
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260165] Update folder name with non-existing one', async () => {
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
|
||||||
|
contentServicesPage.clickOnEditFolder();
|
||||||
|
editFolderDialog.checkFolderDialogIsDisplayed();
|
||||||
|
editFolderDialog.addFolderName(updateFolderName);
|
||||||
|
editFolderDialog.checkCreateUpdateBtnIsEnabled();
|
||||||
|
editFolderDialog.clickOnCreateUpdateButton();
|
||||||
|
editFolderDialog.checkFolderDialogIsNotDisplayed();
|
||||||
|
contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', updateFolderName);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Edit Folder - no permission', () => {
|
||||||
|
|
||||||
|
beforeEach(async (done) => {
|
||||||
|
loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
|
||||||
|
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + editFolder.entry.id);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260167] Edit folder without permission', async () => {
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', subFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', subFolder.entry.name);
|
||||||
|
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', subFolder.entry.name);
|
||||||
|
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { CreateFolderDialog } from './dialog/createFolderDialog';
|
import { FolderDialog } from './dialog/folderDialog';
|
||||||
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
|
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
|
||||||
import { FormControllersPage } from '@alfresco/adf-testing';
|
import { FormControllersPage } from '@alfresco/adf-testing';
|
||||||
import { DropActions } from '../../actions/drop.actions';
|
import { DropActions } from '../../actions/drop.actions';
|
||||||
@@ -38,13 +38,14 @@ export class ContentServicesPage {
|
|||||||
contentList = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
contentList = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
||||||
formControllersPage = new FormControllersPage();
|
formControllersPage = new FormControllersPage();
|
||||||
multipleFileUploadToggle = element(by.id('adf-document-list-enable-drop-files'));
|
multipleFileUploadToggle = element(by.id('adf-document-list-enable-drop-files'));
|
||||||
createFolderDialog = new CreateFolderDialog();
|
createFolderDialog = new FolderDialog();
|
||||||
createLibraryDialog = new CreateLibraryDialog();
|
createLibraryDialog = new CreateLibraryDialog();
|
||||||
dragAndDropAction = new DropActions();
|
dragAndDropAction = new DropActions();
|
||||||
uploadBorder = element(by.id('document-list-container'));
|
uploadBorder = element(by.id('document-list-container'));
|
||||||
contentServices = element(by.css('.adf-sidenav-link[data-automation-id="Content Services"]'));
|
contentServices = element(by.css('.adf-sidenav-link[data-automation-id="Content Services"]'));
|
||||||
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
||||||
createFolderButton = element(by.css('button[data-automation-id="create-new-folder"]'));
|
createFolderButton = element(by.css('button[data-automation-id="create-new-folder"]'));
|
||||||
|
editFolderButton = element(by.css('button[data-automation-id="edit-folder"]'));
|
||||||
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
|
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
|
||||||
activeBreadcrumb = element(by.css('div[class*="active"]'));
|
activeBreadcrumb = element(by.css('div[class*="active"]'));
|
||||||
tooltip = by.css('div[class*="--text adf-full-width"] span');
|
tooltip = by.css('div[class*="--text adf-full-width"] span');
|
||||||
@@ -359,6 +360,15 @@ export class ContentServicesPage {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clickOnEditFolder() {
|
||||||
|
BrowserActions.click(this.editFolderButton);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkEditFolderButtonIsEnabled() {
|
||||||
|
return this.editFolderButton.isEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
openCreateLibraryDialog() {
|
openCreateLibraryDialog() {
|
||||||
BrowserActions.click(this.createLibraryButton);
|
BrowserActions.click(this.createLibraryButton);
|
||||||
this.createLibraryDialog.waitForDialogToOpen();
|
this.createLibraryDialog.waitForDialogToOpen();
|
||||||
@@ -369,7 +379,7 @@ export class ContentServicesPage {
|
|||||||
this.clickOnCreateNewFolder();
|
this.clickOnCreateNewFolder();
|
||||||
this.createFolderDialog.addFolderName(folder);
|
this.createFolderDialog.addFolderName(folder);
|
||||||
browser.sleep(200);
|
browser.sleep(200);
|
||||||
this.createFolderDialog.clickOnCreateButton();
|
this.createFolderDialog.clickOnCreateUpdateButton();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,59 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Copyright 2019 Alfresco Software, Ltd.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { browser, by, element } from 'protractor';
|
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
|
||||||
|
|
||||||
export class CreateFolderDialog {
|
|
||||||
folderNameField = element(by.id('adf-folder-name-input'));
|
|
||||||
folderDescriptionField = element(by.id('adf-folder-description-input'));
|
|
||||||
createButton = element(by.id('adf-folder-create-button'));
|
|
||||||
cancelButton = element(by.id('adf-folder-cancel-button'));
|
|
||||||
|
|
||||||
clickOnCreateButton() {
|
|
||||||
BrowserActions.click(this.createButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
checkCreateBtnIsDisabled() {
|
|
||||||
BrowserVisibility.waitUntilElementIsVisible(this.createButton);
|
|
||||||
expect(this.createButton.getAttribute('disabled')).toEqual('true');
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
checkCreateBtnIsEnabled() {
|
|
||||||
this.createButton.isEnabled();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
clickOnCancelButton() {
|
|
||||||
BrowserActions.click(this.cancelButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
addFolderName(folderName) {
|
|
||||||
BrowserVisibility.waitUntilElementIsVisible(this.folderNameField);
|
|
||||||
BrowserActions.clearSendKeys(this.folderNameField, folderName);
|
|
||||||
browser.driver.sleep(500);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
addFolderDescription(folderDescription) {
|
|
||||||
BrowserVisibility.waitUntilElementIsVisible(this.folderDescriptionField);
|
|
||||||
BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
101
e2e/pages/adf/dialog/folderDialog.ts
Normal file
101
e2e/pages/adf/dialog/folderDialog.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { browser, by, element } from 'protractor';
|
||||||
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
|
export class FolderDialog {
|
||||||
|
folderDialog = element(by.css('adf-folder-dialog'));
|
||||||
|
folderNameField = this.folderDialog.element(by.id('adf-folder-name-input'));
|
||||||
|
folderDescriptionField = this.folderDialog.element(by.id('adf-folder-description-input'));
|
||||||
|
createUpdateButton = this.folderDialog.element(by.id('adf-folder-create-button'));
|
||||||
|
cancelButton = this.folderDialog.element(by.id('adf-folder-cancel-button'));
|
||||||
|
folderTitle = this.folderDialog.element((by.css('h2.mat-dialog-title')));
|
||||||
|
validationMessage = this.folderDialog.element(by.css('div.mat-form-field-subscript-wrapper mat-hint span'));
|
||||||
|
|
||||||
|
getDialogTitle() {
|
||||||
|
return BrowserActions.getText(this.folderTitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkFolderDialogIsDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.folderDialog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkFolderDialogIsNotDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsNotVisible(this.folderDialog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnCreateUpdateButton() {
|
||||||
|
BrowserActions.click(this.createUpdateButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCreateUpdateBtnIsDisabled() {
|
||||||
|
BrowserActions.checkIsDisabled(this.createUpdateButton);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCreateUpdateBtnIsEnabled() {
|
||||||
|
this.createUpdateButton.isEnabled();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCancelBtnIsEnabled() {
|
||||||
|
this.cancelButton.isEnabled();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnCancelButton() {
|
||||||
|
BrowserActions.click(this.cancelButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
addFolderName(folderName) {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.folderNameField);
|
||||||
|
BrowserActions.clearSendKeys(this.folderNameField, folderName);
|
||||||
|
browser.driver.sleep(500);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
addFolderDescription(folderDescription) {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.folderDescriptionField);
|
||||||
|
BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getFolderName() {
|
||||||
|
return this.folderNameField.getAttribute('value');
|
||||||
|
}
|
||||||
|
|
||||||
|
getValidationMessage() {
|
||||||
|
return BrowserActions.getText(this.validationMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkValidationMessageIsNotDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsNotVisible(this.validationMessage);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getFolderNameField() {
|
||||||
|
return this.folderNameField;
|
||||||
|
}
|
||||||
|
|
||||||
|
getFolderDescriptionField() {
|
||||||
|
return this.folderDescriptionField;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -72,8 +72,8 @@ export class DataTableComponentPage {
|
|||||||
|
|
||||||
clickCheckbox(columnName, columnValue) {
|
clickCheckbox(columnName, columnValue) {
|
||||||
const checkbox = this.getRowCheckbox(columnName, columnValue);
|
const checkbox = this.getRowCheckbox(columnName, columnValue);
|
||||||
BrowserVisibility.waitUntilElementIsClickable(checkbox);
|
BrowserActions.click(checkbox);
|
||||||
checkbox.click();
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkRowIsNotChecked(columnName, columnValue) {
|
checkRowIsNotChecked(columnName, columnValue) {
|
||||||
|
@@ -54,6 +54,12 @@ export class BrowserActions {
|
|||||||
elementFinder.sendKeys(text);
|
elementFinder.sendKeys(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async checkIsDisabled(elementFinder: ElementFinder) {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
||||||
|
expect(elementFinder.getAttribute('disabled')).toEqual('true');
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
static async closeMenuAndDialogs() {
|
static async closeMenuAndDialogs() {
|
||||||
return browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
return browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user