[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:
Florin Butu
2019-01-30 11:19:47 +02:00
committed by Eugenio Romano
parent 1b81f687a3
commit 3401b508be
4 changed files with 69 additions and 16 deletions

View File

@@ -28,6 +28,8 @@ import { FolderModel } from '../../models/ACS/folderModel';
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
import { Util } from '../../util/util';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import AlfrescoApi = require('alfresco-js-api-node');
import { UploadActions } from '../../actions/ACS/upload.actions';
@@ -41,6 +43,7 @@ describe('Upload component', () => {
let loginPage = new LoginPage();
let acsUser = new AcsUserModel();
let uploadActions = new UploadActions();
let navigationBarPage = new NavigationBarPage();
let firstPdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
@@ -436,4 +439,24 @@ describe('Upload component', () => {
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]');
});
});

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by, browser } from 'protractor';
import { browser } from 'protractor';
import { Util } from '../../util/util';
@@ -34,7 +34,6 @@ import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
import AlfrescoApi = require('alfresco-js-api-node');
import { DropActions } from '../../actions/drop.actions';
import CONSTANTS = require('../../util/constants');
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', () => {
contentServicesPage.checkDragAndDropDIsDisplayed();
let dragAndDrop = new DropActions();
let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
contentServicesPage.dragAndDropFile(emptyFile.location);
contentServicesPage.dragAndDropFolder(folder.location);
contentServicesPage.checkContentIsDisplayed(emptyFile.name);
contentServicesPage.checkContentIsDisplayed(folder.name);
@@ -134,8 +130,8 @@ describe('Upload - User permission', () => {
browser.sleep(3000);
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
contentServicesPage.dragAndDropFile(emptyFile.location);
contentServicesPage.dragAndDropFolder(folder.location);
let fileInTheUploadedFolder = 'share_profile_pic.png';
@@ -146,6 +142,20 @@ describe('Upload - User permission', () => {
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', () => {
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', () => {
contentServicesPage.checkDragAndDropDIsDisplayed();
let dragAndDrop = new DropActions();
let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
contentServicesPage.dragAndDropFile(emptyFile.location);
contentServicesPage.dragAndDropFolder(folder.location);
let fileInTheUploadedFolder = 'share_profile_pic.png';