[ADF-3299] and [ADF-3300] upgrade to Angular and Material 6 (#3579)

* upgrade to HttpClient

* upgrade to Renderer2

* upgrade Document reference

* remove useless test with deprecated ReflectiveInjector

* upgrade to latest typescript

* upgrade libs

* upgrade package scripts

* remove rxjs blacklists and duplicate rules

* add rxjs compat to help with migration

* fix breaking changes

* fix breaking changes in material

* fix breaking changes (material 6)

* upgrade rxjs, ngx-translate and flex layout

* update unit tests

* restore providers

* upgrade deprecated Observable.error

* rebase
fix first configuration problems

* fix style issues commented

* fix core build

* fix lib template errors

* move lib test execution in angular.json

* ignore

* karma conf files

* fix import statement test

* single run option

* update packages reporter

* restore report

* increase timeout

* improve karma conf test configuration

* fix test issues about lint

* fix test analytics

* fix process service test

* content service fix test

* fix logout directive test

* fix core test

* fix build

* update node-sass to latest

* update angular cli dependencies

* improve build script

create directorites and move files only if previous command succeded

* upgrade individual libs to 6.0

* remove old webpack files

* revert sass change

* fix type issues
fix style issues

* fix tslint demo shell issue

* fix peerdependencies

* fix test e2e BC

* package upate

* fix style import issue

* extract-text-webpack-plugin beta

* fix test dist build command

* remove alpha js-api

* fix tslint issue
add banner tslint rule

* upload service fix

* change BC script

* fix test dist script

* increase demo shell timeout test

* verbose copy

* path absolute

* fix script bc

* fix copy part

* fix path warning
fix monaco editor

* remove duplicate header

* remove unused import

* fix align and check ago tests

* add missing import

* fix notification button selector

* [ANGULAR6] fixed core tests

* fix CS test

* fix cs test step 2

* increase travis_wait for dist

* fix attachment PS

* fix checklist test

* use pdf min
This commit is contained in:
Denys Vuika
2018-08-07 11:58:16 +01:00
committed by Eugenio Romano
parent c510ec864d
commit 6b24bfb1d4
371 changed files with 16287 additions and 24504 deletions

View File

@@ -108,7 +108,7 @@ describe('Comment Component', () => {
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual(comments.first);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
expect(commentsPage.getTime(0)).toContain('ago');
});
it('[C280021] Should be able to add a multiline comment on a file', () => {
@@ -123,7 +123,7 @@ describe('Comment Component', () => {
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual(comments.multiline);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
expect(commentsPage.getTime(0)).toContain('ago');
commentsPage.addComment(comments.second);
commentsPage.checkUserIconIsDisplayed(0);
@@ -131,7 +131,7 @@ describe('Comment Component', () => {
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (2)');
expect(commentsPage.getMessage(0)).toEqual(comments.second);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
expect(commentsPage.getTime(0)).toContain('ago');
});
it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', () => {
@@ -146,6 +146,6 @@ describe('Comment Component', () => {
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual('First name: Last name:');
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
expect(commentsPage.getTime(0)).toContain('ago');
});
});

View File

@@ -194,7 +194,7 @@ describe('Document List Component', () => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
let dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
expect(dateValue).toBe('a few seconds ago');
expect(dateValue).toContain('ago');
done();
});
@@ -614,7 +614,6 @@ describe('Document List Component', () => {
});
it('[C280069] - Gallery Card show details - attributes', () => {
let timeMessage = '';
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.DISPLAY_NAME);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.SIZE);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED_BY);
@@ -622,26 +621,26 @@ describe('Document List Component', () => {
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
timeMessage = moment(folderNode.entry.createdAt).fromNow();
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toBe(timeMessage);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toContain('ago');
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`702.76 KB`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
timeMessage = moment(filePdfNode.entry.createdAt).fromNow();
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toBe(timeMessage);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toContain('ago');
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`770.35 KB`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
timeMessage = moment(fileDocxNode.entry.createdAt).fromNow();
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toBe(timeMessage);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toContain('ago');
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
timeMessage = moment(fileTestNode.entry.createdAt).fromNow();
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toBe(timeMessage);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toContain('ago');
});
it('[C280129] - Gallery Card show details - subfolder gallery displayed', () => {

View File

@@ -286,8 +286,13 @@ describe('Search component - Search Page', () => {
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFolder);
searchResultPage.deleteContent(search.no_permission.noPermFolder);
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFolder);
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
searchResultPage.closeActionButton();
searchDialog.checkSearchBarIsNotVisible()
.checkSearchIconIsVisible()
.clickOnSearchIcon()
.enterTextAndPressEnter(search.no_permission.noPermFolder);
searchResultPage.checkNoResultMessageIsNotDisplayed();
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFolder);
});

View File

@@ -72,14 +72,13 @@ describe('User Info component', () => {
await this.alfrescoJsApi.core.peopleApi.addPerson(contentUserModel);
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcmBpm();
loginPage.login(contentUserModel.id, contentUserModel.password);
done();
});
it('1. Enable Process Services and Content Services ', () => {
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcmBpm();
loginPage.login(contentUserModel.id, contentUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.dialogIsDisplayed().contentServicesTabIsDisplayed().processServicesTabIsDisplayed();
expect(userInfoDialog.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
@@ -108,9 +107,10 @@ describe('User Info component', () => {
});
it('2. Enable Content Services and disable Process Services ', () => {
navigationBarPage.clickLoginButton();
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcm();
loginPage.login(contentUserModel.id, contentUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.dialogIsDisplayed().contentServicesTabIsNotDisplayed().processServicesTabIsNotDisplayed();
expect(userInfoDialog.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
@@ -124,10 +124,8 @@ describe('User Info component', () => {
});
it('3. Enable Process Services and disable Content Services ', () => {
navigationBarPage.clickLoginButton();
loginPage.goToLoginPage();
adfSettingsPage.setProviderBpm();
loginPage.login(processUserModel.email, processUserModel.password);
navigationBarPage.clickUserProfile();
@@ -144,30 +142,28 @@ describe('User Info component', () => {
userInfoDialog.closeUserProfile();
});
it('4. Enable Process Services and Content Services ', () => {
let flow = protractor.promise.controlFlow();
flow.execute(() => {
PeopleAPI.updateAvatarViaAPI(contentUserModel, acsAvatarFileModel, '-me-');
PeopleAPI.getAvatarViaAPI(4, contentUserModel, '-me-', function (result) {
});
it('4. Enable Process Services and Content Services ', async(done) => {
browser.controlFlow().execute(async() => {
await PeopleAPI.updateAvatarViaAPI(contentUserModel, acsAvatarFileModel, '-me-');
await PeopleAPI.getAvatarViaAPI(4, contentUserModel, '-me-', function (result) {});
});
navigationBarPage.clickLoginButton();
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcm();
loginPage.login(contentUserModel.id, contentUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.checkACSProfileImage();
userInfoDialog.APSProfileImageNotDisplayed();
userInfoDialog.closeUserProfile();
done();
});
it('5. The profile picture is changed from APS', async () => {
let users = new UsersActions();
navigationBarPage.clickLoginButton();
await this.alfrescoJsApi.login(contentUserModel.email, contentUserModel.password);
await users.changeProfilePictureAps(this.alfrescoJsApi, apsAvatarFileModel.getLocation());
loginPage.goToLoginPage();
adfSettingsPage.setProviderBpm();
loginPage.login(processUserModel.email, processUserModel.password);
navigationBarPage.clickUserProfile();
@@ -178,8 +174,8 @@ describe('User Info component', () => {
});
it('6. Delete the profile picture from ACS', () => {
navigationBarPage.clickLoginButton();
PeopleAPI.deleteAvatarViaAPI(contentUserModel, '-me-');
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcm();
loginPage.login(contentUserModel.id, contentUserModel.password);
navigationBarPage.clickUserProfile();

View File

@@ -21,7 +21,7 @@ import Util = require('../../util/util');
export class ConfigEditorPage {
enterMetadataConfiguration(text) {
let textField = element(by.css('#adf-metadata-editor > div > div > div.overflow-guard > textarea'));
let textField = element(by.css('#adf-metadata-editor div.overflow-guard > textarea'));
browser.driver.sleep(1000);
Util.waitUntilElementIsVisible(textField);
textField.sendKeys('');

View File

@@ -136,7 +136,7 @@ var MetadataViewPage = function () {
};
this.clickOnPropertiesTab = function () {
var propertiesTab = element(by.cssContainingText("div[class='mat-tab-labels'] div", "Properties"));
var propertiesTab = element(by.cssContainingText(".adf-info-drawer-layout-content div.mat-tab-labels div", "Properties"));
Util.waitUntilElementIsVisible(propertiesTab);
propertiesTab.click();
return this;

View File

@@ -27,7 +27,7 @@ var NotificationPage = function () {
var actionToggle = element(by.css("mat-slide-toggle[data-automation-id='notification-action-toggle']"));
var notificationSnackBar = element.all(by.css("simple-snack-bar")).first();
var actionOutput = element(by.css("div[data-automation-id='notification-action-output']"));
var actionButton = element(by.css("simple-snack-bar > button"));
var actionButton = element(by.css("simple-snack-bar > div > button"));
var defaultNotificationButton = element(by.css("button[data-automation-id='notification-default-button']"));
var customNotificationButton = element(by.css("button[data-automation-id='notification-custom-config-button']"));
var selectionDropDown = element.all(by.css("div[class*='mat-select-content']")).first();

View File

@@ -35,7 +35,7 @@ var TasksPage = function () {
var completeButtonNoForm = element(by.id("adf-no-form-complete-button"));
var checklistDialog = element(by.id("checklist-dialog"));
var checklistNoMessage = element(by.id("checklist-none-message"));
var numberOfChecklists = element(by.css("mat-chip-list[id='checklist-label'] mat-chip"));
var numberOfChecklists = element(by.css("[data-automation-id='checklist-label'] mat-chip"));
this.createNewTask = function () {
this.createButtonIsDisplayed();

View File

@@ -29,6 +29,14 @@ var SearchResultsPage = function () {
var sortDropdownLocator = by.css("mat-option span");
var sortingArrow = element(by.css("adf-sorting-picker div[class='mat-select-arrow']"));
this.closeActionButton = function () {
let container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing'));
Util.waitUntilElementIsVisible(container);
container.click();
Util.waitUntilElementIsNotVisible(container);
return this;
}
this.checkContentIsDisplayed = function (content) {
contentList.checkContentIsDisplayed(content);
return this;

View File

@@ -185,7 +185,10 @@ export class VersionManagePage {
}
closeActionButton() {
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
let container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing'));
Util.waitUntilElementIsVisible(container);
container.click();
Util.waitUntilElementIsNotVisible(container);
return this;
}

View File

@@ -102,7 +102,7 @@ describe('Comment component for Processes', () => {
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')');
expect(commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
expect(commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
expect(commentsPage.getTime(0)).toContain('ago');
});
});
@@ -152,7 +152,7 @@ describe('Comment component for Processes', () => {
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
expect(commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
expect(commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
expect(commentsPage.getTime(0)).toContain('ago');
});
});
});

View File

@@ -144,8 +144,8 @@ describe('Comment component for Processes', () => {
await expect(commentsPage.getUserName(0)).toEqual(totalComments.data[0].createdBy.firstName + ' ' + totalComments.data[0].createdBy.lastName);
await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName);
await expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
await expect(commentsPage.getTime(1)).toEqual('a few seconds ago');
await expect(commentsPage.getTime(0)).toContain('ago');
await expect(commentsPage.getTime(1)).toContain('ago');
await loginPage.loginToProcessServicesUsingUserModel(secondUser);
@@ -175,9 +175,9 @@ describe('Comment component for Processes', () => {
await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName);
await expect(commentsPage.getUserName(2)).toEqual(totalComments.data[2].createdBy.firstName + ' ' + totalComments.data[2].createdBy.lastName);
await expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
await expect(commentsPage.getTime(1)).toEqual('a few seconds ago');
await expect(commentsPage.getTime(2)).toEqual('a few seconds ago');
await expect(commentsPage.getTime(0)).toContain('ago');
await expect(commentsPage.getTime(1)).toContain('ago');
await expect(commentsPage.getTime(2)).toContain('ago');
});
});
});

View File

@@ -27,7 +27,7 @@ var APIUtils = function () {
* @returns Basic authorization
*/
this.getAuthorization = function (user, password) {
return 'Basic ' + Buffer(user + ':' + password).toString('base64');
return 'Basic ' + Buffer.from(user + ':' + password).toString('base64');
};
/**