mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
disable w3c due getValue problem (#7067)
* [ci:force]disable w3c due getValue problem * unify get Input value * [ci:force]fix * [ci:force] remove * [ci:force]remove all getAttribute * fix lint * fix lint * fix * fix * fix * fix * different fix try * rewrite wait for for value * fix lint * remove e2e already covered by unit * fix lint * fix
This commit is contained in:
@@ -16,7 +16,13 @@
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, CardTextItemPage, DropdownPage, CardBooleanItemPage } from '@alfresco/adf-testing';
|
||||
import {
|
||||
BrowserVisibility,
|
||||
BrowserActions,
|
||||
CardTextItemPage,
|
||||
DropdownPage,
|
||||
CardBooleanItemPage
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class CardViewComponentPage {
|
||||
|
||||
@@ -163,12 +169,10 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async disableEdit(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.editableSwitch);
|
||||
|
||||
const check = await this.editableSwitch.getAttribute('class');
|
||||
const check = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||
if (check.indexOf('mat-checked') > -1) {
|
||||
await BrowserActions.click(this.editableSwitch);
|
||||
await expect(await this.editableSwitch.getAttribute('class')).not.toContain('mat-checked');
|
||||
await expect(await BrowserActions.getAttribute(this.editableSwitch, 'class')).not.toContain('mat-checked');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,9 +197,7 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async enableClearDate(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.clearDateSwitch);
|
||||
|
||||
const switchClass = await this.clearDateSwitch.getAttribute('class');
|
||||
const switchClass = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.clearDateSwitch.click();
|
||||
const clearDateChecked = element(by.css('mat-slide-toggle[id="app-toggle-clear-date"][class*="mat-checked"]'));
|
||||
@@ -204,9 +206,7 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async enableNoneOption(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noneOptionSwitch);
|
||||
|
||||
const switchClass = await this.noneOptionSwitch.getAttribute('class');
|
||||
const switchClass = await BrowserActions.getAttribute(this.noneOptionSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.noneOptionSwitch.click();
|
||||
const noneOptionChecked = element(by.css('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]'));
|
||||
@@ -215,13 +215,13 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async isErrorNotDisplayed(): Promise<boolean> {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
try {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(errorElement);
|
||||
return true;
|
||||
} catch {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async getClickableValue(): Promise<string> {
|
||||
@@ -246,7 +246,7 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async clearIntField(): Promise<void> {
|
||||
await this.intField.clear();
|
||||
await this.intField.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -146,8 +146,8 @@ export class ContentServicesPage {
|
||||
await BrowserActions.click(this.deleteNodesButton);
|
||||
}
|
||||
|
||||
async checkToolbarDeleteIsDisabled(): Promise<void> {
|
||||
await BrowserActions.checkIsDisabled(this.deleteNodesButton);
|
||||
async checkToolbarDeleteIsDisabled(): Promise<boolean> {
|
||||
return !(await this.deleteNodesButton.isEnabled());
|
||||
}
|
||||
|
||||
async metadataContent(content): Promise<void> {
|
||||
@@ -427,8 +427,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getActiveBreadcrumb(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.activeBreadcrumb);
|
||||
return this.activeBreadcrumb.getAttribute('title');
|
||||
return BrowserActions.getAttribute(this.activeBreadcrumb, 'title');
|
||||
}
|
||||
|
||||
async uploadFile(fileLocation): Promise<void> {
|
||||
@@ -454,17 +453,17 @@ export class ContentServicesPage {
|
||||
|
||||
async getSingleFileButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFileButton);
|
||||
return this.uploadFileButtonInput.getAttribute('title');
|
||||
return BrowserActions.getAttribute(this.uploadFileButtonInput, 'title');
|
||||
}
|
||||
|
||||
async getMultipleFileButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
|
||||
return this.uploadMultipleFileButton.getAttribute('title');
|
||||
return BrowserActions.getAttribute(this.uploadMultipleFileButton, 'title');
|
||||
}
|
||||
|
||||
async getFolderButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFolderButton);
|
||||
return this.uploadFolderButton.getAttribute('title');
|
||||
return BrowserActions.getAttribute(this.uploadFolderButton, 'title');
|
||||
}
|
||||
|
||||
async checkUploadButton(): Promise<void> {
|
||||
@@ -560,8 +559,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async checkEmptyFolderImageUrlToContain(url): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolderImage);
|
||||
await expect(await this.emptyFolderImage.getAttribute('src')).toContain(url);
|
||||
await expect(await BrowserActions.getAttribute(this.emptyFolderImage, 'src')).toContain(url);
|
||||
}
|
||||
|
||||
async checkEmptyRecentFileIsDisplayed(): Promise<void> {
|
||||
@@ -570,8 +568,7 @@ export class ContentServicesPage {
|
||||
|
||||
async getRowIconImageUrl(fileName): Promise<string> {
|
||||
const iconRow = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(iconRow);
|
||||
return iconRow.getAttribute('src');
|
||||
return BrowserActions.getAttribute(iconRow, 'src');
|
||||
}
|
||||
|
||||
async checkGridViewButtonIsVisible(): Promise<void> {
|
||||
@@ -594,7 +591,7 @@ export class ContentServicesPage {
|
||||
|
||||
async getDocumentCardIconForElement(elementName): Promise<string> {
|
||||
const elementIcon = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
|
||||
return elementIcon.getAttribute('src');
|
||||
return BrowserActions.getAttribute(elementIcon, 'src');
|
||||
}
|
||||
|
||||
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
|
||||
|
@@ -189,7 +189,6 @@ export class DataTablePage {
|
||||
}
|
||||
|
||||
async getClipboardInputText(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.pasteClipboardInput);
|
||||
return this.pasteClipboardInput.getAttribute('value');
|
||||
return BrowserActions.getInputValue(this.pasteClipboardInput);
|
||||
}
|
||||
}
|
||||
|
@@ -44,10 +44,6 @@ export class FolderDialogPage {
|
||||
await BrowserActions.click(this.createUpdateButton);
|
||||
}
|
||||
|
||||
async checkCreateUpdateBtnIsDisabled(): Promise<void> {
|
||||
await BrowserActions.checkIsDisabled(this.createUpdateButton);
|
||||
}
|
||||
|
||||
async clickOnCancelButton(): Promise<void> {
|
||||
await BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
@@ -61,7 +57,7 @@ export class FolderDialogPage {
|
||||
}
|
||||
|
||||
async getFolderName(): Promise<string> {
|
||||
return this.folderNameField.getAttribute('value');
|
||||
return BrowserActions.getInputValue(this.folderNameField);
|
||||
}
|
||||
|
||||
async getValidationMessage(): Promise<string> {
|
||||
@@ -80,8 +76,8 @@ export class FolderDialogPage {
|
||||
return this.folderDescriptionField;
|
||||
}
|
||||
|
||||
async checkCreateUpdateBtnIsEnabled(): Promise<void> {
|
||||
await this.createUpdateButton.isEnabled();
|
||||
async checkCreateUpdateBtnIsEnabled(): Promise<boolean> {
|
||||
return this.createUpdateButton.isEnabled();
|
||||
}
|
||||
|
||||
async checkCancelBtnIsEnabled(): Promise<void> {
|
||||
|
@@ -61,8 +61,7 @@ export class ShareDialogPage {
|
||||
}
|
||||
|
||||
async getShareLink(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.shareLink);
|
||||
return this.shareLink.getAttribute('value');
|
||||
return BrowserActions.getInputValue(this.shareLink);
|
||||
}
|
||||
|
||||
async clickCloseButton(): Promise<void> {
|
||||
@@ -111,7 +110,7 @@ export class ShareDialogPage {
|
||||
}
|
||||
|
||||
async getExpirationDate(): Promise<string> {
|
||||
return this.expirationDateInput.getAttribute('value');
|
||||
return BrowserActions.getInputValue(this.expirationDateInput);
|
||||
}
|
||||
|
||||
async expirationDateInputHasValue(value): Promise<void> {
|
||||
|
@@ -97,8 +97,7 @@ export class LoginShellPage {
|
||||
}
|
||||
|
||||
async checkLoginImgURL(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoImg);
|
||||
return this.logoImg.getAttribute('src');
|
||||
return BrowserActions.getAttribute(this.logoImg, 'src');
|
||||
}
|
||||
|
||||
async checkUsernameInactive(): Promise<void> {
|
||||
@@ -148,7 +147,7 @@ export class LoginShellPage {
|
||||
}
|
||||
|
||||
async getShownPassword(): Promise<string> {
|
||||
return this.txtPassword.getAttribute('value');
|
||||
return BrowserActions.getInputValue(this.txtPassword);
|
||||
}
|
||||
|
||||
async checkPasswordIsHidden(): Promise<void> {
|
||||
|
@@ -134,7 +134,7 @@ export class MetadataViewPage {
|
||||
}
|
||||
|
||||
async getEditIconTooltip(): Promise<string> {
|
||||
return this.editIcon.getAttribute('title');
|
||||
return BrowserActions.getAttribute(this.editIcon, 'title');
|
||||
}
|
||||
|
||||
async editPropertyIconIsDisplayed(propertyName: string) {
|
||||
@@ -176,7 +176,7 @@ export class MetadataViewPage {
|
||||
|
||||
async getPropertyIconTooltip(propertyName: string): Promise<string> {
|
||||
const editPropertyIcon = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
return editPropertyIcon.getAttribute('title');
|
||||
return BrowserActions.getAttribute(editPropertyIcon, 'title');
|
||||
}
|
||||
|
||||
async clickMetadataGroup(groupName: string): Promise<void> {
|
||||
@@ -196,14 +196,12 @@ export class MetadataViewPage {
|
||||
|
||||
async checkMetadataGroupIsExpand(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(group);
|
||||
await expect(await group.getAttribute('class')).toContain('mat-expanded');
|
||||
await expect(await BrowserActions.getAttribute(group, 'class')).toContain('mat-expanded');
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsNotExpand(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
await BrowserVisibility.waitUntilElementIsPresent(group);
|
||||
await expect(await group.getAttribute('class')).not.toContain('mat-expanded');
|
||||
await expect(await BrowserActions.getAttribute(group, 'class')).not.toContain('mat-expanded');
|
||||
}
|
||||
|
||||
async getMetadataGroupTitle(groupName: string): Promise<string> {
|
||||
|
Reference in New Issue
Block a user