[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

@@ -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';