Disable control flow e2e ADF (#4954)

* update project script possible different JS-API

* first commit no controll flow

* second commit no controll flow

* third commit no controll flow

* 4 commit no controll flow

* 5 commit no controll flow

* 6 commit no controll flow

* 7 commit no controll flow

* 8 commit no controll flow

* 9 commit no controll flow

* 10 commit no controll flow

* 11 commit no controll flow

* 12 commit no controll flow

* 13 commit no controll flow

* 14 commit no controll flow

* 15 commit no controll flow

* 16 commit no controll flow

* 17 commit no controll flow

* 18 commit no controll flow

* 19 commit no controll flow

* 20 commit no controll flow

* remove wdpromise, protractor promise and deferred promises

* - fixed some incorrect “expect” calls
- fixed some matchers
- removed “return this;” when not needed
- added a few more await-s

* forgot a file

* fix some failing tests

* replaced driver calls with browser calls and enabled back waitForAngular

* fix rightClick methods and hopefully some tests

* fix settings-component

* some more fixes for core and content tests

* try to fix some more issues

* linting

* revert some changes, allowing download on headless chrome won’t work with multiple browser instances

* fixes for Search tests

* try to remove some wait calls

* fix build

* increase allScriptsTimeout and try another protractor and web driver version

* improve navigation methods

* some fixes for notification history and login sso

* forgot a space

* fix packages and enable some screenshots

* navigation bar fixes

* fix some test

* some fixes for notification history and navigation bar
use correct visibility method in attachFileWidget test

* fix searching and another fix for navigation

* try solve sso login

* some more fixes

* refactor async forEach into for..of

* try fix for search tests

* resolve rebabse problems

* remove install

* fix lint

* fix core e2e

* fix core e2e

* fix core e2e

* fix ps tests

* fix some tests

* fix core e2e

* fix core e2e

* fix core

* fix some issues PS

* fix core

* fix core

* fix some ps test

* fix rebase issues

* remove save

* fix url regressed after rebase

* fix url regressed after rebase

* fix ps and core

* fix lint

* more parallel e2e ps

* fix some ps cloud test

* some cloud fix

* fix lint

* fix some test

* remove files to be ignored

* out-tsc

* improve one cs test

* fix candidate base app

* fix ps test

* remove click function

* clean methods alrady present in browser action

* try ugly wait

* move wait

* remove duplicate call

* remove underscore

* fix after review

* fix imports

* minor cosmetic fixes

* fix comments test
This commit is contained in:
Eugenio Romano
2019-08-17 14:32:02 +02:00
committed by GitHub
parent 4f3cf669f2
commit 83412bb9b6
328 changed files with 17653 additions and 18793 deletions

View File

@@ -26,12 +26,12 @@ import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Upload component', () => {
describe('Upload component', async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const contentServicesPage = new ContentServicesPage();
const uploadDialog = new UploadDialog();
const uploadToggles = new UploadToggles();
@@ -53,7 +53,7 @@ describe('Upload component', () => {
'location': resources.Files.ADF_DOCUMENTS.LARGE_FILE.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -62,55 +62,57 @@ describe('Upload component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
it('[C272792] Should be possible to cancel upload of a big file using row cancel icon', () => {
browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 3000)');
it('[C272792] Should be possible to cancel upload of a big file using row cancel icon', async () => {
await browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 3000)');
contentServicesPage.uploadFile(largeFile.location);
await contentServicesPage.uploadFile(largeFile.location);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
});
it('[C287790] Should be possible to cancel upload of a big file through the cancel uploads button', () => {
browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
it('[C287790] Should be possible to cancel upload of a big file through the cancel uploads button', async () => {
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
contentServicesPage.uploadFile(largeFile.location);
await contentServicesPage.uploadFile(largeFile.location);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
});
it('[C272793] Should be able to cancel multiple files upload', () => {
browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
it('[C272793] Should be able to cancel multiple files upload', async () => {
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
uploadToggles.enableMultipleFileUpload();
contentServicesPage.uploadMultipleFile([pngFileModel.location, largeFile.location]);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name).checkContentIsNotDisplayed(largeFile.name);
uploadToggles.disableMultipleFileUpload();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile([pngFileModel.location, largeFile.location]);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await uploadToggles.disableMultipleFileUpload();
});
});

View File

@@ -55,7 +55,7 @@ describe('Upload component - Excluded Files', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -69,42 +69,39 @@ describe('Upload component - Excluded Files', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
afterEach(async (done) => {
contentServicesPage.goToDocumentList();
afterEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C279914] Should not allow upload default excluded files using D&D', () => {
contentServicesPage.checkDragAndDropDIsDisplayed();
it('[C279914] Should not allow upload default excluded files using D&D', async () => {
await contentServicesPage.checkDragAndDropDIsDisplayed();
const dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location);
await dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location);
browser.driver.sleep(5000);
await browser.sleep(5000);
uploadDialog.dialogIsNotDisplayed();
await uploadDialog.dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
await contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
});
it('[C260122] Should not allow upload default excluded files using Upload button', () => {
contentServicesPage
.uploadFile(iniExcludedFile.location)
.checkContentIsNotDisplayed(iniExcludedFile.name);
it('[C260122] Should not allow upload default excluded files using Upload button', async () => {
await contentServicesPage.uploadFile(iniExcludedFile.location);
await contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
});
it('[C212862] Should not allow upload file excluded in the files extension of app.config.json', async () => {
@@ -113,11 +110,12 @@ describe('Upload component - Excluded Files', () => {
'match-options': { 'nocase': true }
}));
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage
.uploadFile(txtFileModel.location)
.checkContentIsNotDisplayed(txtFileModel.name);
await contentServicesPage
.uploadFile(txtFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(txtFileModel.name);
});
it('[C274688] Should extension type added as excluded and accepted not be uploaded', async () => {
@@ -126,14 +124,14 @@ describe('Upload component - Excluded Files', () => {
'match-options': { 'nocase': true }
}));
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.png');
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.png');
contentServicesPage.uploadFile(pngFile.location);
browser.driver.sleep(1000);
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.uploadFile(pngFile.location);
await browser.sleep(1000);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
});
});

View File

@@ -0,0 +1,185 @@
/*!
* @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, UploadActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
import { FileModel } from '../../models/ACS/fileModel';
import { browser } from 'protractor';
import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
describe('Upload component', () => {
const contentServicesPage = new ContentServicesPage();
const uploadDialog = new UploadDialog();
const uploadToggles = new UploadToggles();
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
const versionManagePage = new VersionManagePage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const firstPdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
const docxFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const pngFileModelTwo = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location];
const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name];
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
});
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
afterEach(async () => {
const nbResults = await contentServicesPage.numberOfResultsDisplayed();
if (nbResults > 1) {
const nodesPromise = await contentServicesPage.getElementsDisplayedId();
for (const node of nodesPromise) {
const nodeId = await node;
await uploadActions.deleteFileOrFolder(nodeId);
}
}
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.minimizeUploadDialog();
await uploadDialog.dialogIsMinimized();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.maximizeUploadDialog();
await uploadDialog.dialogIsDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C291902] Should be shown upload counter display in dialog box', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260168] Should be possible to cancel upload using dialog icon', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.removeUploadedFile(pdfFileModel.name);
await uploadDialog.fileIsCancelled(pdfFileModel.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
});
it('[C260176] Should remove files from upload dialog box when closed', async () => {
await contentServicesPage.uploadFile(pngFileModelTwo.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModelTwo.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage .checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260170] Should be possible to upload multiple files', async () => {
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile(filesLocation);
await contentServicesPage.checkContentsAreDisplayed(filesName);
await uploadDialog.filesAreUploaded(filesName);
await expect(await uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableMultipleFileUpload();
});
it('[C311305] Should NOT be able to remove uploaded version', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await contentServicesPage.versionManagerContent(docxFileModel.name);
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.uploadNewVersionFile(pngFileModel.location);
await versionManagePage.closeVersionDialog();
await uploadDialog.removeUploadedFile(pngFileModel.name);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
});
});

View File

@@ -66,28 +66,28 @@ describe('Upload component', () => {
const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location];
const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name];
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
afterEach(async (done) => {
afterEach(async () => {
const nbResults = await contentServicesPage.numberOfResultsDisplayed();
if (nbResults > 1) {
const nodesPromise = await contentServicesPage.getElementsDisplayedId();
@@ -97,80 +97,99 @@ describe('Upload component', () => {
await uploadActions.deleteFileOrFolder(nodeId);
});
}
done();
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.minimizeUploadDialog().dialogIsMinimized();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.maximizeUploadDialog().dialogIsDisplayed().fileIsUploaded(docxFileModel.name);
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.minimizeUploadDialog();
await uploadDialog.dialogIsMinimized();
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.maximizeUploadDialog();
await uploadDialog.dialogIsDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C291902] Should be shown upload counter display in dialog box', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C291902] Should be shown upload counter display in dialog box', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260168] Should be possible to cancel upload using dialog icon', () => {
contentServicesPage.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
uploadDialog.removeUploadedFile(pdfFileModel.name).fileIsCancelled(pdfFileModel.name);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
it('[C260168] Should be possible to cancel upload using dialog icon', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.removeUploadedFile(pdfFileModel.name);
await uploadDialog.fileIsCancelled(pdfFileModel.name);
await expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
});
it('[C260176] Should remove files from upload dialog box when closed', () => {
contentServicesPage.uploadFile(pngFileModelTwo.location).checkContentIsDisplayed(pngFileModelTwo.name);
it('[C260176] Should remove files from upload dialog box when closed', async () => {
await contentServicesPage.uploadFile(pngFileModelTwo.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModelTwo.name);
uploadDialog.fileIsUploaded(pngFileModelTwo.name);
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name).fileIsUploaded(pngFileModelTwo.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.uploadFile(pdfFileModel.location).checkContentIsDisplayed(pdfFileModel.name);
uploadDialog.fileIsUploaded(pdfFileModel.name).fileIsNotDisplayedInDialog(pngFileModel.name).fileIsNotDisplayedInDialog(pngFileModelTwo.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260170] Should be possible to upload multiple files', () => {
contentServicesPage.checkAcsContainer();
uploadToggles.enableMultipleFileUpload();
contentServicesPage.uploadMultipleFile(filesLocation).checkContentsAreDisplayed(filesName);
uploadDialog.filesAreUploaded(filesName);
expect(uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
uploadToggles.disableMultipleFileUpload();
it('[C260170] Should be possible to upload multiple files', async () => {
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile(filesLocation);
await contentServicesPage.checkContentsAreDisplayed(filesName);
await uploadDialog.filesAreUploaded(filesName);
await expect(uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableMultipleFileUpload();
});
it('[C311305] Should NOT be able to remove uploaded version', () => {
contentServicesPage.uploadFile(docxFileModel.location);
uploadDialog.fileIsUploaded(docxFileModel.name);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
it('[C311305] Should NOT be able to remove uploaded version', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
contentServicesPage.versionManagerContent(docxFileModel.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(
await contentServicesPage.versionManagerContent(docxFileModel.name);
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.uploadNewVersionFile(
pngFileModel.location
);
versionManagePage.closeVersionDialog();
uploadDialog.removeUploadedFile(pngFileModel.name);
contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await versionManagePage.closeVersionDialog();
await uploadDialog.removeUploadedFile(pngFileModel.name);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
});
});

View File

@@ -36,9 +36,9 @@ describe('Upload component', () => {
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const navigationBarPage = new NavigationBarPage();
@@ -67,7 +67,7 @@ describe('Upload component', () => {
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -75,259 +75,255 @@ describe('Upload component', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
describe('', () => {
beforeEach(() => {
contentServicesPage.goToDocumentList();
afterEach(async () => {
const nodeList = await contentServicesPage.getElementsDisplayedId();
for (const node of nodeList) {
try {
await uploadActions.deleteFileOrFolder(node);
} catch (error) {
}
}
});
afterEach(async (done) => {
it('[C272788] Should display upload button', async () => {
await expect(await contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip');
contentServicesPage.getElementsDisplayedId().then((nodeList) => {
nodeList.forEach(async (currentNode) => {
await uploadActions.deleteFileOrFolder(currentNode);
});
});
done();
await contentServicesPage.checkUploadButton();
await contentServicesPage.checkContentIsDisplayed(firstPdfFileModel.name);
});
it('[C272788] Should display upload button', () => {
expect(contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip');
it('[C272789] Should be able to upload PDF file', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage
.checkUploadButton()
.checkContentIsDisplayed(firstPdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C272789] Should be able to upload PDF file', () => {
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
it('[C272790] Should be able to upload text file', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(pdfFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C272790] Should be able to upload text file', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C260141] Should be possible to upload PNG file', async () => {
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260141] Should be possible to upload PNG file', () => {
contentServicesPage
.uploadFile(pngFileModel.location)
.checkContentIsDisplayed(pngFileModel.name);
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.minimizeUploadDialog();
await uploadDialog.dialogIsMinimized();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.maximizeUploadDialog();
await uploadDialog.dialogIsDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.minimizeUploadDialog().dialogIsMinimized();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.maximizeUploadDialog().dialogIsDisplayed().fileIsUploaded(docxFileModel.name);
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
it('[C272794] Should display tooltip for uploading files', async () => {
await uploadToggles.enableMultipleFileUpload();
await uploadToggles.checkMultipleFileUploadToggleIsEnabled();
await expect(await contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip');
await uploadToggles.disableMultipleFileUpload();
});
it('[C272794] Should display tooltip for uploading files', () => {
uploadToggles.enableMultipleFileUpload();
uploadToggles.checkMultipleFileUploadToggleIsEnabled();
browser.driver.sleep(1000);
expect(contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip');
uploadToggles.disableMultipleFileUpload();
});
it('[C279920] Should rename a file uploaded twice', () => {
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
it('[C279920] Should rename a file uploaded twice', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
pdfFileModel.setVersion('1');
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.getVersionName());
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.getVersionName());
uploadDialog
.clickOnCloseButton()
.dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
pdfFileModel.setVersion('');
});
it('[C260172] Should be possible to enable versioning', () => {
uploadToggles.enableVersioning();
uploadToggles.checkVersioningToggleIsEnabled();
it('[C260172] Should be possible to enable versioning', async () => {
await uploadToggles.enableVersioning();
await uploadToggles.checkVersioningToggleIsEnabled();
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
pdfFileModel.setVersion('1');
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
uploadDialog
.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
uploadDialog
.clickOnCloseButton()
.dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
contentServicesPage
.checkContentIsNotDisplayed(pdfFileModel.getVersionName());
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.getVersionName());
pdfFileModel.setVersion('');
uploadToggles.disableVersioning();
await uploadToggles.disableVersioning();
});
it('[C260174] Should be possible to set a max size', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
uploadToggles.addMaxSize('400');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.deleteContent(fileWithSpecificSize.name);
contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
uploadToggles.addMaxSize('399');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
it('[C260174] Should be possible to set a max size', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await uploadToggles.addMaxSize('400');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
await uploadDialog.fileIsUploaded(fileWithSpecificSize.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.deleteContent(fileWithSpecificSize.name);
await contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
await uploadToggles.addMaxSize('399');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
// expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
// await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name).clickOnCloseButton().dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableMaxSize();
await uploadToggles.disableMaxSize();
});
it('[C272796] Should be possible to set max size to 0', () => {
contentServicesPage.goToDocumentList();
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
uploadToggles.addMaxSize('0');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
// expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
it('[C272796] Should be possible to set max size to 0', async () => {
await contentServicesPage.goToDocumentList();
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await uploadToggles.addMaxSize('0');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
// await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name).clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableMaxSize();
await uploadToggles.disableMaxSize();
});
it('[C272797] Should be possible to set max size to 1', () => {
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
browser.driver.sleep(1000);
uploadToggles.addMaxSize('1');
uploadToggles.disableMaxSize();
contentServicesPage.uploadFile(fileWithSpecificSize.location);
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed(fileWithSpecificSize.name);
it('[C272797] Should be possible to set max size to 1', async () => {
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await browser.sleep(1000);
await uploadToggles.addMaxSize('1');
await uploadToggles.disableMaxSize();
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
await uploadDialog.fileIsUploaded(fileWithSpecificSize.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(fileWithSpecificSize.name);
});
it('[C91318] Should Enable/Disable upload button when change the disable property', () => {
uploadToggles.clickCheckboxDisableUpload();
expect(contentServicesPage.uploadButtonIsEnabled()).toBeFalsy();
it('[C91318] Should Enable/Disable upload button when change the disable property', async () => {
await uploadToggles.clickCheckboxDisableUpload();
await expect(await contentServicesPage.uploadButtonIsEnabled()).toBe(false, 'Upload button is enabled');
uploadToggles.clickCheckboxDisableUpload();
expect(contentServicesPage.uploadButtonIsEnabled()).toBeTruthy();
await uploadToggles.clickCheckboxDisableUpload();
await expect(await contentServicesPage.uploadButtonIsEnabled()).toBe(true, 'Upload button not enabled');
});
});
it('[C260171] Should upload only the extension filter allowed when Enable extension filter is enabled', () => {
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.docx');
contentServicesPage.uploadFile(docxFileModel.location).checkContentIsDisplayed(docxFileModel.name);
uploadDialog.removeUploadedFile(docxFileModel.name).fileIsCancelled(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsNotDisplayed(pngFileModel.name);
uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableExtensionFilter();
it('[C260171] Should upload only the extension filter allowed when Enable extension filter is enabled', async () => {
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.docx');
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.removeUploadedFile(docxFileModel.name);
await uploadDialog.fileIsCancelled(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableExtensionFilter();
});
it('[C274687] Should upload with drag and drop only the extension filter allowed when Enable extension filter is enabled', () => {
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.docx');
it('[C274687] Should upload with drag and drop only the extension filter allowed when Enable extension filter is enabled', async () => {
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.docx');
const dragAndDrop = new DropActions();
const dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
dragAndDrop.dropFile(dragAndDropArea, docxFileModel.location);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await dragAndDrop.dropFile(dragAndDropArea, docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.removeUploadedFile(docxFileModel.name).fileIsCancelled(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.removeUploadedFile(docxFileModel.name);
await uploadDialog.fileIsCancelled(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
dragAndDrop.dropFile(dragAndDropArea, pngFileModel.location);
contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableExtensionFilter();
await dragAndDrop.dropFile(dragAndDropArea, pngFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableExtensionFilter();
});
it('[C291921] Should display tooltip for uploading files on a not found location', async () => {
const folderName = StringUtil.generateRandomString(8);
const folderUploadedModel = await browser.controlFlow().execute(async () => {
return await uploadActions.createFolder(folderName, '-my-');
});
const folderUploadedModel = await uploadActions.createFolder(folderName, '-my-');
await navigationBarPage.openContentServicesFolder(folderUploadedModel.entry.id);
await contentServicesPage.checkUploadButton();
navigationBarPage.openContentServicesFolder(folderUploadedModel.entry.id);
contentServicesPage.checkUploadButton();
await uploadActions.deleteFileOrFolder(folderUploadedModel.entry.id);
browser.controlFlow().execute(async () => {
await uploadActions.deleteFileOrFolder(folderUploadedModel.entry.id);
});
await contentServicesPage.uploadFile(pdfFileModel.location);
contentServicesPage.uploadFile(pdfFileModel.location);
uploadDialog.displayTooltip();
expect(uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
await uploadDialog.displayTooltip();
await expect(await uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
});
});

View File

@@ -56,14 +56,14 @@ describe('Upload - User permission', () => {
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
});
beforeAll(() => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
});
beforeEach(async (done) => {
beforeEach(async () => {
acsUser = new AcsUserModel();
acsUserTwo = new AcsUserModel();
@@ -95,106 +95,99 @@ describe('Upload - User permission', () => {
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
done();
});
describe('Consumer permissions', () => {
beforeEach(async (done) => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C291921] Should display tooltip for uploading files without permissions', () => {
navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
it('[C291921] Should display tooltip for uploading files without permissions', async () => {
await navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
contentServicesPage.checkDragAndDropDIsDisplayed();
await contentServicesPage.checkDragAndDropDIsDisplayed();
contentServicesPage.dragAndDropFile(emptyFile.location);
await contentServicesPage.dragAndDropFile(emptyFile.location);
uploadDialog.fileIsError(emptyFile.name);
await uploadDialog.fileIsError(emptyFile.name);
uploadDialog.displayTooltip();
await uploadDialog.displayTooltip();
expect(uploadDialog.getTooltip()).toEqual('Insufficient permissions to upload in this location [403]');
await expect(await 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);
it('[C279915] Should not be allowed to upload a file in folder with consumer permissions', async () => {
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
await navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
browser.sleep(3000);
await browser.sleep(3000);
contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.uploadFile(emptyFile.location);
notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
});
describe('full permissions', () => {
beforeEach(async (done) => {
navigationBarPage.openContentServicesFolder(this.managerSite.entry.guid);
beforeEach(async () => {
await navigationBarPage.openContentServicesFolder(this.managerSite.entry.guid);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
it('[C279917] Should be allowed to upload a file in a folder with manager permissions', () => {
contentServicesPage.uploadFile(emptyFile.location);
it('[C279917] Should be allowed to upload a file in a folder with manager permissions', async () => {
await contentServicesPage.uploadFile(emptyFile.location);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
});
});
describe('multiple users', () => {
beforeEach(async (done) => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C260175] Should two different user upload files in the proper User Home', async () => {
contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.uploadFile(emptyFile.location);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
navigationBarPage.clickLoginButton();
await navigationBarPage.clickLoginButton();
await loginPage.loginToContentServicesUsingUserModel(acsUserTwo);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
await contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
contentServicesPage.uploadFile(pngFile.location);
await contentServicesPage.uploadFile(pngFile.location);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
navigationBarPage.clickLoginButton();
await navigationBarPage.clickLoginButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
contentServicesPage.uploadFile(pdfFile.location);
await contentServicesPage.uploadFile(pdfFile.location);
contentServicesPage.checkContentIsDisplayed(pdfFile.name);
await contentServicesPage.checkContentIsDisplayed(pdfFile.name);
});
});