mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3351] angular 7 (#3956)
* upgrade Angular CLI * upgrade material and fix breaking changes * upgrade lib dependencies * upgrade i18n * update test * disable flaky tests * try fix notification test * update package-lock * code and dependency fixes * card view e2e fixes * udpate e2e tests * fix e2e utils * updated e2e typings * test fixes * notification fixes * update tests
This commit is contained in:
committed by
Eugenio Romano
parent
811a3f1f7d
commit
220930d27b
@@ -32,6 +32,7 @@ import resources = require('../../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { check } from '../../util/material';
|
||||
|
||||
describe('Aspect oriented config', () => {
|
||||
|
||||
@@ -272,7 +273,7 @@ describe('Aspect oriented config', () => {
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
metadataViewPage.clickOnPropertiesTab();
|
||||
|
||||
metadataViewPage.enablePreset();
|
||||
check(metadataViewPage.presetSwitch);
|
||||
|
||||
metadataViewPage.enterPresetText('custom-preset');
|
||||
|
||||
|
@@ -22,10 +22,6 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { CardViewComponentPage } from '../../pages/adf/cardViewComponentPage';
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
@@ -35,27 +31,8 @@ describe('CardView Component', () => {
|
||||
const cardViewPageComponent = new CardViewComponentPage();
|
||||
const metadataViewPage = new MetadataViewPage();
|
||||
|
||||
const app = resources.Files.APP_WITH_PROCESSES;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
const apps = new AppsActions();
|
||||
const users = new UsersActions();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
let user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
|
||||
await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
loginPage.loginToContentServices(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
navigationBarPage.clickCardViewButton();
|
||||
|
||||
done();
|
||||
|
@@ -28,6 +28,7 @@ import resources = require('../../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { check, uncheck } from '../../util/material';
|
||||
|
||||
describe('CardView Component - properties', () => {
|
||||
|
||||
@@ -104,7 +105,7 @@ describe('CardView Component - properties', () => {
|
||||
metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
|
||||
metadataViewPage.checkPropertyIsNotVisible('properties.exif:model', 'textitem');
|
||||
|
||||
metadataViewPage.enableDisplayEmpty();
|
||||
check(metadataViewPage.displayEmptySwitch);
|
||||
|
||||
metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
|
||||
metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
|
||||
@@ -117,7 +118,7 @@ describe('CardView Component - properties', () => {
|
||||
metadataViewPage.clickOnPropertiesTab();
|
||||
metadataViewPage.editIconIsDisplayed();
|
||||
|
||||
metadataViewPage.enableReadonly();
|
||||
check(metadataViewPage.readonlySwitch);
|
||||
|
||||
metadataViewPage.editIconIsNotDisplayed();
|
||||
});
|
||||
@@ -143,7 +144,7 @@ describe('CardView Component - properties', () => {
|
||||
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
|
||||
metadataViewPage.checkMetadataGroupIsNotExpand('properties');
|
||||
|
||||
metadataViewPage.enableMulti();
|
||||
check(metadataViewPage.multiSwitch);
|
||||
|
||||
metadataViewPage.clickMetadataGroup('properties');
|
||||
|
||||
@@ -158,13 +159,13 @@ describe('CardView Component - properties', () => {
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
metadataViewPage.clickOnPropertiesTab();
|
||||
|
||||
metadataViewPage.disabledDefaultProperties();
|
||||
uncheck(metadataViewPage.defaultPropertiesSwitch);
|
||||
|
||||
metadataViewPage.checkMetadataGroupIsNotPresent('properties');
|
||||
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
|
||||
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
|
||||
|
||||
metadataViewPage.enabledDefaultProperties();
|
||||
check(metadataViewPage.defaultPropertiesSwitch);
|
||||
|
||||
metadataViewPage.checkMetadataGroupIsPresent('properties');
|
||||
metadataViewPage.checkMetadataGroupIsExpand('properties');
|
||||
@@ -178,7 +179,7 @@ describe('CardView Component - properties', () => {
|
||||
|
||||
metadataViewPage.informationButtonIsDisplayed();
|
||||
|
||||
metadataViewPage.disabledDefaultProperties();
|
||||
uncheck(metadataViewPage.defaultPropertiesSwitch);
|
||||
|
||||
metadataViewPage.informationButtonIsNotDisplayed();
|
||||
});
|
||||
|
@@ -165,9 +165,9 @@ describe('Metadata component', () => {
|
||||
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
|
||||
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
|
||||
|
||||
expect(metadataViewPage.getPropertyIconTooltip('name', 'edit')).toEqual('Edit');
|
||||
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:title', 'edit')).toEqual('Edit');
|
||||
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:description', 'edit')).toEqual('Edit');
|
||||
expect(metadataViewPage.getPropertyIconTooltip('name')).toEqual('Edit');
|
||||
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:title')).toEqual('Edit');
|
||||
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:description')).toEqual('Edit');
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.updatePropertyIconIsDisplayed('name');
|
||||
|
@@ -34,10 +34,10 @@ export class FileModel {
|
||||
secondPageText = resources.Files.ADF_DOCUMENTS.PDF.second_page_text;
|
||||
lastPageNumber = resources.Files.ADF_DOCUMENTS.PDF.last_page_number;
|
||||
createdAt = '';
|
||||
createdByUser = {};
|
||||
modifiedByUser = {};
|
||||
content = {};
|
||||
properties = {};
|
||||
createdByUser = new CreatedByModel();
|
||||
modifiedByUser = new CreatedByModel();
|
||||
content: ContentModel = {};
|
||||
properties: ContentPropertiesModel = {};
|
||||
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
@@ -89,19 +89,19 @@ export class FileModel {
|
||||
return this.lastPageNumber;
|
||||
}
|
||||
|
||||
getCreatedByUser() {
|
||||
getCreatedByUser(): CreatedByModel {
|
||||
return this.createdByUser;
|
||||
}
|
||||
|
||||
getModifiedByUser() {
|
||||
getModifiedByUser(): CreatedByModel {
|
||||
return this.modifiedByUser;
|
||||
}
|
||||
|
||||
getContent() {
|
||||
getContent(): ContentModel {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
getProperties() {
|
||||
getProperties(): ContentPropertiesModel {
|
||||
return this.properties;
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,7 @@ export class CardViewComponentPage {
|
||||
checkbox = element(by.css(`mat-checkbox[data-automation-id='card-boolean-boolean']`));
|
||||
resetButton = element(by.css(`#adf-reset-card-log`));
|
||||
selectedValue = element(by.css('.mat-select-value-text span'));
|
||||
listContent = element(by.className('mat-select-content'));
|
||||
listContent = element(by.css('.mat-select-panel'));
|
||||
editableSwitch = element(by.id('adf-toggle-editable'));
|
||||
|
||||
clickOnAddButton() {
|
||||
@@ -214,8 +214,8 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
selectValueFromComboBox(index) {
|
||||
this.getMatSelectValue(index).click();
|
||||
Util.waitUntilElementIsVisible(this.consoleLog);
|
||||
const value = this.getMatSelectValue(index).click();
|
||||
Util.waitUntilElementIsVisible(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -225,10 +225,11 @@ export class CardViewComponentPage {
|
||||
|
||||
disableEdit() {
|
||||
Util.waitUntilElementIsVisible(this.editableSwitch);
|
||||
|
||||
this.editableSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
if (check.indexOf('mat-checked') > -1) {
|
||||
this.editableSwitch.click();
|
||||
expect(this.editableSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
expect(this.editableSwitch.getAttribute('class')).not.toContain('mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -36,9 +36,9 @@ export class TaskListDemoPage {
|
||||
dueAfter = element(by.css("input[data-automation-id='due after']"));
|
||||
taskId = element(by.css("input[data-automation-id='task id']"));
|
||||
stateDropDownArrow = element(by.css("mat-form-field[data-automation-id='state'] div[class*='arrow']"));
|
||||
stateSelector = element(by.css("div[class*='mat-select-content']"));
|
||||
stateSelector = element(by.css("div[class*='mat-select-panel']"));
|
||||
sortDropDownArrow = element(by.css("mat-form-field[data-automation-id='sort'] div[class*='arrow']"));
|
||||
sortSelector = element(by.css("div[class*='mat-select-content']"));
|
||||
sortSelector = element(by.css("div[class*='mat-select-panel']"));
|
||||
processDefinitionIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Process Definition Id'] span");
|
||||
processInstanceIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='a" +
|
||||
"df-datatable-row'] div[title='Process Instance Id'] span");
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class ContentListPage {
|
||||
@@ -333,22 +333,6 @@ export class ContentListPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
tableIsLoaded() {
|
||||
Util.waitUntilElementIsVisible(this.table);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkIconColumn(file, extension) {
|
||||
let row = this.getRowByRowName(file);
|
||||
Util.waitUntilElementIsVisible(row.element(by.css(`div[class*='--image'] img[alt*="${extension}"]`)));
|
||||
}
|
||||
|
||||
rightClickOnRowNamed(rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||
Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||
}
|
||||
|
||||
checkContextActionIsVisible(actionName) {
|
||||
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
Util.waitUntilElementIsVisible(actionButton);
|
||||
@@ -389,17 +373,6 @@ export class ContentListPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
getNodeIdByFilename(filename) {
|
||||
let nodeIdColumn = element.all(by.xpath(`//div[@id='document-list-container']//div[@filename="${filename}" and @title='Node id']`));
|
||||
let text = nodeIdColumn.getText();
|
||||
return text;
|
||||
}
|
||||
|
||||
checkEmptyFolderMessageIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.emptyFolderMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
tableIsLoaded() {
|
||||
Util.waitUntilElementIsVisible(this.table);
|
||||
return this;
|
||||
@@ -415,40 +388,4 @@ export class ContentListPage {
|
||||
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||
Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||
}
|
||||
|
||||
checkContextActionIsVisible(actionName) {
|
||||
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
Util.waitUntilElementIsVisible(actionButton);
|
||||
Util.waitUntilElementIsClickable(actionButton);
|
||||
return actionButton;
|
||||
}
|
||||
|
||||
pressContextMenuActionNamed(actionName) {
|
||||
let actionButton = this.checkContextActionIsVisible(actionName);
|
||||
actionButton.click();
|
||||
}
|
||||
|
||||
clickRowToSelect(rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
||||
this.checkRowIsSelected(rowName);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkLockedIcon(content) {
|
||||
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkUnlockedIcon(content) {
|
||||
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock_open'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
waitForTableBody() {
|
||||
Util.waitUntilElementIsVisible(this.tableBody);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Util } from '../../util/util';
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { browser, by, element, promise } from 'protractor';
|
||||
|
||||
export class MetadataViewPage {
|
||||
|
||||
@@ -44,75 +44,75 @@ export class MetadataViewPage {
|
||||
presetSwitch = element(by.id('adf-toggle-custom-preset'));
|
||||
defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties'));
|
||||
|
||||
getTitle() {
|
||||
getTitle(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.title);
|
||||
return this.title.getText();
|
||||
}
|
||||
|
||||
getExpandedAspectName() {
|
||||
getExpandedAspectName(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.expandedAspect);
|
||||
return this.expandedAspect.element(this.aspectTitle).getText();
|
||||
}
|
||||
|
||||
getName() {
|
||||
getName(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.name);
|
||||
return this.name.getText();
|
||||
}
|
||||
|
||||
getCreator() {
|
||||
getCreator(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.creator);
|
||||
return this.creator.getText();
|
||||
}
|
||||
|
||||
getCreatedDate() {
|
||||
getCreatedDate(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.createdDate);
|
||||
return this.createdDate.getText();
|
||||
}
|
||||
|
||||
getModifier() {
|
||||
getModifier(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.modifier);
|
||||
return this.modifier.getText();
|
||||
}
|
||||
|
||||
getModifiedDate() {
|
||||
getModifiedDate(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.modifiedDate);
|
||||
return this.modifiedDate.getText();
|
||||
}
|
||||
|
||||
getMimetypeName() {
|
||||
getMimetypeName(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.mimetypeName);
|
||||
return this.mimetypeName.getText();
|
||||
}
|
||||
|
||||
getSize() {
|
||||
getSize(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.size);
|
||||
return this.size.getText();
|
||||
}
|
||||
|
||||
getDescription() {
|
||||
getDescription(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.description);
|
||||
return this.description.getText();
|
||||
}
|
||||
|
||||
getAuthor() {
|
||||
getAuthor(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.author);
|
||||
return this.author.getText();
|
||||
}
|
||||
|
||||
getTitleProperty() {
|
||||
getTitleProperty(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.titleProperty);
|
||||
return this.titleProperty.getText();
|
||||
}
|
||||
|
||||
editIconIsDisplayed() {
|
||||
editIconIsDisplayed(): promise.Promise<boolean> {
|
||||
return Util.waitUntilElementIsVisible(this.editIcon);
|
||||
}
|
||||
|
||||
editIconIsNotDisplayed() {
|
||||
editIconIsNotDisplayed(): promise.Promise<any> {
|
||||
return Util.waitUntilElementIsNotVisible(this.editIcon);
|
||||
}
|
||||
|
||||
editIconClick() {
|
||||
editIconClick(): promise.Promise<void> {
|
||||
Util.waitUntilElementIsVisible(this.editIcon);
|
||||
return this.editIcon.click();
|
||||
}
|
||||
@@ -126,67 +126,67 @@ export class MetadataViewPage {
|
||||
Util.waitUntilElementIsNotVisible(this.informationButton);
|
||||
}
|
||||
|
||||
clickOnInformationButton() {
|
||||
clickOnInformationButton(): MetadataViewPage {
|
||||
this.informationButtonIsDisplayed();
|
||||
browser.sleep(600);
|
||||
this.informationButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
getInformationButtonText() {
|
||||
getInformationButtonText(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.informationSpan);
|
||||
return this.informationSpan.getText();
|
||||
}
|
||||
|
||||
getInformationIconText() {
|
||||
getInformationIconText(): promise.Promise<string> {
|
||||
Util.waitUntilElementIsVisible(this.informationIcon);
|
||||
return this.informationIcon.getText();
|
||||
}
|
||||
|
||||
clickOnPropertiesTab() {
|
||||
clickOnPropertiesTab(): MetadataViewPage {
|
||||
let propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`));
|
||||
Util.waitUntilElementIsVisible(propertiesTab);
|
||||
propertiesTab.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickRightChevron() {
|
||||
clickRightChevron(): MetadataViewPage {
|
||||
Util.waitUntilElementIsVisible(this.rightChevron);
|
||||
this.rightChevron.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
getEditIconTooltip() {
|
||||
getEditIconTooltip(): promise.Promise<string> {
|
||||
return this.editIcon.getAttribute('title');
|
||||
}
|
||||
|
||||
getInformationButtonTooltip() {
|
||||
getInformationButtonTooltip(): promise.Promise<string> {
|
||||
return this.informationSpan.getAttribute('title');
|
||||
}
|
||||
|
||||
editPropertyIconIsDisplayed(propertyName) {
|
||||
editPropertyIconIsDisplayed(propertyName: string) {
|
||||
let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(editPropertyIcon);
|
||||
}
|
||||
|
||||
updatePropertyIconIsDisplayed(propertyName) {
|
||||
updatePropertyIconIsDisplayed(propertyName: string) {
|
||||
let updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(updatePropertyIcon);
|
||||
}
|
||||
|
||||
clickUpdatePropertyIcon(propertyName) {
|
||||
clickUpdatePropertyIcon(propertyName: string): promise.Promise<void> {
|
||||
let updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(updatePropertyIcon);
|
||||
return updatePropertyIcon.click();
|
||||
}
|
||||
|
||||
clickClearPropertyIcon(propertyName) {
|
||||
clickClearPropertyIcon(propertyName: string): promise.Promise<void> {
|
||||
let clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(clearPropertyIcon);
|
||||
return clearPropertyIcon.click();
|
||||
}
|
||||
|
||||
enterPropertyText(propertyName, text) {
|
||||
enterPropertyText(propertyName: string, text: string | number): MetadataViewPage {
|
||||
const textField = element(by.css('input[data-automation-id="card-textitem-editinput-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
@@ -195,7 +195,7 @@ export class MetadataViewPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
enterPresetText(text) {
|
||||
enterPresetText(text: string): MetadataViewPage {
|
||||
const presetField = element(by.css('input[data-automation-id="adf-text-custom-preset"]'));
|
||||
Util.waitUntilElementIsVisible(presetField);
|
||||
presetField.sendKeys('');
|
||||
@@ -206,7 +206,7 @@ export class MetadataViewPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
enterDescriptionText(text) {
|
||||
enterDescriptionText(text: string): MetadataViewPage {
|
||||
const textField = element(by.css('textarea[data-automation-id="card-textitem-edittextarea-properties.cm:description"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
@@ -215,199 +215,70 @@ export class MetadataViewPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
getPropertyText(propertyName, type) {
|
||||
let propertyType = !type ? 'textitem' : type;
|
||||
getPropertyText(propertyName: string, type?: string): promise.Promise<string> {
|
||||
const propertyType = type || 'textitem';
|
||||
const textField = element(by.css('span[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]'));
|
||||
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
}
|
||||
|
||||
clearPropertyIconIsDisplayed(propertyName) {
|
||||
clearPropertyIconIsDisplayed(propertyName: string) {
|
||||
let clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(clearPropertyIcon);
|
||||
}
|
||||
|
||||
clickEditPropertyIcons(propertyName) {
|
||||
clickEditPropertyIcons(propertyName: string) {
|
||||
let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(editPropertyIcon);
|
||||
editPropertyIcon.click();
|
||||
}
|
||||
|
||||
getPropertyIconTooltip(propertyName) {
|
||||
getPropertyIconTooltip(propertyName: string): promise.Promise<string> {
|
||||
let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
return editPropertyIcon.getAttribute('title');
|
||||
}
|
||||
|
||||
clickMetadataGroup(groupName) {
|
||||
clickMetadataGroup(groupName: string) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
group.click();
|
||||
}
|
||||
|
||||
checkMetadataGroupIsPresent(groupName) {
|
||||
checkMetadataGroupIsPresent(groupName: string): promise.Promise<boolean> {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
return Util.waitUntilElementIsVisible(group);
|
||||
}
|
||||
|
||||
checkMetadataGroupIsNotPresent(groupName) {
|
||||
checkMetadataGroupIsNotPresent(groupName: string): promise.Promise<any> {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
return Util.waitUntilElementIsNotVisible(group);
|
||||
}
|
||||
|
||||
checkMetadataGroupIsExpand(groupName) {
|
||||
checkMetadataGroupIsExpand(groupName: string) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
expect(group.getAttribute('class')).toContain('mat-expanded');
|
||||
}
|
||||
|
||||
checkMetadataGroupIsNotExpand(groupName) {
|
||||
checkMetadataGroupIsNotExpand(groupName: string) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
expect(group.getAttribute('class')).not.toContain('mat-expanded');
|
||||
}
|
||||
|
||||
getMetadataGroupTitle(groupName) {
|
||||
getMetadataGroupTitle(groupName: string): promise.Promise<string> {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
return group.getText();
|
||||
}
|
||||
|
||||
/**
|
||||
* disables displayEmpty
|
||||
*/
|
||||
disableDisplayEmpty() {
|
||||
Util.waitUntilElementIsVisible(this.displayEmptySwitch);
|
||||
this.displayEmptySwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.displayEmptySwitch.click();
|
||||
expect(this.displayEmptySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables displayEmpty
|
||||
*/
|
||||
enableDisplayEmpty() {
|
||||
Util.waitUntilElementIsVisible(this.displayEmptySwitch);
|
||||
this.displayEmptySwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.displayEmptySwitch.click();
|
||||
expect(this.displayEmptySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables Readonly
|
||||
*/
|
||||
disableReadonly() {
|
||||
Util.waitUntilElementIsVisible(this.readonlySwitch);
|
||||
this.readonlySwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.readonlySwitch.click();
|
||||
expect(this.readonlySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables Readonly
|
||||
*/
|
||||
enableReadonly() {
|
||||
Util.waitUntilElementIsVisible(this.readonlySwitch);
|
||||
this.readonlySwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.readonlySwitch.click();
|
||||
expect(this.readonlySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables multi
|
||||
*/
|
||||
disableMulti() {
|
||||
Util.waitUntilElementIsVisible(this.multiSwitch);
|
||||
this.multiSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.multiSwitch.click();
|
||||
expect(this.multiSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables multi
|
||||
*/
|
||||
enableMulti() {
|
||||
Util.waitUntilElementIsVisible(this.multiSwitch);
|
||||
this.multiSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.multiSwitch.click();
|
||||
expect(this.multiSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables preset
|
||||
*/
|
||||
disablePreset() {
|
||||
Util.waitUntilElementIsVisible(this.presetSwitch);
|
||||
this.presetSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.presetSwitch.click();
|
||||
expect(this.presetSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables preset
|
||||
*/
|
||||
enablePreset() {
|
||||
Util.waitUntilElementIsVisible(this.presetSwitch);
|
||||
this.presetSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.presetSwitch.click();
|
||||
expect(this.presetSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables preset
|
||||
*/
|
||||
disabledDefaultProperties() {
|
||||
Util.waitUntilElementIsVisible(this.defaultPropertiesSwitch);
|
||||
this.defaultPropertiesSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.defaultPropertiesSwitch.click();
|
||||
expect(this.defaultPropertiesSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables preset
|
||||
*/
|
||||
enabledDefaultProperties() {
|
||||
Util.waitUntilElementIsVisible(this.defaultPropertiesSwitch);
|
||||
this.defaultPropertiesSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.defaultPropertiesSwitch.click();
|
||||
expect(this.defaultPropertiesSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
checkPropertyIsVisible(propertyName, type) {
|
||||
checkPropertyIsVisible(propertyName: string, type: string) {
|
||||
let property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(property);
|
||||
}
|
||||
|
||||
checkPropertyIsNotVisible(propertyName, type) {
|
||||
checkPropertyIsNotVisible(propertyName: string, type: string) {
|
||||
let property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsNotVisible(property);
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Util } from '../../util/util';
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
import { element, by, protractor, browser, until } from 'protractor';
|
||||
|
||||
export class NotificationPage {
|
||||
|
||||
@@ -29,7 +29,7 @@ export class NotificationPage {
|
||||
notificationSnackBar = element.all(by.css('simple-snack-bar')).first();
|
||||
actionOutput = element(by.css('div[data-automation-id="notification-action-output"]'));
|
||||
customNotificationButton = element(by.css('button[data-automation-id="notification-custom-config-button"]'));
|
||||
selectionDropDown = element.all(by.css('div[class*="mat-select-content"]')).first();
|
||||
selectionDropDown = element.all(by.css('.mat-select-panel')).first();
|
||||
notificationsPage = element(by.css('a[data-automation-id="Notifications"]'));
|
||||
notificationConfig = element(by.css('p[data-automation-id="notification-custom-object"]'));
|
||||
|
||||
@@ -98,8 +98,10 @@ export class NotificationPage {
|
||||
}
|
||||
|
||||
clickNotificationButton() {
|
||||
Util.waitUntilElementIsVisible(this.customNotificationButton);
|
||||
this.customNotificationButton.click();
|
||||
// Util.waitUntilElementIsVisible(this.customNotificationButton);
|
||||
// this.customNotificationButton.click();
|
||||
const button = browser.wait(until.elementLocated(by.css('button[data-automation-id="notification-custom-config-button"]')));
|
||||
button.click();
|
||||
}
|
||||
|
||||
checkActionEvent() {
|
||||
|
@@ -29,7 +29,7 @@ export class FormFields {
|
||||
completedTaskNoFormMessage = element(by.css('div[id*="completed-form-message"] p'));
|
||||
attachFormButton = element(by.id('adf-no-form-attach-form-button'));
|
||||
selectFormDropDownArrow = element.all(by.css('adf-attach-form div[class*="mat-select-arrow"]')).first();
|
||||
selectFormContent = element(by.css('div[class*="mat-select-content"]'));
|
||||
selectFormContent = element(by.css('div[class*="mat-select-panel"]'));
|
||||
completeButton = element(by.id('adf-form-complete'));
|
||||
errorMessage = by.css('.adf-error-text-container .adf-error-text');
|
||||
|
||||
|
39
e2e/util/material.ts
Normal file
39
e2e/util/material.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/*!
|
||||
* @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 { ElementFinder } from 'protractor';
|
||||
import { Util } from './util';
|
||||
|
||||
export function uncheck(el: ElementFinder) {
|
||||
Util.waitUntilElementIsVisible(el);
|
||||
el.getAttribute('class').then((classList) => {
|
||||
if (classList && classList.indexOf('mat-checked') > -1) {
|
||||
el.click();
|
||||
expect(el.getAttribute('class')).not.toContain('mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function check(el: ElementFinder) {
|
||||
Util.waitUntilElementIsVisible(el);
|
||||
el.getAttribute('class').then((classList) => {
|
||||
if (classList && classList.indexOf('mat-checked') === -1) {
|
||||
el.click();
|
||||
expect(el.getAttribute('class')).toContain('mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user