mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fix e2e (#6087)
* 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:
@@ -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"]'));
|
||||
|
@@ -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> {
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
@@ -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> {
|
||||
|
@@ -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']`));
|
||||
|
@@ -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'));
|
||||
|
Reference in New Issue
Block a user