* fix protractor conf

* remove update env

* fix cli error script cs

* change screenshot plugin

* remove unused param

* fix

* fix

* fix

* moment comment nvm

* fix

* fix

* fix

* fix

* remove adf redirect

* fix

* fix

* save remote report

* report fix

* improve save result

* fix folder save

* fix folder save

* fix placeholder pointer , they needs refactor later

* fix

* fix lint

* fix

* remove test already covered by unit
fix the test in core needed
exclude the one impossible to make it works without APS basic support

* lint

* fix some logout missing

* fix

* Fix the custom-tasks-filters.e2e

* fix lint

* fix

* fix

* fix

* Fix wait on start process  and on process definition options

* Fix logout before login again

* fix uplaod test

* fix

* Fix infodrawer with check detail and sleep

* lint

* increase list of excluded test

* fix

* fix lint

* change wait method datatable

* fix

* fix

* revert check value

* fix

* fix

* change tag test

Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com>
This commit is contained in:
Eugenio Romano
2020-09-04 13:27:55 +01:00
committed by GitHub
parent f17270621b
commit a630cfb390
132 changed files with 1109 additions and 1850 deletions

View File

@@ -121,6 +121,7 @@ describe('Enable infinite scrolling', () => {
await contentServicesPage.doubleClickRow(folderModel.name);
await contentServicesPage.enableInfiniteScrolling();
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(pageSize);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);

View File

@@ -53,6 +53,8 @@ describe('Login component', () => {
const usersActions = new UsersActions(apiService);
beforeAll(async () => {
await LocalStorageUtil.setStorageItem('authType', 'BASIC');
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await usersActions.createUser(userA);

View File

@@ -1,170 +0,0 @@
/*!
* @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 { browser } from 'protractor';
import {
ApiService,
LocalStorageUtil,
SettingsPage,
StringUtil,
UploadActions,
UsersActions
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { ProcessServicesPage } from '../../process-services/pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { LogoutPage } from '../../core/pages/logout.page';
import { LoginShellPage } from '../../core/pages/login-shell.page';
describe('Login component - Redirect', () => {
const settingsPage = new SettingsPage();
const processServicesPage = new ProcessServicesPage();
const navigationBarPage = new NavigationBarPage();
const contentServicesPage = new ContentServicesPage();
const loginPage = new LoginShellPage();
const logoutPage = new LogoutPage();
let user;
let uploadedFolder;
const apiService = new ApiService();
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);
beforeAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
user = await usersActions.createUser();
await apiService.getInstance().login(user.email, user.password);
uploadedFolder = await uploadActions.createFolder('protecteFolder' + StringUtil.generateRandomString(), '-my-');
});
it('[C213838] Should after login in CS be redirect to Login page when try to access to PS', async () => {
await LocalStorageUtil.setStorageItem('providers', 'ECM');
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcm();
await loginPage.login(user.email, user.password);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await navigationBarPage.navigateToProcessServicesPage();
await loginPage.waitForElements();
});
it('[C260085] Should after login in PS be redirect to Login page when try to access to CS', async () => {
await LocalStorageUtil.setStorageItem('providers', 'BPM');
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderBpm();
await loginPage.enableSuccessRouteSwitch();
await loginPage.enterSuccessRoute('activiti');
await loginPage.login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await navigationBarPage.clickContentServicesButton();
await loginPage.waitForElements();
});
it('[C260081] Should after login in BOTH not be redirect to Login page when try to access to CS or PS', async () => {
await LocalStorageUtil.setStorageItem('providers', 'ALL');
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await loginPage.login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
});
it('[C260088] Should be re-redirect to the request URL after login when try to access to a protect URL ', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcm();
await loginPage.login(user.email, user.password);
await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
let actualUrl = await browser.getCurrentUrl();
await expect(actualUrl).toEqual(browser.baseUrl + '/files/' + uploadedFolder.entry.id);
await contentServicesPage.waitForTableBody();
await navigationBarPage.clickLogoutButton();
await logoutPage.checkLogoutSectionIsDisplayed();
await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
await loginPage.waitForElements();
await loginPage.login(user.email, user.password);
actualUrl = await browser.getCurrentUrl();
await expect(actualUrl).toEqual(browser.baseUrl + '/files/' + uploadedFolder.entry.id);
});
it('[C299161] Should redirect user to requested URL after reloading login page', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcm();
await loginPage.login(user.email, user.password);
await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
const currentUrl = await browser.getCurrentUrl();
await expect(currentUrl).toEqual(browser.baseUrl + '/files/' + uploadedFolder.entry.id);
await contentServicesPage.waitForTableBody();
await navigationBarPage.clickLogoutButton();
await logoutPage.checkLogoutSectionIsDisplayed();
await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
await loginPage.waitForElements();
await browser.refresh();
await loginPage.waitForElements();
await loginPage.enterUsername(user.email);
await loginPage.enterPassword(user.password);
await loginPage.clickSignInButton();
await navigationBarPage.checkMenuButtonIsDisplayed();
const actualUrl = await browser.getCurrentUrl();
await expect(actualUrl).toEqual(browser.baseUrl + '/files/' + uploadedFolder.entry.id);
});
});

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { SettingsPage } from '@alfresco/adf-testing';
import { SettingsPage, LocalStorageUtil } from '@alfresco/adf-testing';
import { LoginShellPage } from '../../core/pages/login-shell.page';
describe('Login component - Remember Me', () => {
@@ -24,6 +24,8 @@ describe('Login component - Remember Me', () => {
const loginPage = new LoginShellPage();
beforeAll(async () => {
await LocalStorageUtil.setStorageItem('authType', 'BASIC');
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();

View File

@@ -16,7 +16,7 @@
*/
import { DropActions, BrowserActions, BrowserVisibility, DateUtil, DocumentListPage, TogglePage, DropdownPage } from '@alfresco/adf-testing';
import { $$, browser, by, element, ElementFinder, protractor } from 'protractor';
import { Locator, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
import { FolderDialogPage } from './dialog/folder-dialog.page';
import { NavigationBarPage } from './navigation-bar.page';
@@ -47,7 +47,7 @@ export class ContentServicesPage {
deleteNodesButton = element(by.css('button[data-automation-id="delete-toolbar-button"]'));
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
activeBreadcrumb = element(by.css('div[class*="active"]'));
tooltip = by.css('div[class*="--text adf-full-width"] span');
tooltip: Locator = by.css('div[class*="--text adf-full-width"] span');
uploadFileButton = element(by.css('.adf-upload-button-file-container button'));
uploadFileButtonInput = element(by.css('input[data-automation-id="upload-single-file"]'));
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by, browser, ElementFinder } from 'protractor';
import { element, by, browser, ElementFinder, Locator } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class UploadDialogPage {
@@ -23,9 +23,9 @@ export class UploadDialogPage {
closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
dialog = element(by.css('div[id="upload-dialog"]'));
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
uploadedStatusIcon = by.css('mat-icon[class*="status--done"]');
cancelledStatusIcon = by.css('div[class*="status--cancelled"]');
errorStatusIcon = by.css('div[class*="status--error"] mat-icon');
uploadedStatusIcon: Locator = by.css('mat-icon[class*="status--done"]');
cancelledStatusIcon: Locator = by.css('div[class*="status--cancelled"]');
errorStatusIcon: Locator = by.css('div[class*="status--error"] mat-icon');
errorTooltip = element(by.css('div.mat-tooltip'));
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
title = element(by.css('span[class*="upload-dialog__title"]'));
@@ -63,14 +63,15 @@ export class UploadDialogPage {
return element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first();
}
getRowByRowName(content: string) {
async getRowByRowName(content: string): Promise<ElementFinder> {
const rows = this.getRowsByName(content);
await BrowserVisibility.waitUntilElementIsVisible(rows);
return rows.element(this.rowByRowName);
}
async fileIsUploaded(content: string): Promise<void> {
const row = await this.getRowByRowName(content);
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon), 60000);
}
async fileIsError(content: string) {
@@ -102,6 +103,7 @@ export class UploadDialogPage {
async fileIsCancelled(content: string): Promise<void> {
const row = await this.getRowByRowName(content);
await BrowserVisibility.waitUntilElementIsVisible(row);
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000);
}
@@ -110,7 +112,6 @@ export class UploadDialogPage {
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
const elementRow = await this.getRowByRowName(content);
await BrowserActions.click(elementRow.element(this.uploadedStatusIcon));
}
async getTitleText(): Promise<string> {

View File

@@ -1,129 +0,0 @@
/*!
* @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 { element, by, protractor } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class HeaderPage {
checkBox = element(by.cssContainingText('.mat-checkbox-label', 'Show menu button'));
headerColor = element(by.css('option[value="primary"]'));
titleInput = element(by.css('input[name="title"]'));
iconInput = element(by.css('input[placeholder="URL path"]'));
hexColorInput = element(by.css('input[placeholder="hex color code"]'));
logoHyperlinkInput = element(by.css('input[placeholder="Redirect URL"]'));
logoTooltipInput = element(by.css('input[placeholder="Tooltip text"]'));
positionStart = element.all(by.css('mat-radio-button[value="start"]')).first();
positionEnd = element.all(by.css('mat-radio-button[value="end"]')).first();
sideBarPositionRight = element(by.css('mat-sidenav.mat-drawer.mat-sidenav.mat-drawer-end'));
sideBarPositionLeft = element(by.css('mat-sidenav.mat-drawer.mat-sidenav'));
async checkShowMenuCheckBoxIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.checkBox);
}
async checkChooseHeaderColourIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.headerColor);
}
async checkChangeTitleIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.titleInput);
}
async checkChangeUrlPathIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.iconInput);
}
async clickShowMenuButton(): Promise<void> {
const checkBox = element(by.css('mat-checkbox'));
await BrowserActions.click(checkBox.get(0));
}
async changeHeaderColor(color: string): Promise<void> {
const headerColor = element(by.css('option[value="' + color + '"]'));
await BrowserActions.click(headerColor);
}
async checkAppTitle(name: string): Promise<void> {
const title = element(by.cssContainingText('.adf-app-title', name));
await BrowserVisibility.waitUntilElementIsVisible(title);
}
async addTitle(title: string): Promise<void> {
await BrowserActions.click(this.titleInput);
await BrowserActions.clearSendKeys(this.titleInput, title);
await this.titleInput.sendKeys(protractor.Key.ENTER);
}
async checkIconIsDisplayed(url: string): Promise<void> {
const icon = element(by.css('img[src="' + url + '"]'));
await BrowserVisibility.waitUntilElementIsVisible(icon);
}
async addIcon(url: string): Promise<void> {
await BrowserActions.click(this.iconInput);
await BrowserActions.clearSendKeys(this.iconInput, url);
await this.iconInput.sendKeys(protractor.Key.ENTER);
}
async checkHexColorInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.hexColorInput);
}
async checkLogoHyperlinkInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.logoHyperlinkInput);
}
async checkLogoTooltipInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.logoTooltipInput);
}
async addHexCodeColor(hexCode: string): Promise<void> {
await BrowserActions.click(this.hexColorInput);
await this.hexColorInput.sendKeys(hexCode);
await this.hexColorInput.sendKeys(protractor.Key.ENTER);
}
async addLogoHyperlink(hyperlink: string): Promise<void> {
await BrowserActions.click(this.logoHyperlinkInput);
await this.logoHyperlinkInput.sendKeys(hyperlink);
await this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER);
}
async addLogoTooltip(tooltip: string): Promise<void> {
await BrowserActions.click(this.logoTooltipInput);
await this.logoTooltipInput.sendKeys(tooltip);
await this.logoTooltipInput.sendKeys(protractor.Key.ENTER);
}
async sideBarPositionStart(): Promise<void> {
await BrowserActions.click(this.positionStart);
}
async sideBarPositionEnd(): Promise<void> {
await BrowserActions.click(this.positionEnd);
}
async checkSidebarPositionStart(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionLeft);
}
async checkSidebarPositionEnd(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionRight);
}
}

View File

@@ -22,6 +22,7 @@ export class InfinitePaginationPage {
rootElement: ElementFinder;
loadMoreButton;
loading = element(by.css('[data-automation-id="adf-infinite-pagination-spinner"]'));
constructor(rootElement = element.all(by.css('adf-infinite-pagination')).first()) {
this.rootElement = rootElement;
@@ -30,6 +31,7 @@ export class InfinitePaginationPage {
async clickLoadMoreButton(): Promise<void> {
await BrowserActions.click(this.loadMoreButton);
await BrowserVisibility.waitUntilElementIsNotVisible(this.loading);
}
async checkLoadMoreButtonIsNotDisplayed(): Promise<void> {

View File

@@ -15,14 +15,14 @@
* limitations under the License.
*/
import { by, element, Key, protractor } from 'protractor';
import { Locator, by, element, Key, protractor } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class MetadataViewPage {
title = element(by.css(`div[info-drawer-title]`));
expandedAspect = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`));
aspectTitle = by.css(`mat-panel-title`);
aspectTitle: Locator = by.css(`mat-panel-title`);
name = element(by.css(`[data-automation-id='card-textitem-value-name']`));
creator = element(by.css(`[data-automation-id='card-textitem-value-createdByUser.displayName']`));
createdDate = element(by.css(`span[data-automation-id='card-dateitem-createdAt'] span`));
@@ -43,7 +43,7 @@ export class MetadataViewPage {
presetSwitch = element(by.id('adf-toggle-custom-preset'));
defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties'));
closeButton = element(by.cssContainingText('button.mat-button span', 'Close'));
displayAspect = element(by.css(`input[placeholder='Display Aspect']`));
displayAspect = element(by.css(`input[data-placeholder='Display Aspect']`));
applyAspect = element(by.cssContainingText(`button span.mat-button-wrapper`, 'Apply Aspect'));
saveMetadataButton = element(by.css(`[data-automation-id='save-metadata']`));
resetMetadataButton = element(by.css(`[data-automation-id='reset-metadata']`));

View File

@@ -16,12 +16,12 @@
*/
import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
import { element, by } from 'protractor';
import { Locator, element, by } from 'protractor';
export class TrashcanPage {
contentList = new DocumentListPage(element(by.css('adf-document-list')));
rows = by.css('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
rows: Locator = by.css('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
tableBody = element.all(by.css('adf-document-list .adf-datatable-body')).first();
pagination = element(by.css('adf-pagination'));
emptyTrashcan = element(by.css('adf-empty-content'));

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { BrowserActions, SettingsPage } from '@alfresco/adf-testing';
import { BrowserActions, LocalStorageUtil, SettingsPage } from '@alfresco/adf-testing';
import { browser, protractor } from 'protractor';
import { ContentServicesPage } from '../core/pages/content-services.page';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
@@ -33,6 +33,11 @@ describe('Settings component', () => {
'Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.';
describe('Should be able to change Urls in the Settings', () => {
beforeAll(async () => {
await LocalStorageUtil.setStorageItem('authType', 'BASIC');
await browser.refresh();
});
beforeEach(async () => {
await settingsPage.goToSettingsPage();
});
@@ -94,10 +99,14 @@ describe('Settings component', () => {
describe('Settings Component - Basic Authentication', () => {
beforeAll(async () => {
await LocalStorageUtil.setStorageItem('authType', 'OAUTH');
await browser.refresh();
await settingsPage.goToSettingsPage();
await settingsPage.setProvider('ALL');
await settingsPage.setContentServicesURL(browser.params.testConfig.appConfig.ecmHost);
await settingsPage.setProcessServicesURL(browser.params.testConfig.appConfig.bpmHost);
await settingsPage.setImplicitFlow(false);
await settingsPage.setSilentLogin(false);
await settingsPage.clickApply();
});

View File

@@ -1,173 +0,0 @@
/*!
* @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 { PeopleApi } from '@alfresco/js-api';
import { ApiService, LocalStorageUtil, LoginPage, UserInfoPage, UsersActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { FileModel } from '../models/ACS/file.model';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
import * as path from 'path';
import * as fs from 'fs';
describe('User Info component', () => {
const loginPage = new LoginPage();
const userInfoPage = new UserInfoPage();
const navigationBarPage = new NavigationBarPage();
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const peopleApi: PeopleApi = new PeopleApi(apiService.getInstance());
let user;
const acsAvatarFileModel = new FileModel({
'name': browser.params.resources.Files.PROFILE_IMAGES.ECM.file_name,
'location': browser.params.resources.Files.PROFILE_IMAGES.ECM.file_location
});
const apsAvatarFileModel = new FileModel({
'name': browser.params.resources.Files.PROFILE_IMAGES.BPM.file_name,
'location': browser.params.resources.Files.PROFILE_IMAGES.BPM.file_location
});
beforeAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
user = await usersActions.createUser();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C260111] Should display UserInfo when Process Services and Content Services are enabled', async () => {
await loginPage.login(user.email, user.password);
await userInfoPage.clickUserProfile();
await userInfoPage.dialogIsDisplayed();
await userInfoPage.checkContentServicesTabIsSelected();
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(user.firstName + ' ' + user.lastName);
await expect(await userInfoPage.getContentTitle()).toEqual(user.firstName + ' ' + user.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(user.email);
await expect(await userInfoPage.getContentJobTitle()).toEqual('N/A');
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.clickOnProcessServicesTab();
await userInfoPage.checkProcessServicesTabIsSelected();
await browser.sleep(1000);
await expect(await userInfoPage.getProcessHeaderTitle()).toEqual(user.firstName + ' ' + user.lastName);
await expect(await userInfoPage.getProcessTitle()).toEqual(user.firstName + ' ' + user.lastName);
await expect(await userInfoPage.getProcessEmail()).toEqual(user.email);
await userInfoPage.closeUserProfile();
});
it('[C260113] Should display UserInfo when Content Services is enabled and Process Services is disabled', async () => {
await loginPage.login(user.email, user.password);
await userInfoPage.clickUserProfile();
await userInfoPage.dialogIsDisplayed();
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(user.firstName + ' ' + user.lastName);
await expect(await userInfoPage.getContentTitle()).toEqual(user.firstName + ' ' + user.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(user.email);
await expect(await userInfoPage.getContentJobTitle()).toEqual('N/A');
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
await userInfoPage.dialogIsNotDisplayed();
});
it('[C260115] Should display UserInfo when Process Services is enabled and Content Services is disabled', async () => {
await LocalStorageUtil.setStorageItem('providers', 'BPM');
await loginPage.login(user.email, user.password);
await userInfoPage.clickUserProfile();
await userInfoPage.dialogIsDisplayed();
await expect(await userInfoPage.getProcessHeaderTitle()).toEqual(user.firstName + ' ' + user.lastName);
await expect(await userInfoPage.getProcessTitle()).toEqual(user.firstName + ' ' + user.lastName);
await expect(await userInfoPage.getProcessEmail()).toEqual(user.email);
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
it('[C260117] Should display UserInfo with profile image uploaded in ACS', async () => {
await LocalStorageUtil.setStorageItem('providers', 'ECM');
await updateAvatarACS();
await loginPage.login(user.email, user.password);
await userInfoPage.clickUserProfile();
await userInfoPage.checkACSProfileImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
it('[C260118] Should display UserInfo with profile image uploaded in APS', async () => {
await LocalStorageUtil.setStorageItem('providers', 'BPM');
const users = new UsersActions(apiService);
await apiService.getInstance().login(user.email, user.password);
await users.changeProfilePictureAps(apsAvatarFileModel.getLocation());
await loginPage.login(user.email, user.password);
await userInfoPage.clickUserProfile();
await userInfoPage.checkAPSProfileImage();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.initialImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
it('[C260120] Should not display profile image in UserInfo when deleted in ACS', async () => {
await LocalStorageUtil.setStorageItem('providers', 'ECM');
await peopleApi.deleteAvatarImage(user.email);
await loginPage.login(user.email, user.password);
await userInfoPage.clickUserProfile();
await userInfoPage.checkInitialImage();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
const updateAvatarACS = async function () {
await apiService.getInstance().login(user.email, user.password);
const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, acsAvatarFileModel.getLocation()));
const file: any = fs.readFileSync(absolutePath);
await peopleApi.updateAvatarImage('-me-', file);
};
});

View File

@@ -17,7 +17,7 @@
import { browser } from 'protractor';
import {
ApiService,
ApiService, LocalStorageUtil,
LoginPage,
StringUtil,
UploadActions,
@@ -38,7 +38,7 @@ describe('Viewer', () => {
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const apiService = new ApiService();
const apiService = new ApiService({ authType: 'ECM', provider: 'ECM' });
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);
@@ -57,6 +57,9 @@ describe('Viewer', () => {
});
beforeAll(async () => {
await LocalStorageUtil.setStorageItem('providers', 'ECM');
await LocalStorageUtil.setStorageItem('authType', 'BASIC');
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await usersActions.createUser(acsUser);

View File

@@ -1,103 +0,0 @@
/*!
* @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 { browser } from 'protractor';
import {
ApiService,
LoginPage,
StringUtil,
UploadActions,
UserModel,
UsersActions,
ViewerPage
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { FileModel } from '../../models/ACS/file.model';
import CONSTANTS = require('../../util/constants');
describe('Info Drawer', () => {
const viewerPage = new ViewerPage();
const navigationBarPage = new NavigationBarPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
let site;
const acsUser = new UserModel();
let pngFileUploaded;
const pngFileInfo = new FileModel({
'name': browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
beforeAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await usersActions.createUser(acsUser);
site = await apiService.getInstance().core.sitesApi.createSite({
title: StringUtil.generateRandomString(8),
visibility: 'PUBLIC'
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.getInstance().login(acsUser.email, acsUser.password);
pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, site.entry.guid);
});
afterAll(async () => {
await apiService.getInstance().login(acsUser.email, acsUser.password);
await uploadActions.deleteFileOrFolder(pngFileUploaded.entry.id);
await apiService.getInstance().core.sitesApi.deleteSite(site.entry.id, { permanent: true });
});
beforeEach(async() => {
await loginPage.login(acsUser.email, acsUser.password);
await navigationBarPage.goToSite(site);
await contentServicesPage.checkAcsContainer();
});
it('[C277251] Should display the icon when the icon property is defined', async () => {
await viewerPage.viewFile(pngFileUploaded.entry.name);
await viewerPage.clickLeftSidebarButton();
await viewerPage.enableShowTabWithIcon();
await viewerPage.enableShowTabWithIconAndLabel();
await viewerPage.checkTabHasNoIcon(0);
await expect(await viewerPage.getTabIconById(1)).toBe('face');
await expect(await viewerPage.getTabIconById(2)).toBe('comment');
});
it('[C277252] Should display the label when the label property is defined', async () => {
await viewerPage.viewFile(pngFileUploaded.entry.name);
await viewerPage.clickLeftSidebarButton();
await viewerPage.enableShowTabWithIcon();
await viewerPage.enableShowTabWithIconAndLabel();
await expect(await viewerPage.getTabLabelById(0)).toBe('SETTINGS');
await viewerPage.checkTabHasNoLabel(1);
await expect(await viewerPage.getTabLabelById(2)).toBe('COMMENTS');
});
});