mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
Prettier upgrade and e2e type checks (#1522)
* upgrade prettier * noImplicitAny rule * fix type * update tsconfig * upgrade to 150 print width
This commit is contained in:
@@ -25,41 +25,18 @@
|
||||
|
||||
import { by, browser, protractor } from 'protractor';
|
||||
import { GenericDialog } from '../dialog/generic-dialog';
|
||||
import {
|
||||
Utils,
|
||||
isPresentAndDisplayed,
|
||||
waitForStaleness,
|
||||
waitForPresence,
|
||||
isPresentAndEnabled,
|
||||
waitForClickable
|
||||
} from '../../utilities/utils';
|
||||
import { Utils, isPresentAndDisplayed, waitForStaleness, waitForPresence, isPresentAndEnabled, waitForClickable } from '../../utilities/utils';
|
||||
import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb';
|
||||
import { DataTable } from '../data-table/data-table';
|
||||
|
||||
export class ContentNodeSelectorDialog extends GenericDialog {
|
||||
cancelButton = this.childElement(
|
||||
by.css('[data-automation-id="content-node-selector-actions-cancel"]')
|
||||
);
|
||||
copyButton = this.childElement(
|
||||
by.cssContainingText(
|
||||
'[data-automation-id="content-node-selector-actions-choose"]',
|
||||
'Copy'
|
||||
)
|
||||
);
|
||||
moveButton = this.childElement(
|
||||
by.cssContainingText(
|
||||
'[data-automation-id="content-node-selector-actions-choose"]',
|
||||
'Move'
|
||||
)
|
||||
);
|
||||
cancelButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-cancel"]'));
|
||||
copyButton = this.childElement(by.cssContainingText('[data-automation-id="content-node-selector-actions-choose"]', 'Copy'));
|
||||
moveButton = this.childElement(by.cssContainingText('[data-automation-id="content-node-selector-actions-choose"]', 'Move'));
|
||||
|
||||
locationDropDown = this.rootElem.element(by.id('site-dropdown-container'));
|
||||
locationPersonalFiles = browser.element(
|
||||
by.cssContainingText('.mat-option .mat-option-text', 'Personal Files')
|
||||
);
|
||||
locationFileLibraries = browser.element(
|
||||
by.cssContainingText('.mat-option .mat-option-text', 'My Libraries')
|
||||
);
|
||||
locationPersonalFiles = browser.element(by.cssContainingText('.mat-option .mat-option-text', 'Personal Files'));
|
||||
locationFileLibraries = browser.element(by.cssContainingText('.mat-option .mat-option-text', 'My Libraries'));
|
||||
|
||||
searchInput = this.rootElem.element(by.css('#searchInput'));
|
||||
toolbarTitle = this.rootElem.element(by.css('.adf-toolbar-title'));
|
||||
|
@@ -25,26 +25,15 @@
|
||||
|
||||
import { by } from 'protractor';
|
||||
import { GenericDialog } from '../dialog/generic-dialog';
|
||||
import {
|
||||
isPresentAndDisplayed,
|
||||
waitForClickable,
|
||||
isPresentAndEnabled,
|
||||
typeText
|
||||
} from '../../utilities/utils';
|
||||
import { isPresentAndDisplayed, waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils';
|
||||
|
||||
export class CreateOrEditFolderDialog extends GenericDialog {
|
||||
createButton = this.childElement(
|
||||
by.cssContainingText('.mat-dialog-actions button', 'Create')
|
||||
);
|
||||
createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
|
||||
cancelButton = this.childElement(by.id('adf-folder-cancel-button'));
|
||||
updateButton = this.childElement(
|
||||
by.cssContainingText('.mat-dialog-actions button', 'Update')
|
||||
);
|
||||
updateButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Update'));
|
||||
|
||||
nameInput = this.rootElem.element(by.css('input[placeholder="Name" i]'));
|
||||
descriptionTextArea = this.rootElem.element(
|
||||
by.css('textarea[placeholder="Description" i]')
|
||||
);
|
||||
descriptionTextArea = this.rootElem.element(by.css('textarea[placeholder="Description" i]'));
|
||||
validationMessage = this.rootElem.element(by.css('.mat-hint span'));
|
||||
|
||||
constructor() {
|
||||
|
@@ -25,25 +25,15 @@
|
||||
|
||||
import { by } from 'protractor';
|
||||
import { GenericDialog } from '../dialog/generic-dialog';
|
||||
import {
|
||||
isPresentAndDisplayed,
|
||||
isPresentAndEnabled,
|
||||
typeText
|
||||
} from '../../utilities/utils';
|
||||
import { isPresentAndDisplayed, isPresentAndEnabled, typeText } from '../../utilities/utils';
|
||||
|
||||
export class CreateFromTemplateDialog extends GenericDialog {
|
||||
createButton = this.childElement(
|
||||
by.cssContainingText('.mat-dialog-actions button', 'Create')
|
||||
);
|
||||
cancelButton = this.childElement(
|
||||
by.cssContainingText('.mat-dialog-actions button', 'CANCEL')
|
||||
);
|
||||
createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
|
||||
cancelButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'CANCEL'));
|
||||
|
||||
nameInput = this.childElement(by.css('input[placeholder="Name" i]'));
|
||||
titleInput = this.childElement(by.css('input[placeholder="Title" i]'));
|
||||
descriptionTextArea = this.childElement(
|
||||
by.css('textarea[placeholder="Description" i]')
|
||||
);
|
||||
descriptionTextArea = this.childElement(by.css('textarea[placeholder="Description" i]'));
|
||||
validationMessage = this.childElement(by.css('.mat-error'));
|
||||
|
||||
constructor() {
|
||||
|
@@ -25,36 +25,18 @@
|
||||
|
||||
import { by, ElementFinder } from 'protractor';
|
||||
import { GenericDialog } from '../dialog/generic-dialog';
|
||||
import {
|
||||
waitForClickable,
|
||||
isPresentAndEnabled,
|
||||
typeText
|
||||
} from '../../utilities/utils';
|
||||
import { waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils';
|
||||
|
||||
export class CreateLibraryDialog extends GenericDialog {
|
||||
createButton = this.childElement(
|
||||
by.cssContainingText('.mat-dialog-actions button', 'Create')
|
||||
);
|
||||
cancelButton = this.childElement(
|
||||
by.cssContainingText('.mat-dialog-actions button', 'Cancel')
|
||||
);
|
||||
createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
|
||||
cancelButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Cancel'));
|
||||
|
||||
nameInput = this.rootElem.element(by.css('input[placeholder="Name" i]'));
|
||||
libraryIdInput = this.rootElem.element(
|
||||
by.css('input[placeholder="Library ID" i]')
|
||||
);
|
||||
descriptionTextArea = this.rootElem.element(
|
||||
by.css('textarea[placeholder="Description" i]')
|
||||
);
|
||||
visibilityPublic = this.rootElem.element(
|
||||
by.cssContainingText('.mat-radio-label', 'Public')
|
||||
);
|
||||
visibilityModerated = this.rootElem.element(
|
||||
by.cssContainingText('.mat-radio-label', 'Moderated')
|
||||
);
|
||||
visibilityPrivate = this.rootElem.element(
|
||||
by.cssContainingText('.mat-radio-label', 'Private')
|
||||
);
|
||||
libraryIdInput = this.rootElem.element(by.css('input[placeholder="Library ID" i]'));
|
||||
descriptionTextArea = this.rootElem.element(by.css('textarea[placeholder="Description" i]'));
|
||||
visibilityPublic = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Public'));
|
||||
visibilityModerated = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Moderated'));
|
||||
visibilityPrivate = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Private'));
|
||||
|
||||
errorMessage = this.rootElem.element(by.css('.mat-error'));
|
||||
|
||||
@@ -100,9 +82,7 @@ export class CreateLibraryDialog extends GenericDialog {
|
||||
}
|
||||
|
||||
private async isChecked(target: ElementFinder): Promise<boolean> {
|
||||
const elemClass = await target
|
||||
.element(by.xpath('..'))
|
||||
.getAttribute('class');
|
||||
const elemClass = await target.element(by.xpath('..')).getAttribute('class');
|
||||
return elemClass.includes('mat-radio-checked');
|
||||
}
|
||||
|
||||
|
@@ -24,12 +24,7 @@
|
||||
*/
|
||||
|
||||
import { ElementFinder, by, browser, Locator } from 'protractor';
|
||||
import {
|
||||
isPresentAndDisplayed,
|
||||
waitForPresence,
|
||||
waitForVisibility,
|
||||
waitForStaleness
|
||||
} from '../../utilities/utils';
|
||||
import { isPresentAndDisplayed, waitForPresence, waitForVisibility, waitForStaleness } from '../../utilities/utils';
|
||||
|
||||
export abstract class GenericDialog {
|
||||
constructor(private rootCssSelector?: string) {}
|
||||
|
@@ -25,19 +25,11 @@
|
||||
|
||||
import { by, browser } from 'protractor';
|
||||
import { GenericDialog } from '../dialog/generic-dialog';
|
||||
import {
|
||||
waitForClickable,
|
||||
isPresentAndEnabled,
|
||||
typeText
|
||||
} from '../../utilities/utils';
|
||||
import { waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils';
|
||||
|
||||
export class PasswordDialog extends GenericDialog {
|
||||
closeButton = this.childElement(
|
||||
by.css('[data-automation-id="adf-password-dialog-close"]')
|
||||
);
|
||||
submitButton = this.childElement(
|
||||
by.css('[data-automation-id="adf-password-dialog-submit"]')
|
||||
);
|
||||
closeButton = this.childElement(by.css('[data-automation-id="adf-password-dialog-close"]'));
|
||||
submitButton = this.childElement(by.css('[data-automation-id="adf-password-dialog-submit"]'));
|
||||
passwordInput = this.childElement(by.css('input[type="Password"]'));
|
||||
errorMessage = this.childElement(by.css('.mat-error'));
|
||||
|
||||
@@ -79,10 +71,7 @@ export class PasswordDialog extends GenericDialog {
|
||||
async isErrorDisplayed(): Promise<boolean> {
|
||||
try {
|
||||
await this.waitForDialogToOpen();
|
||||
return (
|
||||
(await this.errorMessage.isPresent()) &&
|
||||
(await this.errorMessage.isDisplayed())
|
||||
);
|
||||
return (await this.errorMessage.isPresent()) && (await this.errorMessage.isDisplayed());
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -30,13 +30,8 @@ import { DataTable } from '../data-table/data-table';
|
||||
import { isPresentAndEnabled } from '../../utilities/utils';
|
||||
|
||||
export class SelectTemplateDialog extends GenericDialog {
|
||||
nextButton = this.childElement(
|
||||
by.css('[data-automation-id="content-node-selector-actions-choose"]')
|
||||
);
|
||||
|
||||
cancelButton = this.childElement(
|
||||
by.css('[data-automation-id="content-node-selector-actions-cancel"]')
|
||||
);
|
||||
nextButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-choose"]'));
|
||||
cancelButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-cancel"]'));
|
||||
|
||||
breadcrumb = new DropDownBreadcrumb();
|
||||
dataTable = new DataTable('.aca-template-node-selector-dialog');
|
||||
|
@@ -31,27 +31,17 @@ import { isPresentAndEnabled } from '../../utilities/utils';
|
||||
export class ShareDialog extends GenericDialog {
|
||||
dateTimePicker = new DateTimePicker();
|
||||
|
||||
dialogTitle = this.childElement(
|
||||
by.css(`[data-automation-id='adf-share-dialog-title']`)
|
||||
);
|
||||
dialogTitle = this.childElement(by.css(`[data-automation-id='adf-share-dialog-title']`));
|
||||
infoText = this.childElement(by.css('.adf-share-link__info'));
|
||||
labels = this.rootElem.all(by.css('.adf-share-link__label'));
|
||||
shareToggle = this.childElement(
|
||||
by.css(`[data-automation-id='adf-share-toggle']`)
|
||||
);
|
||||
shareToggle = this.childElement(by.css(`[data-automation-id='adf-share-toggle']`));
|
||||
url = this.childElement(by.css(`[data-automation-id='adf-share-link']`));
|
||||
urlAction = this.childElement(by.css('.adf-input-action'));
|
||||
expireToggle = this.childElement(
|
||||
by.css(`[data-automation-id='adf-expire-toggle']`)
|
||||
);
|
||||
expireToggle = this.childElement(by.css(`[data-automation-id='adf-expire-toggle']`));
|
||||
expireInput = this.childElement(by.css('input[formcontrolname="time"]'));
|
||||
datetimePickerButton = this.childElement(
|
||||
by.css('.mat-datetimepicker-toggle')
|
||||
);
|
||||
datetimePickerButton = this.childElement(by.css('.mat-datetimepicker-toggle'));
|
||||
|
||||
closeButton = this.childElement(
|
||||
by.css(`[data-automation-id='adf-share-dialog-close']`)
|
||||
);
|
||||
closeButton = this.childElement(by.css(`[data-automation-id='adf-share-dialog-close']`));
|
||||
|
||||
constructor() {
|
||||
super('.adf-share-dialog');
|
||||
|
@@ -28,18 +28,10 @@ import { GenericDialog } from '../dialog/generic-dialog';
|
||||
import { isPresentAndEnabled, typeText } from '../../utilities/utils';
|
||||
|
||||
export class UploadNewVersionDialog extends GenericDialog {
|
||||
cancelButton = this.childElement(
|
||||
by.cssContainingText('.mat-button-wrapper', 'Cancel')
|
||||
);
|
||||
uploadButton = this.childElement(
|
||||
by.cssContainingText('.mat-button-wrapper', 'Upload')
|
||||
);
|
||||
majorOption = this.childElement(
|
||||
by.cssContainingText(`.mat-radio-label`, 'major')
|
||||
);
|
||||
minorOption = this.childElement(
|
||||
by.cssContainingText(`.mat-radio-label`, 'minor')
|
||||
);
|
||||
cancelButton = this.childElement(by.cssContainingText('.mat-button-wrapper', 'Cancel'));
|
||||
uploadButton = this.childElement(by.cssContainingText('.mat-button-wrapper', 'Upload'));
|
||||
majorOption = this.childElement(by.cssContainingText(`.mat-radio-label`, 'major'));
|
||||
minorOption = this.childElement(by.cssContainingText(`.mat-radio-label`, 'minor'));
|
||||
description = this.childElement(by.css('textarea'));
|
||||
|
||||
constructor() {
|
||||
|
Reference in New Issue
Block a user