mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
[no-issue-e2e] directive crete folder new e2e (#3677)
* new folder directive e2e * fix search test * fix pr-deploy script
This commit is contained in:
parent
9c22c13434
commit
c089c87630
140
e2e/content-services/directives/create_folder_directive.e2e.ts
Normal file
140
e2e/content-services/directives/create_folder_directive.e2e.ts
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 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 LoginPage = require('../../pages/adf/loginPage');
|
||||||
|
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||||
|
import CreateFolderDialog = require('../../pages/adf/dialog/createFolderDialog');
|
||||||
|
import NotificationPage = require('../../pages/adf/notificationPage');
|
||||||
|
import MetadataViewPage = require('../../pages/adf/metadataViewPage');
|
||||||
|
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||||
|
|
||||||
|
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||||
|
|
||||||
|
import TestConfig = require('../../test.config');
|
||||||
|
|
||||||
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
|
import CONSTANTS = require('../../util/constants');
|
||||||
|
|
||||||
|
import { browser, protractor } from 'protractor';
|
||||||
|
|
||||||
|
describe('Document List - Pagination', function () {
|
||||||
|
|
||||||
|
let loginPage = new LoginPage();
|
||||||
|
let contentServicesPage = new ContentServicesPage();
|
||||||
|
let createFolderDialog = new CreateFolderDialog();
|
||||||
|
let notificationPage = new NotificationPage();
|
||||||
|
let metadataViewPage = new MetadataViewPage();
|
||||||
|
let contentListPage = new ContentListPage();
|
||||||
|
|
||||||
|
let acsUser = new AcsUserModel();
|
||||||
|
let consumerUser = new AcsUserModel();
|
||||||
|
let site;
|
||||||
|
|
||||||
|
beforeAll(async (done) => {
|
||||||
|
this.alfrescoJsApi = new AlfrescoApi({
|
||||||
|
provider: 'ECM',
|
||||||
|
hostEcm: TestConfig.adf.url
|
||||||
|
});
|
||||||
|
|
||||||
|
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
|
|
||||||
|
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||||
|
|
||||||
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
|
|
||||||
|
contentServicesPage.goToDocumentList();
|
||||||
|
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260154] Should not create the folder if cancel button is clicked', () => {
|
||||||
|
let folderName = 'cancelFolder';
|
||||||
|
contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
|
createFolderDialog.addFolderName(folderName);
|
||||||
|
createFolderDialog.clickOnCancelButton();
|
||||||
|
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed(folderName);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260155] Should enable the Create button only when a folder name is present', () => {
|
||||||
|
let folderName = 'NotEnableFolder';
|
||||||
|
contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
|
|
||||||
|
createFolderDialog.addFolderName(folderName);
|
||||||
|
|
||||||
|
createFolderDialog.checkCreateBtnIsEnabled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260156] Should not be possible create two folder with the same name', () => {
|
||||||
|
let folderName = 'duplicate';
|
||||||
|
contentServicesPage.createNewFolder(folderName);
|
||||||
|
|
||||||
|
contentServicesPage.checkContentIsDisplayed(folderName);
|
||||||
|
|
||||||
|
contentServicesPage.createNewFolder(folderName);
|
||||||
|
|
||||||
|
notificationPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260157] Should be possible create a folder under a folder with the same name', () => {
|
||||||
|
let folderName = 'sameSubFolder';
|
||||||
|
|
||||||
|
contentServicesPage.createNewFolder(folderName);
|
||||||
|
contentServicesPage.checkContentIsDisplayed(folderName);
|
||||||
|
|
||||||
|
contentServicesPage.navigateToFolder(folderName);
|
||||||
|
|
||||||
|
contentServicesPage.createNewFolder(folderName);
|
||||||
|
contentServicesPage.checkContentIsDisplayed(folderName);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260158] Should be possible add a folder description when create a new folder', () => {
|
||||||
|
let folderName = 'folderDescription';
|
||||||
|
let description = 'this is the description';
|
||||||
|
|
||||||
|
contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
|
createFolderDialog.addFolderName(folderName);
|
||||||
|
createFolderDialog.addFolderDescription(description);
|
||||||
|
|
||||||
|
createFolderDialog.clickOnCreateButton();
|
||||||
|
|
||||||
|
contentServicesPage.checkContentIsDisplayed(folderName);
|
||||||
|
|
||||||
|
contentListPage.metadataContent(folderName);
|
||||||
|
|
||||||
|
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('this is the description');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260159] Should not be possible create a folder with banned carachter', () => {
|
||||||
|
let bannedChar = ['* ', '<', '>', '\\', '/', '?', ':', '|'];
|
||||||
|
|
||||||
|
contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
|
bannedChar.forEach((currentChar) => {
|
||||||
|
createFolderDialog.addFolderName(currentChar);
|
||||||
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -214,20 +214,19 @@ describe('Search component - Search Bar', () => {
|
|||||||
searchResultPage.checkContentIsDisplayed(firstFileModel.name);
|
searchResultPage.checkContentIsDisplayed(firstFileModel.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
xit('[C91321] Should be able to use down arrow key when navigating throw suggestions', () => {
|
it('[C91321] Should be able to use down arrow key when navigating throw suggestions', () => {
|
||||||
contentServicesPage.goToDocumentList();
|
contentServicesPage.goToDocumentList();
|
||||||
|
|
||||||
searchDialog
|
searchDialog
|
||||||
.clickOnSearchIcon()
|
.clickOnSearchIcon()
|
||||||
.enterText(secondFolder.shortName)
|
.enterText(secondFolder.shortName)
|
||||||
.pressDownArrowAndEnter();
|
.pressDownArrowAndEnter();
|
||||||
searchDialog.pressDownArrowAndEnter();
|
|
||||||
|
|
||||||
contentServicesPage.checkAcsContainer();
|
contentServicesPage.checkAcsContainer();
|
||||||
expect(contentServicesPage.currentFolderName()).toEqual(secondFolder.name);
|
expect(contentServicesPage.currentFolderName()).toEqual(secondFolder.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
xit('[C260254] The search bar gets closed when clicking on another browser tab', () => {
|
it('[C260254] The search bar gets closed when clicking on another browser tab', () => {
|
||||||
contentServicesPage.goToDocumentList();
|
contentServicesPage.goToDocumentList();
|
||||||
|
|
||||||
searchDialog
|
searchDialog
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
import LoginPage = require('../pages/adf/loginPage');
|
import LoginPage = require('../pages/adf/loginPage');
|
||||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||||
import { HeaderPage } from '../pages/adf/core/headerPage';
|
import { HeaderPage } from '../pages/adf/core/headerPage';
|
||||||
import SettingsPage = require('../pages/adf/settingsPage')
|
import SettingsPage = require('../pages/adf/settingsPage');
|
||||||
|
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
|
|
||||||
|
@ -348,8 +348,7 @@ describe('Content Services Viewer', () => {
|
|||||||
it('[C269109] Should not be able to open thumbnail pane before the pdf is loaded', () => {
|
it('[C269109] Should not be able to open thumbnail pane before the pdf is loaded', () => {
|
||||||
viewerPage.viewFile(pdfFile.name);
|
viewerPage.viewFile(pdfFile.name);
|
||||||
|
|
||||||
viewerPage.clickThumbnailsBtn();
|
viewerPage.checkThumbnailsBtnIsDisabled();
|
||||||
viewerPage.checkThumbnailsContentIsNotDisplayed();
|
|
||||||
|
|
||||||
viewerPage.clickCloseButton();
|
viewerPage.clickCloseButton();
|
||||||
});
|
});
|
||||||
|
@ -249,9 +249,14 @@ var ContentServicesPage = function () {
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.createNewFolder = function (folder) {
|
this.clickOnCreateNewFolder = function () {
|
||||||
Util.waitUntilElementIsVisible(createFolderButton);
|
Util.waitUntilElementIsVisible(createFolderButton);
|
||||||
createFolderButton.click();
|
createFolderButton.click();
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.createNewFolder = function (folder) {
|
||||||
|
this.clickOnCreateNewFolder();
|
||||||
createFolderDialog.addFolderName(folder);
|
createFolderDialog.addFolderName(folder);
|
||||||
createFolderDialog.clickOnCreateButton();
|
createFolderDialog.clickOnCreateButton();
|
||||||
return this;
|
return this;
|
||||||
@ -363,7 +368,7 @@ var ContentServicesPage = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.uploadButtonIsEnabled = function () {
|
this.uploadButtonIsEnabled = function () {
|
||||||
return uploadFileButton.isEnabled()
|
return uploadFileButton.isEnabled();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.deleteContent = function (content) {
|
this.deleteContent = function (content) {
|
||||||
|
@ -19,10 +19,10 @@ var Util = require('../../../util/util');
|
|||||||
|
|
||||||
var CreateFolderDialog = function () {
|
var CreateFolderDialog = function () {
|
||||||
|
|
||||||
var folderNameField = element(by.css("input[placeholder='Name']"));
|
var folderNameField = element(by.id('adf-folder-name-input'));
|
||||||
var folderDescriptionField = element(by.css("textarea[placeholder='Description']"));
|
var folderDescriptionField = element(by.id('adf-folder-description-input'));
|
||||||
var createButton = element(by.cssContainingText("button span", "Create"));
|
var createButton = element(by.id('adf-folder-create-button'));
|
||||||
var cancelButton = element(by.cssContainingText("button span", "Cancel"));
|
var cancelButton = element(by.id('adf-folder-cancel-button'));
|
||||||
|
|
||||||
this.clickOnCreateButton = function () {
|
this.clickOnCreateButton = function () {
|
||||||
Util.waitUntilElementIsVisible(createButton);
|
Util.waitUntilElementIsVisible(createButton);
|
||||||
@ -30,6 +30,16 @@ var CreateFolderDialog = function () {
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.checkCreateBtnIsDisabled = function () {
|
||||||
|
Util.waitUntilElementIsVisible(createButton.getAttribute("disabled"));
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.checkCreateBtnIsEnabled = function () {
|
||||||
|
createButton.isEnabled();
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
this.clickOnCancelButton = function () {
|
this.clickOnCancelButton = function () {
|
||||||
Util.waitUntilElementIsVisible(cancelButton);
|
Util.waitUntilElementIsVisible(cancelButton);
|
||||||
cancelButton.click();
|
cancelButton.click();
|
||||||
@ -38,13 +48,14 @@ var CreateFolderDialog = function () {
|
|||||||
|
|
||||||
this.addFolderName = function (folderName) {
|
this.addFolderName = function (folderName) {
|
||||||
Util.waitUntilElementIsVisible(folderNameField);
|
Util.waitUntilElementIsVisible(folderNameField);
|
||||||
folderNameField.sendKeys(folderName);
|
folderNameField.clear().sendKeys(folderName);
|
||||||
|
browser.driver.sleep(500);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.addFolderDescription = function (folderDescription) {
|
this.addFolderDescription = function (folderDescription) {
|
||||||
Util.waitUntilElementIsVisible(folderDescriptionField);
|
Util.waitUntilElementIsVisible(folderDescriptionField);
|
||||||
folderDescriptionField.sendKeys(folderDescription);
|
folderDescriptionField.clear().sendKeys(folderDescription);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ var SearchDialog = function () {
|
|||||||
var allRows = element.all(by.css("h4[class*='adf-search-fixed-text']"));
|
var allRows = element.all(by.css("h4[class*='adf-search-fixed-text']"));
|
||||||
|
|
||||||
this.pressDownArrowAndEnter = function () {
|
this.pressDownArrowAndEnter = function () {
|
||||||
element(by.css("adf-search-control div[style*='translateX(0%)'] input")).sendKeys(protractor.Key.ARROW_DOWN);
|
element(by.css("adf-search-control div input")).sendKeys(protractor.Key.ARROW_DOWN);
|
||||||
return browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
return browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -139,6 +139,11 @@ var ViewerToolbarPage = function () {
|
|||||||
Util.waitUntilElementIsVisible(thumbnailsBtn);
|
Util.waitUntilElementIsVisible(thumbnailsBtn);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.checkThumbnailsBtnIsDisabled = function () {
|
||||||
|
Util.waitUntilElementIsVisible(thumbnailsBtn.getAttribute("disabled"));
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
this.checkThumbnailsContentIsDisplayed = function () {
|
this.checkThumbnailsContentIsDisplayed = function () {
|
||||||
Util.waitUntilElementIsVisible(thumbnailsContent);
|
Util.waitUntilElementIsVisible(thumbnailsContent);
|
||||||
};
|
};
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
<form [formGroup]="form" (submit)="submit()">
|
<form [formGroup]="form" (submit)="submit()">
|
||||||
<mat-form-field class="adf-full-width">
|
<mat-form-field class="adf-full-width">
|
||||||
<input
|
<input
|
||||||
|
id="adf-folder-name-input"
|
||||||
placeholder="{{ 'CORE.FOLDER_DIALOG.FOLDER_NAME.LABEL' | translate }}"
|
placeholder="{{ 'CORE.FOLDER_DIALOG.FOLDER_NAME.LABEL' | translate }}"
|
||||||
matInput
|
matInput
|
||||||
required
|
required
|
||||||
[formControl]="form.controls['name']"
|
[formControl]="form.controls['name']"/>
|
||||||
/>
|
|
||||||
|
|
||||||
<mat-hint *ngIf="form.controls['name'].dirty">
|
<mat-hint *ngIf="form.controls['name'].dirty">
|
||||||
<span *ngIf="form.controls['name'].errors?.required">
|
<span *ngIf="form.controls['name'].errors?.required">
|
||||||
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
<mat-form-field class="adf-full-width">
|
<mat-form-field class="adf-full-width">
|
||||||
<textarea
|
<textarea
|
||||||
|
id="adf-folder-description-input"
|
||||||
matInput
|
matInput
|
||||||
placeholder="{{ 'CORE.FOLDER_DIALOG.FOLDER_DESCRIPTION.LABEL' | translate }}"
|
placeholder="{{ 'CORE.FOLDER_DIALOG.FOLDER_DESCRIPTION.LABEL' | translate }}"
|
||||||
rows="4"
|
rows="4"
|
||||||
@ -41,11 +42,13 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
mat-button
|
mat-button
|
||||||
|
id="adf-folder-cancel-button"
|
||||||
mat-dialog-close>
|
mat-dialog-close>
|
||||||
{{ 'CORE.FOLDER_DIALOG.CANCEL_BUTTON.LABEL' | translate }}
|
{{ 'CORE.FOLDER_DIALOG.CANCEL_BUTTON.LABEL' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="adf-dialog-action-button"
|
<button class="adf-dialog-action-button"
|
||||||
|
id="adf-folder-create-button"
|
||||||
mat-button
|
mat-button
|
||||||
(click)="submit()"
|
(click)="submit()"
|
||||||
[disabled]="!form.valid">
|
[disabled]="!form.valid">
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
var program = require('commander');
|
var program = require('commander');
|
||||||
var request = require('request');
|
var request = require('request');
|
||||||
|
|
||||||
var stackId = "1st550"
|
|
||||||
|
|
||||||
function asyncRequest(option) {
|
function asyncRequest(option) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
request(option, function (error, res, body) {
|
request(option, function (error, res, body) {
|
||||||
if (!error && (res.statusCode == 200 || res.statusCode == 201)) {
|
if (!error && (res.statusCode == 200 || res.statusCode == 201)) {
|
||||||
resolve(body);
|
resolve(body);
|
||||||
} else {
|
} else {
|
||||||
|
console.log("Error " + JSON.stringify(body));
|
||||||
reject(error + JSON.stringify(body));
|
reject(error + JSON.stringify(body));
|
||||||
|
throw "Error";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -41,11 +41,27 @@ async function main() {
|
|||||||
},
|
},
|
||||||
body: ""
|
body: ""
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error);
|
console.log('Project name errror'+ error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var stacks = await asyncRequest({
|
||||||
|
url: `${program.server}/v2-beta/projects/1a2747/stacks?limit=-1&sort=name`,
|
||||||
|
method: 'GET',
|
||||||
|
json: true,
|
||||||
|
headers: {
|
||||||
|
"content-type": "application/json",
|
||||||
|
"accept": "application/json",
|
||||||
|
"Authorization": auth
|
||||||
|
},
|
||||||
|
body: ""
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log('Stacks errror'+ error);
|
||||||
|
});
|
||||||
|
|
||||||
|
var stackId = stacks.data[0].id;
|
||||||
var environmentId = project.data[0].id
|
var environmentId = project.data[0].id
|
||||||
|
|
||||||
|
console.log("StackId " + stackId);
|
||||||
console.log("ID environment " + environmentId);
|
console.log("ID environment " + environmentId);
|
||||||
console.log("image to Load " + program.image);
|
console.log("image to Load " + program.image);
|
||||||
|
|
||||||
@ -166,7 +182,7 @@ async function main() {
|
|||||||
},
|
},
|
||||||
body: postData,
|
body: postData,
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error)
|
console.log('Error createService'+ error);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!createService) {
|
if (!createService) {
|
||||||
@ -186,7 +202,7 @@ async function main() {
|
|||||||
},
|
},
|
||||||
body: postData,
|
body: postData,
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error)
|
console.log('Error loadBalancer'+ error);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!loadBalancer) {
|
if (!loadBalancer) {
|
||||||
@ -206,7 +222,7 @@ async function main() {
|
|||||||
"Authorization": auth
|
"Authorization": auth
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error)
|
console.log('Error get load balancer'+ error);
|
||||||
});
|
});
|
||||||
|
|
||||||
//console.log("Load balancer ID " + JSON.stringify(loadBalancerGet.lbConfig.portRules));
|
//console.log("Load balancer ID " + JSON.stringify(loadBalancerGet.lbConfig.portRules));
|
||||||
@ -235,7 +251,7 @@ async function main() {
|
|||||||
},
|
},
|
||||||
body: loadBalancerGet
|
body: loadBalancerGet
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error)
|
console.log('Error Update load balancer'+ error);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user