mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3951] Added automated tests for failed uploading tooltips (#4206)
* [ADF-3951] Added automated tests for failed uploading tooltips * [ADF-3951] Updated and refactored tests.
This commit is contained in:
committed by
Eugenio Romano
parent
1b81f687a3
commit
3401b508be
@@ -28,6 +28,8 @@ import { FolderModel } from '../../models/ACS/folderModel';
|
|||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
import { Util } from '../../util/util';
|
||||||
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
@@ -41,6 +43,7 @@ describe('Upload component', () => {
|
|||||||
let loginPage = new LoginPage();
|
let loginPage = new LoginPage();
|
||||||
let acsUser = new AcsUserModel();
|
let acsUser = new AcsUserModel();
|
||||||
let uploadActions = new UploadActions();
|
let uploadActions = new UploadActions();
|
||||||
|
let navigationBarPage = new NavigationBarPage();
|
||||||
|
|
||||||
let firstPdfFileModel = new FileModel({
|
let firstPdfFileModel = new FileModel({
|
||||||
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
|
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
|
||||||
@@ -436,4 +439,24 @@ describe('Upload component', () => {
|
|||||||
uploadToggles.disableFolderUpload();
|
uploadToggles.disableFolderUpload();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('[C291921] Should display tooltip for uploading files on a not found location', async () => {
|
||||||
|
let folderName = Util.generateRandomString(8);
|
||||||
|
|
||||||
|
let folderUploadedModel = await browser.controlFlow().execute(async () => {
|
||||||
|
return await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
|
||||||
|
});
|
||||||
|
|
||||||
|
navigationBarPage.openContentServicesFolder(folderUploadedModel.entry.id);
|
||||||
|
contentServicesPage.checkUploadButton();
|
||||||
|
|
||||||
|
browser.controlFlow().execute(async () => {
|
||||||
|
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, folderUploadedModel.entry.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
contentServicesPage.uploadFile(pdfFileModel.location);
|
||||||
|
|
||||||
|
uploadDialog.displayTooltip();
|
||||||
|
expect(uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
|
|
||||||
import { Util } from '../../util/util';
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
@@ -34,7 +34,6 @@ import TestConfig = require('../../test.config');
|
|||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { DropActions } from '../../actions/drop.actions';
|
|
||||||
import CONSTANTS = require('../../util/constants');
|
import CONSTANTS = require('../../util/constants');
|
||||||
|
|
||||||
describe('Upload - User permission', () => {
|
describe('Upload - User permission', () => {
|
||||||
@@ -121,11 +120,8 @@ describe('Upload - User permission', () => {
|
|||||||
it('[C212861] Should not be allowed to Drag and drop a file/folder in a folder with consumer permissions', () => {
|
it('[C212861] Should not be allowed to Drag and drop a file/folder in a folder with consumer permissions', () => {
|
||||||
contentServicesPage.checkDragAndDropDIsDisplayed();
|
contentServicesPage.checkDragAndDropDIsDisplayed();
|
||||||
|
|
||||||
let dragAndDrop = new DropActions();
|
contentServicesPage.dragAndDropFile(emptyFile.location);
|
||||||
let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
|
contentServicesPage.dragAndDropFolder(folder.location);
|
||||||
|
|
||||||
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
|
|
||||||
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
|
|
||||||
|
|
||||||
contentServicesPage.checkContentIsDisplayed(emptyFile.name);
|
contentServicesPage.checkContentIsDisplayed(emptyFile.name);
|
||||||
contentServicesPage.checkContentIsDisplayed(folder.name);
|
contentServicesPage.checkContentIsDisplayed(folder.name);
|
||||||
@@ -134,8 +130,8 @@ describe('Upload - User permission', () => {
|
|||||||
|
|
||||||
browser.sleep(3000);
|
browser.sleep(3000);
|
||||||
|
|
||||||
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
|
contentServicesPage.dragAndDropFile(emptyFile.location);
|
||||||
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
|
contentServicesPage.dragAndDropFolder(folder.location);
|
||||||
|
|
||||||
let fileInTheUploadedFolder = 'share_profile_pic.png';
|
let fileInTheUploadedFolder = 'share_profile_pic.png';
|
||||||
|
|
||||||
@@ -146,6 +142,20 @@ describe('Upload - User permission', () => {
|
|||||||
contentServicesPage.checkContentIsNotDisplayed(folder.name);
|
contentServicesPage.checkContentIsNotDisplayed(folder.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('[C291921] Should display tooltip for uploading files without permissions', () => {
|
||||||
|
navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
|
||||||
|
|
||||||
|
contentServicesPage.checkDragAndDropDIsDisplayed();
|
||||||
|
|
||||||
|
contentServicesPage.dragAndDropFile(emptyFile.location);
|
||||||
|
|
||||||
|
uploadDialog.fileIsError(emptyFile.name);
|
||||||
|
|
||||||
|
uploadDialog.displayTooltip();
|
||||||
|
|
||||||
|
expect(uploadDialog.getTooltip()).toEqual('Insufficient permissions to upload in this location [403]');
|
||||||
|
});
|
||||||
|
|
||||||
it('[C279915] Should not be allowed to upload a file in folder with consumer permissions', () => {
|
it('[C279915] Should not be allowed to upload a file in folder with consumer permissions', () => {
|
||||||
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
|
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
|
||||||
|
|
||||||
@@ -198,12 +208,8 @@ describe('Upload - User permission', () => {
|
|||||||
it('[C260130] Should be allowed to Drag and drop a file/folder in a folder with manager permissions', () => {
|
it('[C260130] Should be allowed to Drag and drop a file/folder in a folder with manager permissions', () => {
|
||||||
contentServicesPage.checkDragAndDropDIsDisplayed();
|
contentServicesPage.checkDragAndDropDIsDisplayed();
|
||||||
|
|
||||||
let dragAndDrop = new DropActions();
|
contentServicesPage.dragAndDropFile(emptyFile.location);
|
||||||
|
contentServicesPage.dragAndDropFolder(folder.location);
|
||||||
let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
|
|
||||||
|
|
||||||
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
|
|
||||||
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
|
|
||||||
|
|
||||||
let fileInTheUploadedFolder = 'share_profile_pic.png';
|
let fileInTheUploadedFolder = 'share_profile_pic.png';
|
||||||
|
|
||||||
|
@@ -22,6 +22,7 @@ import { CreateFolderDialog } from './dialog/createFolderDialog';
|
|||||||
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
|
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
|
||||||
import { NavigationBarPage } from './navigationBarPage';
|
import { NavigationBarPage } from './navigationBarPage';
|
||||||
import { NodeActions } from '../../actions/ACS/node.actions';
|
import { NodeActions } from '../../actions/ACS/node.actions';
|
||||||
|
import { DropActions } from '../../actions/drop.actions';
|
||||||
import { by, element, protractor, $$, browser } from 'protractor';
|
import { by, element, protractor, $$, browser } from 'protractor';
|
||||||
|
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
@@ -32,6 +33,7 @@ export class ContentServicesPage {
|
|||||||
createFolderDialog = new CreateFolderDialog();
|
createFolderDialog = new CreateFolderDialog();
|
||||||
nodeActions = new NodeActions();
|
nodeActions = new NodeActions();
|
||||||
createLibraryDialog = new CreateLibraryDialog();
|
createLibraryDialog = new CreateLibraryDialog();
|
||||||
|
dragAndDropAction = new DropActions();
|
||||||
uploadBorder = element(by.id('document-list-container'));
|
uploadBorder = element(by.id('document-list-container'));
|
||||||
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||||
contentServices = element(by.css('a[data-automation-id="Content Services"]'));
|
contentServices = element(by.css('a[data-automation-id="Content Services"]'));
|
||||||
@@ -538,6 +540,16 @@ export class ContentServicesPage {
|
|||||||
Util.waitUntilElementIsVisible(this.dragAndDrop);
|
Util.waitUntilElementIsVisible(this.dragAndDrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dragAndDropFile(file) {
|
||||||
|
this.checkDragAndDropDIsDisplayed();
|
||||||
|
this.dragAndDropAction.dropFile(this.dragAndDrop, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
dragAndDropFolder(folder) {
|
||||||
|
this.checkDragAndDropDIsDisplayed();
|
||||||
|
this.dragAndDropAction.dropFolder(this.dragAndDrop, folder);
|
||||||
|
}
|
||||||
|
|
||||||
checkLockIsDisplayedForElement(name) {
|
checkLockIsDisplayedForElement(name) {
|
||||||
let lockButton = element(by.css(`div.adf-data-table-cell[filename="${name}"] button`));
|
let lockButton = element(by.css(`div.adf-data-table-cell[filename="${name}"] button`));
|
||||||
Util.waitUntilElementIsVisible(lockButton);
|
Util.waitUntilElementIsVisible(lockButton);
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Util } from '../../../util/util';
|
import { Util } from '../../../util/util';
|
||||||
|
import { element, by, protractor, browser } from 'protractor';
|
||||||
|
|
||||||
export class UploadDialog {
|
export class UploadDialog {
|
||||||
|
|
||||||
@@ -24,7 +25,8 @@ export class UploadDialog {
|
|||||||
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
|
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
|
||||||
uploadedStatusIcon = by.css('mat-icon[class*="status--done"]');
|
uploadedStatusIcon = by.css('mat-icon[class*="status--done"]');
|
||||||
cancelledStatusIcon = by.css('div[class*="status--cancelled"]');
|
cancelledStatusIcon = by.css('div[class*="status--cancelled"]');
|
||||||
errorStatusIcon = by.css('div[class*="status--error"]');
|
errorStatusIcon = by.css('div[class*="status--error"] mat-icon');
|
||||||
|
errorTooltip = element(by.css('div.mat-tooltip'));
|
||||||
cancelWhileUploadingIcon = by.css('mat-icon[class*="adf-file-uploading-row__action adf-file-uploading-row__action--cancel"]');
|
cancelWhileUploadingIcon = by.css('mat-icon[class*="adf-file-uploading-row__action adf-file-uploading-row__action--cancel"]');
|
||||||
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
||||||
title = element(by.css('span[class*="upload-dialog__title"]'));
|
title = element(by.css('span[class*="upload-dialog__title"]'));
|
||||||
@@ -185,4 +187,14 @@ export class UploadDialog {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
displayTooltip() {
|
||||||
|
Util.waitUntilElementIsVisible(element(this.errorStatusIcon));
|
||||||
|
browser.actions().mouseMove(element(this.errorStatusIcon)).perform();
|
||||||
|
}
|
||||||
|
|
||||||
|
getTooltip() {
|
||||||
|
Util.waitUntilElementIsVisible(this.errorTooltip);
|
||||||
|
return this.errorTooltip.getText();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user