mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +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,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FileModel } from '../../models/ACS/file.model';
|
import { FileModel } from '../../models/ACS/file.model';
|
||||||
import { ApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
|
import {
|
||||||
|
ApiService,
|
||||||
|
LoginPage,
|
||||||
|
StringUtil,
|
||||||
|
UploadActions,
|
||||||
|
UserModel,
|
||||||
|
UsersActions
|
||||||
|
} from '@alfresco/adf-testing';
|
||||||
import { TagPage } from '../../content-services/pages/tag.page';
|
import { TagPage } from '../../content-services/pages/tag.page';
|
||||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
@@ -78,18 +85,6 @@ describe('Tag component', () => {
|
|||||||
await uploadActions.deleteFileOrFolder(pdfUploadedFile.entry.id);
|
await uploadActions.deleteFileOrFolder(pdfUploadedFile.entry.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260374] Should NOT be possible to add a new tag without Node ID', async () => {
|
|
||||||
await expect(await tagPage.getNodeId()).toEqual('');
|
|
||||||
await expect(await tagPage.newTagInput.getAttribute('data-placeholder')).toEqual('New Tag');
|
|
||||||
await expect(await tagPage.addTagButtonIsEnabled()).toEqual(false);
|
|
||||||
await tagPage.tagListRow.waitNotVisible();
|
|
||||||
await tagPage.tagListByNodeIdRow.waitNotVisible();
|
|
||||||
await tagPage.newTagInput.typeText('a');
|
|
||||||
|
|
||||||
await expect(await tagPage.addTagButtonIsEnabled()).toEqual(false);
|
|
||||||
await expect(await tagPage.newTagInput.getAttribute('value')).toEqual('a');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('[C268151] Should be possible to add a new tag to a Node', async () => {
|
it('[C268151] Should be possible to add a new tag to a Node', async () => {
|
||||||
await tagPage.insertNodeId(pdfFileModel.id);
|
await tagPage.insertNodeId(pdfFileModel.id);
|
||||||
await tagPage.addTag(tagList[0]);
|
await tagPage.addTag(tagList[0]);
|
||||||
|
@@ -77,7 +77,7 @@ describe('Create folder directive', () => {
|
|||||||
const folderName = 'NotEnableFolder';
|
const folderName = 'NotEnableFolder';
|
||||||
await contentServicesPage.clickOnCreateNewFolder();
|
await contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
|
|
||||||
await createFolderDialog.addFolderName(folderName);
|
await createFolderDialog.addFolderName(folderName);
|
||||||
|
|
||||||
@@ -129,20 +129,20 @@ describe('Create folder directive', () => {
|
|||||||
await contentServicesPage.clickOnCreateNewFolder();
|
await contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
await createFolderDialog.addFolderName('*');
|
await createFolderDialog.addFolderName('*');
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
await createFolderDialog.addFolderName('<');
|
await createFolderDialog.addFolderName('<');
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
await createFolderDialog.addFolderName('>');
|
await createFolderDialog.addFolderName('>');
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
await createFolderDialog.addFolderName('\\');
|
await createFolderDialog.addFolderName('\\');
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
await createFolderDialog.addFolderName('/');
|
await createFolderDialog.addFolderName('/');
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
await createFolderDialog.addFolderName('?');
|
await createFolderDialog.addFolderName('?');
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
await createFolderDialog.addFolderName(':');
|
await createFolderDialog.addFolderName(':');
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
await createFolderDialog.addFolderName('|');
|
await createFolderDialog.addFolderName('|');
|
||||||
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -170,7 +170,7 @@ describe('Delete Directive', () => {
|
|||||||
await contentServicesPage.chooseSelectionMode('None');
|
await contentServicesPage.chooseSelectionMode('None');
|
||||||
await contentListPage.selectRow(txtFileModel.name);
|
await contentListPage.selectRow(txtFileModel.name);
|
||||||
await contentListPage.dataTable.checkRowIsNotSelected('Display name', txtFileModel.name);
|
await contentListPage.dataTable.checkRowIsNotSelected('Display name', txtFileModel.name);
|
||||||
await contentServicesPage.checkToolbarDeleteIsDisabled();
|
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
|
||||||
|
|
||||||
await contentServicesPage.chooseSelectionMode('Single');
|
await contentServicesPage.chooseSelectionMode('Single');
|
||||||
await contentListPage.selectRow(txtFileModel.name);
|
await contentListPage.selectRow(txtFileModel.name);
|
||||||
@@ -278,16 +278,16 @@ describe('Delete Directive', () => {
|
|||||||
it('[C216426] Delete file without delete permissions', async () => {
|
it('[C216426] Delete file without delete permissions', async () => {
|
||||||
await contentListPage.selectRowWithKeyboard(filePdf.entry.name);
|
await contentListPage.selectRowWithKeyboard(filePdf.entry.name);
|
||||||
await contentListPage.dataTable.checkRowIsSelected('Display name', filePdf.entry.name);
|
await contentListPage.dataTable.checkRowIsSelected('Display name', filePdf.entry.name);
|
||||||
await contentServicesPage.checkToolbarDeleteIsDisabled();
|
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
|
||||||
await contentListPage.selectRowWithKeyboard(folderB.entry.name);
|
await contentListPage.selectRowWithKeyboard(folderB.entry.name);
|
||||||
await contentListPage.dataTable.checkRowIsSelected('Display name', folderB.entry.name);
|
await contentListPage.dataTable.checkRowIsSelected('Display name', folderB.entry.name);
|
||||||
await contentServicesPage.checkToolbarDeleteIsDisabled();
|
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
|
||||||
await contentListPage.selectRowWithKeyboard(folderA.entry.name);
|
await contentListPage.selectRowWithKeyboard(folderA.entry.name);
|
||||||
await contentListPage.dataTable.checkRowIsSelected('Display name', folderA.entry.name);
|
await contentListPage.dataTable.checkRowIsSelected('Display name', folderA.entry.name);
|
||||||
await contentServicesPage.checkToolbarDeleteIsDisabled();
|
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
|
||||||
await contentListPage.selectRowWithKeyboard(fileTxt.entry.name);
|
await contentListPage.selectRowWithKeyboard(fileTxt.entry.name);
|
||||||
await contentListPage.dataTable.checkRowIsSelected('Display name', fileTxt.entry.name);
|
await contentListPage.dataTable.checkRowIsSelected('Display name', fileTxt.entry.name);
|
||||||
await contentServicesPage.checkToolbarDeleteIsDisabled();
|
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -154,7 +154,7 @@ describe('Edit folder directive', () => {
|
|||||||
|
|
||||||
await editFolderDialog.addFolderName('a*"<>\\/?:|');
|
await editFolderDialog.addFolderName('a*"<>\\/?:|');
|
||||||
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |');
|
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |');
|
||||||
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
|
|
||||||
await editFolderDialog.addFolderName('a.a');
|
await editFolderDialog.addFolderName('a.a');
|
||||||
await editFolderDialog.checkValidationMessageIsNotDisplayed();
|
await editFolderDialog.checkValidationMessageIsNotDisplayed();
|
||||||
@@ -162,11 +162,11 @@ describe('Edit folder directive', () => {
|
|||||||
|
|
||||||
await editFolderDialog.addFolderName('a.');
|
await editFolderDialog.addFolderName('a.');
|
||||||
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .');
|
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .');
|
||||||
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
|
|
||||||
await BrowserActions.clearSendKeys(editFolderDialog.getFolderNameField(), protractor.Key.SPACE);
|
await BrowserActions.clearSendKeys(editFolderDialog.getFolderNameField(), protractor.Key.SPACE);
|
||||||
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces');
|
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces');
|
||||||
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
|
await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
|
||||||
|
|
||||||
await editFolderDialog.addFolderName(editFolder.entry.name);
|
await editFolderDialog.addFolderName(editFolder.entry.name);
|
||||||
await editFolderDialog.addFolderDescription('a*"<>\\/?:|');
|
await editFolderDialog.addFolderDescription('a*"<>\\/?:|');
|
||||||
|
@@ -87,8 +87,7 @@ export class PermissionsPage {
|
|||||||
async isInherited(): Promise<boolean> {
|
async isInherited(): Promise<boolean> {
|
||||||
const inheritButton = TestElement.byCss(this.inheritedButton);
|
const inheritButton = TestElement.byCss(this.inheritedButton);
|
||||||
await inheritButton.waitVisible();
|
await inheritButton.waitVisible();
|
||||||
const appliedStyles = await inheritButton.getAttribute('class');
|
return (await inheritButton.getAttribute('class')).indexOf('mat-checked') !== -1;
|
||||||
return appliedStyles.indexOf('mat-checked') !== -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggleInheritPermission(): Promise<void> {
|
async toggleInheritPermission(): Promise<void> {
|
||||||
|
@@ -16,15 +16,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { by, element } from 'protractor';
|
||||||
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
|
import { BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class SocialPage {
|
export class SocialPage {
|
||||||
|
|
||||||
nodeIdField = element(by.css(`input[id="nodeId"]`));
|
nodeIdField = element(by.css(`input[id="nodeId"]`));
|
||||||
|
|
||||||
async getNodeIdFieldValue(): Promise<string> {
|
async getNodeIdFieldValue(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.nodeIdField);
|
return BrowserActions.getInputValue(this.nodeIdField);
|
||||||
return this.nodeIdField.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async writeCustomNodeId(nodeId: string): Promise<void> {
|
async writeCustomNodeId(nodeId: string): Promise<void> {
|
||||||
|
@@ -34,7 +34,7 @@ export class TagPage {
|
|||||||
confirmTag = TestElement.byCss('#adf-tag-node-send');
|
confirmTag = TestElement.byCss('#adf-tag-node-send');
|
||||||
|
|
||||||
getNodeId(): Promise<string> {
|
getNodeId(): Promise<string> {
|
||||||
return new TestElement(this.insertNodeIdElement).getAttribute('value');
|
return BrowserActions.getInputValue(this.insertNodeIdElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async insertNodeId(nodeId) {
|
async insertNodeId(nodeId) {
|
||||||
|
@@ -30,8 +30,7 @@ export class TreeViewPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getNodeId(): Promise<string> {
|
async getNodeId(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.nodeIdInput);
|
return BrowserActions.getInputValue(this.nodeIdInput);
|
||||||
return this.nodeIdInput.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickNode(nodeName: string): Promise<void> {
|
async clickNode(nodeName: string): Promise<void> {
|
||||||
|
@@ -16,7 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
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 {
|
export class CardViewComponentPage {
|
||||||
|
|
||||||
@@ -163,12 +169,10 @@ export class CardViewComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async disableEdit(): Promise<void> {
|
async disableEdit(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.editableSwitch);
|
const check = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||||
|
|
||||||
const check = await this.editableSwitch.getAttribute('class');
|
|
||||||
if (check.indexOf('mat-checked') > -1) {
|
if (check.indexOf('mat-checked') > -1) {
|
||||||
await BrowserActions.click(this.editableSwitch);
|
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> {
|
async enableClearDate(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.clearDateSwitch);
|
const switchClass = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||||
|
|
||||||
const switchClass = await this.clearDateSwitch.getAttribute('class');
|
|
||||||
if (switchClass.indexOf('mat-checked') === -1) {
|
if (switchClass.indexOf('mat-checked') === -1) {
|
||||||
await this.clearDateSwitch.click();
|
await this.clearDateSwitch.click();
|
||||||
const clearDateChecked = element(by.css('mat-slide-toggle[id="app-toggle-clear-date"][class*="mat-checked"]'));
|
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> {
|
async enableNoneOption(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.noneOptionSwitch);
|
const switchClass = await BrowserActions.getAttribute(this.noneOptionSwitch, 'class');
|
||||||
|
|
||||||
const switchClass = await this.noneOptionSwitch.getAttribute('class');
|
|
||||||
if (switchClass.indexOf('mat-checked') === -1) {
|
if (switchClass.indexOf('mat-checked') === -1) {
|
||||||
await this.noneOptionSwitch.click();
|
await this.noneOptionSwitch.click();
|
||||||
const noneOptionChecked = element(by.css('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]'));
|
const noneOptionChecked = element(by.css('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]'));
|
||||||
|
@@ -146,8 +146,8 @@ export class ContentServicesPage {
|
|||||||
await BrowserActions.click(this.deleteNodesButton);
|
await BrowserActions.click(this.deleteNodesButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkToolbarDeleteIsDisabled(): Promise<void> {
|
async checkToolbarDeleteIsDisabled(): Promise<boolean> {
|
||||||
await BrowserActions.checkIsDisabled(this.deleteNodesButton);
|
return !(await this.deleteNodesButton.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
async metadataContent(content): Promise<void> {
|
async metadataContent(content): Promise<void> {
|
||||||
@@ -427,8 +427,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getActiveBreadcrumb(): Promise<string> {
|
async getActiveBreadcrumb(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.activeBreadcrumb);
|
return BrowserActions.getAttribute(this.activeBreadcrumb, 'title');
|
||||||
return this.activeBreadcrumb.getAttribute('title');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async uploadFile(fileLocation): Promise<void> {
|
async uploadFile(fileLocation): Promise<void> {
|
||||||
@@ -454,17 +453,17 @@ export class ContentServicesPage {
|
|||||||
|
|
||||||
async getSingleFileButtonTooltip(): Promise<string> {
|
async getSingleFileButtonTooltip(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFileButton);
|
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFileButton);
|
||||||
return this.uploadFileButtonInput.getAttribute('title');
|
return BrowserActions.getAttribute(this.uploadFileButtonInput, 'title');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMultipleFileButtonTooltip(): Promise<string> {
|
async getMultipleFileButtonTooltip(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
|
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
|
||||||
return this.uploadMultipleFileButton.getAttribute('title');
|
return BrowserActions.getAttribute(this.uploadMultipleFileButton, 'title');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFolderButtonTooltip(): Promise<string> {
|
async getFolderButtonTooltip(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFolderButton);
|
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFolderButton);
|
||||||
return this.uploadFolderButton.getAttribute('title');
|
return BrowserActions.getAttribute(this.uploadFolderButton, 'title');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkUploadButton(): Promise<void> {
|
async checkUploadButton(): Promise<void> {
|
||||||
@@ -560,8 +559,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkEmptyFolderImageUrlToContain(url): Promise<void> {
|
async checkEmptyFolderImageUrlToContain(url): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolderImage);
|
await expect(await BrowserActions.getAttribute(this.emptyFolderImage, 'src')).toContain(url);
|
||||||
await expect(await this.emptyFolderImage.getAttribute('src')).toContain(url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkEmptyRecentFileIsDisplayed(): Promise<void> {
|
async checkEmptyRecentFileIsDisplayed(): Promise<void> {
|
||||||
@@ -570,8 +568,7 @@ export class ContentServicesPage {
|
|||||||
|
|
||||||
async getRowIconImageUrl(fileName): Promise<string> {
|
async getRowIconImageUrl(fileName): Promise<string> {
|
||||||
const iconRow = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
const iconRow = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(iconRow);
|
return BrowserActions.getAttribute(iconRow, 'src');
|
||||||
return iconRow.getAttribute('src');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkGridViewButtonIsVisible(): Promise<void> {
|
async checkGridViewButtonIsVisible(): Promise<void> {
|
||||||
@@ -594,7 +591,7 @@ export class ContentServicesPage {
|
|||||||
|
|
||||||
async getDocumentCardIconForElement(elementName): Promise<string> {
|
async getDocumentCardIconForElement(elementName): Promise<string> {
|
||||||
const elementIcon = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
|
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> {
|
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
|
||||||
|
@@ -189,7 +189,6 @@ export class DataTablePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getClipboardInputText(): Promise<string> {
|
async getClipboardInputText(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.pasteClipboardInput);
|
return BrowserActions.getInputValue(this.pasteClipboardInput);
|
||||||
return this.pasteClipboardInput.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -44,10 +44,6 @@ export class FolderDialogPage {
|
|||||||
await BrowserActions.click(this.createUpdateButton);
|
await BrowserActions.click(this.createUpdateButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCreateUpdateBtnIsDisabled(): Promise<void> {
|
|
||||||
await BrowserActions.checkIsDisabled(this.createUpdateButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
async clickOnCancelButton(): Promise<void> {
|
async clickOnCancelButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.cancelButton);
|
await BrowserActions.click(this.cancelButton);
|
||||||
}
|
}
|
||||||
@@ -61,7 +57,7 @@ export class FolderDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFolderName(): Promise<string> {
|
async getFolderName(): Promise<string> {
|
||||||
return this.folderNameField.getAttribute('value');
|
return BrowserActions.getInputValue(this.folderNameField);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getValidationMessage(): Promise<string> {
|
async getValidationMessage(): Promise<string> {
|
||||||
@@ -80,8 +76,8 @@ export class FolderDialogPage {
|
|||||||
return this.folderDescriptionField;
|
return this.folderDescriptionField;
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCreateUpdateBtnIsEnabled(): Promise<void> {
|
async checkCreateUpdateBtnIsEnabled(): Promise<boolean> {
|
||||||
await this.createUpdateButton.isEnabled();
|
return this.createUpdateButton.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCancelBtnIsEnabled(): Promise<void> {
|
async checkCancelBtnIsEnabled(): Promise<void> {
|
||||||
|
@@ -61,8 +61,7 @@ export class ShareDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getShareLink(): Promise<string> {
|
async getShareLink(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.shareLink);
|
return BrowserActions.getInputValue(this.shareLink);
|
||||||
return this.shareLink.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickCloseButton(): Promise<void> {
|
async clickCloseButton(): Promise<void> {
|
||||||
@@ -111,7 +110,7 @@ export class ShareDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getExpirationDate(): Promise<string> {
|
async getExpirationDate(): Promise<string> {
|
||||||
return this.expirationDateInput.getAttribute('value');
|
return BrowserActions.getInputValue(this.expirationDateInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
async expirationDateInputHasValue(value): Promise<void> {
|
async expirationDateInputHasValue(value): Promise<void> {
|
||||||
|
@@ -97,8 +97,7 @@ export class LoginShellPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkLoginImgURL(): Promise<string> {
|
async checkLoginImgURL(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoImg);
|
return BrowserActions.getAttribute(this.logoImg, 'src');
|
||||||
return this.logoImg.getAttribute('src');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkUsernameInactive(): Promise<void> {
|
async checkUsernameInactive(): Promise<void> {
|
||||||
@@ -148,7 +147,7 @@ export class LoginShellPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getShownPassword(): Promise<string> {
|
async getShownPassword(): Promise<string> {
|
||||||
return this.txtPassword.getAttribute('value');
|
return BrowserActions.getInputValue(this.txtPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkPasswordIsHidden(): Promise<void> {
|
async checkPasswordIsHidden(): Promise<void> {
|
||||||
|
@@ -134,7 +134,7 @@ export class MetadataViewPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getEditIconTooltip(): Promise<string> {
|
async getEditIconTooltip(): Promise<string> {
|
||||||
return this.editIcon.getAttribute('title');
|
return BrowserActions.getAttribute(this.editIcon, 'title');
|
||||||
}
|
}
|
||||||
|
|
||||||
async editPropertyIconIsDisplayed(propertyName: string) {
|
async editPropertyIconIsDisplayed(propertyName: string) {
|
||||||
@@ -176,7 +176,7 @@ export class MetadataViewPage {
|
|||||||
|
|
||||||
async getPropertyIconTooltip(propertyName: string): Promise<string> {
|
async getPropertyIconTooltip(propertyName: string): Promise<string> {
|
||||||
const editPropertyIcon = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
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> {
|
async clickMetadataGroup(groupName: string): Promise<void> {
|
||||||
@@ -196,14 +196,12 @@ export class MetadataViewPage {
|
|||||||
|
|
||||||
async checkMetadataGroupIsExpand(groupName: string): Promise<void> {
|
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'));
|
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 BrowserActions.getAttribute(group, 'class')).toContain('mat-expanded');
|
||||||
await expect(await group.getAttribute('class')).toContain('mat-expanded');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkMetadataGroupIsNotExpand(groupName: string): Promise<void> {
|
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'));
|
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 BrowserActions.getAttribute(group, 'class')).not.toContain('mat-expanded');
|
||||||
await expect(await group.getAttribute('class')).not.toContain('mat-expanded');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMetadataGroupTitle(groupName: string): Promise<string> {
|
async getMetadataGroupTitle(groupName: string): Promise<string> {
|
||||||
|
@@ -105,8 +105,7 @@ export class PeopleGroupCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getPreselectValidationStatus(): Promise<string> {
|
async getPreselectValidationStatus(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.preselectValidationStatus);
|
return BrowserActions.getAttribute(this.preselectValidationStatus, 'aria-checked');
|
||||||
return this.preselectValidationStatus.getAttribute('aria-checked');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickPeopleFilerByApp(): Promise<void> {
|
async clickPeopleFilerByApp(): Promise<void> {
|
||||||
|
@@ -42,8 +42,7 @@ export class ChecklistDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getNameFieldPlaceholder(): Promise<string> {
|
async getNameFieldPlaceholder(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.nameField);
|
return BrowserActions.getAttribute(this.nameField, 'data-placeholder');
|
||||||
return this.nameField.getAttribute('data-placeholder');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCancelButtonIsEnabled(): Promise<void> {
|
async checkCancelButtonIsEnabled(): Promise<void> {
|
||||||
|
@@ -58,8 +58,7 @@ export class StartTaskDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAssignee(): Promise<string> {
|
async getAssignee(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.assignee);
|
return BrowserActions.getAttribute(this.assignee, 'data-placeholder');
|
||||||
return this.assignee.getAttribute('data-placeholder');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectForm(form): Promise<void> {
|
async selectForm(form): Promise<void> {
|
||||||
|
@@ -205,8 +205,7 @@ export class TaskDetailsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDescriptionPlaceholder(): Promise<string> {
|
async getDescriptionPlaceholder(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(this.descriptionField);
|
return BrowserActions.getAttribute(this.descriptionField, 'data-placeholder');
|
||||||
return this.descriptionField.getAttribute('data-placeholder');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getDueDate(): Promise<string> {
|
getDueDate(): Promise<string> {
|
||||||
@@ -349,8 +348,7 @@ export class TaskDetailsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getInvolvePeoplePlaceholder(): Promise<string> {
|
async getInvolvePeoplePlaceholder(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.addPeopleField);
|
return BrowserActions.getAttribute(this.addPeopleField, 'data-placeholder');
|
||||||
return this.addPeopleField.getAttribute('data-placeholder');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCancelButtonIsEnabled(): Promise<void> {
|
async checkCancelButtonIsEnabled(): Promise<void> {
|
||||||
|
@@ -55,8 +55,7 @@ export class TaskListDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAppId(): Promise<string> {
|
async getAppId(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.appId);
|
return BrowserActions.getInputValue(this.appId);
|
||||||
return this.appId.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async typeTaskId(input: string): Promise<void> {
|
async typeTaskId(input: string): Promise<void> {
|
||||||
@@ -64,8 +63,7 @@ export class TaskListDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getTaskId(): Promise<string> {
|
async getTaskId(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.taskId);
|
return BrowserActions.getInputValue(this.taskId);
|
||||||
return this.taskId.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async typeTaskName(input: string): Promise<void> {
|
async typeTaskName(input: string): Promise<void> {
|
||||||
@@ -73,8 +71,7 @@ export class TaskListDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getTaskName(): Promise<string> {
|
async getTaskName(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.taskName);
|
return BrowserActions.getInputValue(this.taskName);
|
||||||
return this.taskName.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async typeItemsPerPage(input: number): Promise<void> {
|
async typeItemsPerPage(input: number): Promise<void> {
|
||||||
@@ -87,8 +84,7 @@ export class TaskListDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getProcessDefinitionId(): Promise<string> {
|
async getProcessDefinitionId(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.processInstanceId);
|
return BrowserActions.getInputValue(this.processInstanceId);
|
||||||
return this.processInstanceId.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async typeProcessInstanceId(input: string): Promise<void> {
|
async typeProcessInstanceId(input: string): Promise<void> {
|
||||||
@@ -96,8 +92,7 @@ export class TaskListDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getProcessInstanceId(): Promise<string> {
|
async getProcessInstanceId(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.processInstanceId);
|
return BrowserActions.getInputValue(this.processInstanceId);
|
||||||
return this.processInstanceId.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getItemsPerPageFieldErrorMessage(): Promise<string> {
|
async getItemsPerPageFieldErrorMessage(): Promise<string> {
|
||||||
@@ -111,8 +106,7 @@ export class TaskListDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getPage(): Promise<string> {
|
async getPage(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.page);
|
return BrowserActions.getInputValue(this.page);
|
||||||
return this.page.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPageFieldErrorMessage(): Promise<string> {
|
async getPageFieldErrorMessage(): Promise<string> {
|
||||||
|
@@ -299,6 +299,7 @@ exports.config = {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(`====== Demo shell not able to start ======`);
|
Logger.error(`====== Demo shell not able to start ======`);
|
||||||
|
Logger.error(error);
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -15,7 +15,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DataTableComponentPage, DatePickerCalendarPage, DateUtil, LocalStorageUtil, LoginPage } from '@alfresco/adf-testing';
|
import {
|
||||||
|
BrowserActions,
|
||||||
|
DataTableComponentPage,
|
||||||
|
DatePickerCalendarPage,
|
||||||
|
DateUtil,
|
||||||
|
LocalStorageUtil,
|
||||||
|
LoginPage
|
||||||
|
} from '@alfresco/adf-testing';
|
||||||
import { browser, ElementFinder } from 'protractor';
|
import { browser, ElementFinder } from 'protractor';
|
||||||
import { SearchBarPage } from '../pages/search-bar.page';
|
import { SearchBarPage } from '../pages/search-bar.page';
|
||||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||||
@@ -124,7 +131,7 @@ describe('Search Date Range Filter', () => {
|
|||||||
|
|
||||||
const results = await dataTable.geCellElementDetail('Created') as ElementFinder[];
|
const results = await dataTable.geCellElementDetail('Created') as ElementFinder[];
|
||||||
for (const currentResult of results) {
|
for (const currentResult of results) {
|
||||||
const currentDate = await currentResult.getAttribute('title');
|
const currentDate = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a');
|
const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a');
|
||||||
|
|
||||||
await expect(currentDateFormatted <= DateUtil.parse(toDate, 'DD-MM-YY')).toBe(true);
|
await expect(currentDateFormatted <= DateUtil.parse(toDate, 'DD-MM-YY')).toBe(true);
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiService,
|
ApiService, BrowserActions,
|
||||||
DataTableComponentPage,
|
DataTableComponentPage,
|
||||||
DateUtil,
|
DateUtil,
|
||||||
LocalStorageUtil,
|
LocalStorageUtil,
|
||||||
@@ -176,7 +176,7 @@ describe('Search Number Range Filter', () => {
|
|||||||
|
|
||||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||||
for (const currentResult of results) {
|
for (const currentResult of results) {
|
||||||
const currentSize = await currentResult.getAttribute('title');
|
const currentSize = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
|
|
||||||
if (currentSize && currentSize.trim() !== '') {
|
if (currentSize && currentSize.trim() !== '') {
|
||||||
await expect(parseInt(currentSize, 10) <= toSize).toBe(true);
|
await expect(parseInt(currentSize, 10) <= toSize).toBe(true);
|
||||||
@@ -206,7 +206,7 @@ describe('Search Number Range Filter', () => {
|
|||||||
|
|
||||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||||
for (const currentResult of results) {
|
for (const currentResult of results) {
|
||||||
const currentSize = await currentResult.getAttribute('title');
|
const currentSize = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
if (currentSize && currentSize.trim() !== '') {
|
if (currentSize && currentSize.trim() !== '') {
|
||||||
await expect(parseInt(currentSize, 10) <= toSize).toBe(true);
|
await expect(parseInt(currentSize, 10) <= toSize).toBe(true);
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ describe('Search Number Range Filter', () => {
|
|||||||
|
|
||||||
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||||
for (const currentResult of resultsSize) {
|
for (const currentResult of resultsSize) {
|
||||||
const currentSize = await currentResult.getAttribute('title');
|
const currentSize = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
if (currentSize && currentSize.trim() !== '') {
|
if (currentSize && currentSize.trim() !== '') {
|
||||||
await expect(parseInt(currentSize, 10) <= toSize).toBe(true);
|
await expect(parseInt(currentSize, 10) <= toSize).toBe(true);
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ describe('Search Number Range Filter', () => {
|
|||||||
|
|
||||||
const resultsDisplay = await dataTable.geCellElementDetail('Display name') as ElementFinder[];
|
const resultsDisplay = await dataTable.geCellElementDetail('Display name') as ElementFinder[];
|
||||||
for (const currentResult of resultsDisplay) {
|
for (const currentResult of resultsDisplay) {
|
||||||
const name = await currentResult.getAttribute('title');
|
const name = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
if (name && name.trim() !== '') {
|
if (name && name.trim() !== '') {
|
||||||
await expect(/z*/i.test(name)).toBe(true);
|
await expect(/z*/i.test(name)).toBe(true);
|
||||||
}
|
}
|
||||||
@@ -266,7 +266,7 @@ describe('Search Number Range Filter', () => {
|
|||||||
|
|
||||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||||
for (const currentResult of results) {
|
for (const currentResult of results) {
|
||||||
const currentSize = await currentResult.getAttribute('title');
|
const currentSize = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
if (currentSize && currentSize.trim() !== '') {
|
if (currentSize && currentSize.trim() !== '') {
|
||||||
await expect(currentSize === '0').toBe(true);
|
await expect(currentSize === '0').toBe(true);
|
||||||
}
|
}
|
||||||
@@ -305,7 +305,7 @@ describe('Search Number Range Filter', () => {
|
|||||||
|
|
||||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||||
for (const currentResult of results) {
|
for (const currentResult of results) {
|
||||||
const currentSize = await currentResult.getAttribute('title');
|
const currentSize = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
if (currentSize && currentSize.trim() !== '') {
|
if (currentSize && currentSize.trim() !== '') {
|
||||||
await expect(parseInt(currentSize, 10) <= 1000).toBe(true);
|
await expect(parseInt(currentSize, 10) <= 1000).toBe(true);
|
||||||
}
|
}
|
||||||
@@ -318,7 +318,7 @@ describe('Search Number Range Filter', () => {
|
|||||||
|
|
||||||
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||||
for (const currentResult of resultsSize) {
|
for (const currentResult of resultsSize) {
|
||||||
const currentSize = await currentResult.getAttribute('title');
|
const currentSize = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
if (currentSize && currentSize.trim() !== '') {
|
if (currentSize && currentSize.trim() !== '') {
|
||||||
await expect(parseInt(currentSize, 10) >= 1000).toBe(true);
|
await expect(parseInt(currentSize, 10) >= 1000).toBe(true);
|
||||||
}
|
}
|
||||||
@@ -409,7 +409,7 @@ describe('Search Number Range Filter', () => {
|
|||||||
|
|
||||||
const results = await dataTable.geCellElementDetail('Created') as ElementFinder[];
|
const results = await dataTable.geCellElementDetail('Created') as ElementFinder[];
|
||||||
for (const currentResult of results) {
|
for (const currentResult of results) {
|
||||||
const currentDate = await currentResult.getAttribute('title');
|
const currentDate = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a');
|
const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a');
|
||||||
|
|
||||||
await expect(currentDateFormatted.getFullYear() <= toYear).toBe(true);
|
await expect(currentDateFormatted.getFullYear() <= toYear).toBe(true);
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiService,
|
ApiService, BrowserActions,
|
||||||
DataTableComponentPage,
|
DataTableComponentPage,
|
||||||
LocalStorageUtil,
|
LocalStorageUtil,
|
||||||
LoginPage,
|
LoginPage,
|
||||||
@@ -127,7 +127,7 @@ describe('Search Slider Filter', () => {
|
|||||||
|
|
||||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||||
for (const currentResult of results) {
|
for (const currentResult of results) {
|
||||||
const currentSize = await currentResult.getAttribute('title');
|
const currentSize = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
|
|
||||||
if (currentSize && currentSize.trim() !== '') {
|
if (currentSize && currentSize.trim() !== '') {
|
||||||
await expect(parseInt(currentSize, 10) <= 5000).toBe(true);
|
await expect(parseInt(currentSize, 10) <= 5000).toBe(true);
|
||||||
@@ -141,7 +141,7 @@ describe('Search Slider Filter', () => {
|
|||||||
|
|
||||||
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||||
for (const currentResult of resultsSize) {
|
for (const currentResult of resultsSize) {
|
||||||
const currentSize = await currentResult.getAttribute('title');
|
const currentSize = await BrowserActions.getAttribute(currentResult, 'title');
|
||||||
|
|
||||||
if (currentSize && currentSize.trim() !== '') {
|
if (currentSize && currentSize.trim() !== '') {
|
||||||
await expect(parseInt(currentSize, 10) >= 5000).toBe(true);
|
await expect(parseInt(currentSize, 10) >= 5000).toBe(true);
|
||||||
|
@@ -37,7 +37,7 @@ export class DateRangeFilterPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFromDate(): Promise<string> {
|
async getFromDate(): Promise<string> {
|
||||||
return this.filter.element(this.fromField).getAttribute('value');
|
return BrowserActions.getInputValue(this.filter.element(this.fromField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async putFromDate(date): Promise<void> {
|
async putFromDate(date): Promise<void> {
|
||||||
@@ -91,7 +91,7 @@ export class DateRangeFilterPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getToDate(): Promise<string> {
|
async getToDate(): Promise<string> {
|
||||||
return this.filter.element(this.toField).getAttribute('value');
|
return BrowserActions.getInputValue(this.filter.element(this.toField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async putToDate(date): Promise<void> {
|
async putToDate(date): Promise<void> {
|
||||||
|
@@ -40,7 +40,7 @@ export class NumberRangeFilterPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFromNumber(): Promise<string> {
|
async getFromNumber(): Promise<string> {
|
||||||
return this.filter.element(this.fromInput).getAttribute('value');
|
return BrowserActions.getInputValue(this.filter.element(this.fromInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
async putFromNumber(value): Promise<void> {
|
async putFromNumber(value): Promise<void> {
|
||||||
@@ -75,7 +75,7 @@ export class NumberRangeFilterPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getToNumber(): Promise<string> {
|
async getToNumber(): Promise<string> {
|
||||||
return this.filter.element(this.toInput).getAttribute('value');
|
return BrowserActions.getInputValue(this.filter.element(this.toInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
async putToNumber(value): Promise<void> {
|
async putToNumber(value): Promise<void> {
|
||||||
|
@@ -65,12 +65,12 @@ export class SearchCategoriesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterIsCollapsed(filter: ElementFinder): Promise<void> {
|
async checkFilterIsCollapsed(filter: ElementFinder): Promise<void> {
|
||||||
const elementClass = await filter.getAttribute('class');
|
const elementClass = await BrowserActions.getAttribute(filter, 'class');
|
||||||
await expect(elementClass).not.toContain('mat-expanded');
|
await expect(elementClass).not.toContain('mat-expanded');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterIsExpanded(filter: ElementFinder): Promise<void> {
|
async checkFilterIsExpanded(filter: ElementFinder): Promise<void> {
|
||||||
const elementClass = await filter.getAttribute('class');
|
const elementClass = await BrowserActions.getAttribute(filter, 'class');
|
||||||
await expect(elementClass).toContain('mat-expanded');
|
await expect(elementClass).toContain('mat-expanded');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,15 +31,15 @@ export class SearchSliderPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getMaxValue() {
|
async getMaxValue() {
|
||||||
return this.filter.element(this.slider).getAttribute('aria-valuemax');
|
return BrowserActions.getAttribute(this.filter.element(this.slider), 'aria-valuemax');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMinValue() {
|
async getMinValue() {
|
||||||
return this.filter.element(this.slider).getAttribute('aria-valuemin');
|
return BrowserActions.getAttribute(this.filter.element(this.slider), 'aria-valuemin');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getValue() {
|
async getValue() {
|
||||||
return this.filter.element(this.slider).getAttribute('aria-valuenow');
|
return BrowserActions.getAttribute(this.filter.element(this.slider), 'aria-valuenow');
|
||||||
}
|
}
|
||||||
|
|
||||||
async setValue(value: number): Promise<void> {
|
async setValue(value: number): Promise<void> {
|
||||||
|
@@ -38,8 +38,7 @@ export class EditJsonDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDialogContent(): Promise<string> {
|
async getDialogContent(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialogContent);
|
return BrowserActions.getInputValue(this.dialogContent);
|
||||||
return this.dialogContent.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -216,7 +216,7 @@ export class DataTableComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getTooltip(columnName: string, columnValue: string): Promise<string> {
|
async getTooltip(columnName: string, columnValue: string): Promise<string> {
|
||||||
return this.getCellElementByValue(columnName, columnValue).getAttribute('title');
|
return BrowserActions.getAttribute(this.getCellElementByValue(columnName, columnValue), 'title');
|
||||||
}
|
}
|
||||||
|
|
||||||
async rightClickOnRowByIndex(index: number): Promise<void> {
|
async rightClickOnRowByIndex(index: number): Promise<void> {
|
||||||
@@ -295,7 +295,8 @@ export class DataTableComponentPage {
|
|||||||
async sortByColumn(sortOrder: string, titleColumn: string): Promise<void> {
|
async sortByColumn(sortOrder: string, titleColumn: string): Promise<void> {
|
||||||
const locator: Locator = by.css(`div[data-automation-id="auto_id_${titleColumn}"]`);
|
const locator: Locator = by.css(`div[data-automation-id="auto_id_${titleColumn}"]`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(locator));
|
await BrowserVisibility.waitUntilElementIsVisible(element(locator));
|
||||||
const result = await element(locator).getAttribute('class');
|
const result = await BrowserActions.getAttribute(element(locator), 'class');
|
||||||
|
|
||||||
if (sortOrder.toLocaleLowerCase() === 'asc') {
|
if (sortOrder.toLocaleLowerCase() === 'asc') {
|
||||||
if (!result.includes('sorted-asc')) {
|
if (!result.includes('sorted-asc')) {
|
||||||
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
||||||
|
@@ -88,7 +88,7 @@ export class FormFields {
|
|||||||
async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise<string> {
|
async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise<string> {
|
||||||
const placeHolderLocator = element(by.css(`${locator}#${fieldId}`));
|
const placeHolderLocator = element(by.css(`${locator}#${fieldId}`));
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
|
await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
|
||||||
return placeHolderLocator.getAttribute('data-placeholder');
|
return BrowserActions.getAttribute(placeHolderLocator, 'data-placeholder');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFieldValue(locator, field, val): Promise<void> {
|
async checkFieldValue(locator, field, val): Promise<void> {
|
||||||
|
@@ -80,7 +80,7 @@ export class AttachFileWidgetPage {
|
|||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
const fileAttached = await widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', fileName));
|
const fileAttached = await widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', fileName));
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||||
const id = await fileAttached.getAttribute('id');
|
const id = await BrowserActions.getAttribute(fileAttached, 'id');
|
||||||
const optionMenu = widget.element(by.css(`button[id='${id}-option-menu']`));
|
const optionMenu = widget.element(by.css(`button[id='${id}-option-menu']`));
|
||||||
await BrowserActions.click(optionMenu);
|
await BrowserActions.click(optionMenu);
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
|
import { BrowserActions } from '../../../utils/public-api';
|
||||||
import { Locator, by, element } from 'protractor';
|
import { Locator, by, element } from 'protractor';
|
||||||
|
|
||||||
export class CheckboxWidgetPage {
|
export class CheckboxWidgetPage {
|
||||||
@@ -43,12 +43,8 @@ export class CheckboxWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isCheckboxChecked(fieldId: string): Promise<boolean> {
|
async isCheckboxChecked(fieldId: string): Promise<boolean> {
|
||||||
let isChecked: boolean = false;
|
|
||||||
const checkboxWidget = await (await this.formFields.getWidget(fieldId)).element(this.checkboxLocator);
|
const checkboxWidget = await (await this.formFields.getWidget(fieldId)).element(this.checkboxLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(checkboxWidget);
|
const attributeValue = await BrowserActions.getAttribute(checkboxWidget, 'class');
|
||||||
await checkboxWidget.getAttribute('class').then((attributeValue) => {
|
return attributeValue.includes('mat-checkbox-checked');
|
||||||
isChecked = attributeValue.includes('mat-checkbox-checked');
|
|
||||||
});
|
|
||||||
return isChecked;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,7 @@ export class DynamicTableWidgetPage {
|
|||||||
await BrowserActions.closeMenuAndDialogs();
|
await BrowserActions.closeMenuAndDialogs();
|
||||||
await this.columnDateTime.sendKeys(randomText);
|
await this.columnDateTime.sendKeys(randomText);
|
||||||
await this.columnDateTime.sendKeys(protractor.Key.ENTER);
|
await this.columnDateTime.sendKeys(protractor.Key.ENTER);
|
||||||
return this.columnDateTime.getAttribute('value');
|
return BrowserActions.getInputValue(this.columnDateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
async addRandomStringOnDate(randomText: string): Promise<void> {
|
async addRandomStringOnDate(randomText: string): Promise<void> {
|
||||||
|
@@ -29,7 +29,7 @@ export class HyperlinkWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFieldHref(fieldId: string): Promise<string> {
|
async getFieldHref(fieldId: string): Promise<string> {
|
||||||
return this.formFields.getWidget(fieldId).element(this.fieldLocator).getAttribute('href');
|
return BrowserActions.getAttribute(this.formFields.getWidget(fieldId).element(this.fieldLocator), 'href');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFieldLabel(fieldId: string): Promise<string> {
|
async getFieldLabel(fieldId: string): Promise<string> {
|
||||||
|
@@ -17,21 +17,18 @@
|
|||||||
|
|
||||||
import { ElementFinder } from 'protractor';
|
import { ElementFinder } from 'protractor';
|
||||||
import { BrowserActions } from '../../utils/browser-actions';
|
import { BrowserActions } from '../../utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../utils/browser-visibility';
|
|
||||||
|
|
||||||
export class CheckboxPage {
|
export class CheckboxPage {
|
||||||
|
|
||||||
static async uncheck(el: ElementFinder) {
|
static async uncheck(el: ElementFinder) {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(el);
|
const classList = await BrowserActions.getAttribute(el, 'class');
|
||||||
const classList = await el.getAttribute('class');
|
|
||||||
if (classList && classList.indexOf('mat-checked') > -1) {
|
if (classList && classList.indexOf('mat-checked') > -1) {
|
||||||
await BrowserActions.click(el);
|
await BrowserActions.click(el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async check(el: ElementFinder) {
|
static async check(el: ElementFinder) {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(el);
|
const classList = await BrowserActions.getAttribute(el, 'class');
|
||||||
const classList = await el.getAttribute('class');
|
|
||||||
if (classList && classList.indexOf('mat-checked') === -1) {
|
if (classList && classList.indexOf('mat-checked') === -1) {
|
||||||
await BrowserActions.click(el);
|
await BrowserActions.click(el);
|
||||||
}
|
}
|
||||||
|
@@ -28,14 +28,14 @@ export class DatePickerCalendarPage {
|
|||||||
todayDate = element(by.css('.mat-calendar-body-today'));
|
todayDate = element(by.css('.mat-calendar-body-today'));
|
||||||
|
|
||||||
async getSelectedDate(): Promise<string> {
|
async getSelectedDate(): Promise<string> {
|
||||||
return element(by.css('td[class*="mat-calendar-body-active"]')).getAttribute('aria-label');
|
return BrowserActions.getAttribute(element(by.css('td[class*="mat-calendar-body-active"]')), 'aria-label');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkDatesAfterDateAreDisabled(date): Promise<void> {
|
async checkDatesAfterDateAreDisabled(date): Promise<void> {
|
||||||
const afterDate = DateUtil.formatDate('DD-MM-YY', date, 1);
|
const afterDate = DateUtil.formatDate('DD-MM-YY', date, 1);
|
||||||
const afterCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${afterDate}"]`));
|
const afterCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${afterDate}"]`));
|
||||||
if (await afterCalendar.isPresent()) {
|
if (await afterCalendar.isPresent()) {
|
||||||
const aria = await afterCalendar.getAttribute('aria-disabled');
|
const aria = await BrowserActions.getAttribute(afterCalendar, 'aria-disabled');
|
||||||
await expect(aria).toBe('true');
|
await expect(aria).toBe('true');
|
||||||
}
|
}
|
||||||
const isEnabled = await this.nextMonthButton.isEnabled();
|
const isEnabled = await this.nextMonthButton.isEnabled();
|
||||||
@@ -46,7 +46,7 @@ export class DatePickerCalendarPage {
|
|||||||
const beforeDate = DateUtil.formatDate('DD-MM-YY', date, -1);
|
const beforeDate = DateUtil.formatDate('DD-MM-YY', date, -1);
|
||||||
const beforeCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${beforeDate}"]`));
|
const beforeCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${beforeDate}"]`));
|
||||||
if (await beforeCalendar.isPresent()) {
|
if (await beforeCalendar.isPresent()) {
|
||||||
const aria = await beforeCalendar.getAttribute('aria-disabled');
|
const aria = await BrowserActions.getAttribute(beforeCalendar, 'aria-disabled');
|
||||||
await expect(aria).toBe('true');
|
await expect(aria).toBe('true');
|
||||||
}
|
}
|
||||||
const isEnabled = await this.previousMonthButton.isEnabled();
|
const isEnabled = await this.previousMonthButton.isEnabled();
|
||||||
|
@@ -30,7 +30,7 @@ export class TabsPage {
|
|||||||
|
|
||||||
async checkTabIsSelectedByTitle(tabTitle): Promise<void> {
|
async checkTabIsSelectedByTitle(tabTitle): Promise<void> {
|
||||||
const tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
|
const tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
|
||||||
const result = await tab.getAttribute('aria-selected');
|
const result = await BrowserActions.getAttribute(tab, 'aria-selected');
|
||||||
await expect(result).toBe('true');
|
await expect(result).toBe('true');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,14 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, ElementFinder } from 'protractor';
|
import { by, ElementFinder } from 'protractor';
|
||||||
import { BrowserVisibility } from '../../utils/browser-visibility';
|
|
||||||
import { BrowserActions } from '../../utils/browser-actions';
|
import { BrowserActions } from '../../utils/browser-actions';
|
||||||
|
|
||||||
export class TogglePage {
|
export class TogglePage {
|
||||||
|
|
||||||
async enableToggle(toggle: ElementFinder): Promise<void> {
|
async enableToggle(toggle: ElementFinder): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(toggle);
|
const check = await BrowserActions.getAttribute(toggle, 'class');
|
||||||
const check = await toggle.getAttribute('class');
|
|
||||||
if (check.indexOf('mat-checked') < 0) {
|
if (check.indexOf('mat-checked') < 0) {
|
||||||
const elem = toggle.all(by.css('input')).first();
|
const elem = toggle.all(by.css('input')).first();
|
||||||
await BrowserActions.clickScript(elem);
|
await BrowserActions.clickScript(elem);
|
||||||
@@ -31,8 +29,7 @@ export class TogglePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async disableToggle(toggle: ElementFinder): Promise<void> {
|
async disableToggle(toggle: ElementFinder): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(toggle);
|
const check = await BrowserActions.getAttribute(toggle, 'class');
|
||||||
const check = await toggle.getAttribute('class');
|
|
||||||
if (check.indexOf('mat-checked') >= 0) {
|
if (check.indexOf('mat-checked') >= 0) {
|
||||||
const elem = toggle.all(by.css('input')).first();
|
const elem = toggle.all(by.css('input')).first();
|
||||||
await BrowserActions.clickScript(elem);
|
await BrowserActions.clickScript(elem);
|
||||||
|
@@ -65,11 +65,11 @@ export class SettingsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getBpmHostUrl() {
|
async getBpmHostUrl() {
|
||||||
return this.bpmText.getAttribute('value');
|
return BrowserActions.getInputValue(this.bpmText);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getEcmHostUrl() {
|
async getEcmHostUrl() {
|
||||||
return this.ecmText.getAttribute('value');
|
return BrowserActions.getInputValue(this.ecmText);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setProviderEcmBpm() {
|
async setProviderEcmBpm() {
|
||||||
@@ -190,7 +190,7 @@ export class SettingsPage {
|
|||||||
async setSilentLogin(enableToggle) {
|
async setSilentLogin(enableToggle) {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.silentLoginToggleElement);
|
await BrowserVisibility.waitUntilElementIsVisible(this.silentLoginToggleElement);
|
||||||
|
|
||||||
const isChecked = (await this.silentLoginToggleElement.getAttribute('class')).includes('mat-checked');
|
const isChecked = (await BrowserActions.getAttribute(this.silentLoginToggleElement, 'class')).includes('mat-checked');
|
||||||
|
|
||||||
if (isChecked && !enableToggle || !isChecked && enableToggle) {
|
if (isChecked && !enableToggle || !isChecked && enableToggle) {
|
||||||
await BrowserActions.click(this.silentLoginToggleLabel);
|
await BrowserActions.click(this.silentLoginToggleLabel);
|
||||||
@@ -200,7 +200,7 @@ export class SettingsPage {
|
|||||||
async setImplicitFlow(enableToggle) {
|
async setImplicitFlow(enableToggle) {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.implicitFlowElement);
|
await BrowserVisibility.waitUntilElementIsVisible(this.implicitFlowElement);
|
||||||
|
|
||||||
const isChecked = (await this.implicitFlowElement.getAttribute('class')).includes('mat-checked');
|
const isChecked = (await BrowserActions.getAttribute(this.implicitFlowElement, 'class')).includes('mat-checked');
|
||||||
|
|
||||||
if (isChecked && !enableToggle || !isChecked && enableToggle) {
|
if (isChecked && !enableToggle || !isChecked && enableToggle) {
|
||||||
await BrowserActions.click(this.implicitFlowLabel);
|
await BrowserActions.click(this.implicitFlowLabel);
|
||||||
@@ -244,11 +244,12 @@ export class SettingsPage {
|
|||||||
|
|
||||||
async checkBasicAuthRadioIsSelected() {
|
async checkBasicAuthRadioIsSelected() {
|
||||||
const radioButton = this.getBasicAuthRadioButton();
|
const radioButton = this.getBasicAuthRadioButton();
|
||||||
await expect(await radioButton.getAttribute('class')).toContain('mat-radio-checked');
|
|
||||||
|
await expect(await BrowserActions.getAttribute(radioButton, 'class')).toContain('mat-radio-checked');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkSsoRadioIsNotSelected() {
|
async checkSsoRadioIsNotSelected() {
|
||||||
const radioButton = this.getSsoRadioButton();
|
const radioButton = this.getSsoRadioButton();
|
||||||
await expect(await radioButton.getAttribute('class')).not.toContain('mat-radio-checked');
|
await expect(await BrowserActions.getAttribute(radioButton, 'class')).not.toContain('mat-radio-checked');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -153,11 +153,11 @@ export class ViewerPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getCanvasWidth(): Promise<string> {
|
async getCanvasWidth(): Promise<string> {
|
||||||
return this.canvasLayer.getAttribute(`width`);
|
return BrowserActions.getAttribute(this.canvasLayer, `width`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCanvasHeight(): Promise<string> {
|
async getCanvasHeight(): Promise<string> {
|
||||||
return this.canvasLayer.getAttribute(`height`);
|
return BrowserActions.getAttribute(this.canvasLayer, `height`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDisplayedFileName(): Promise<string> {
|
async getDisplayedFileName(): Promise<string> {
|
||||||
@@ -204,14 +204,14 @@ export class ViewerPage {
|
|||||||
|
|
||||||
async checkAllThumbnailsDisplayed(nbPages): Promise<void> {
|
async checkAllThumbnailsDisplayed(nbPages): Promise<void> {
|
||||||
const defaultThumbnailHeight = 143;
|
const defaultThumbnailHeight = 143;
|
||||||
await expect(await this.thumbnailsContent.getAttribute('style')).toEqual('height: ' + nbPages * defaultThumbnailHeight + 'px; transform: translate(-50%, 0px);');
|
await expect(await BrowserActions.getAttribute(this.thumbnailsContent, 'style')).toEqual('height: ' + nbPages * defaultThumbnailHeight + 'px; transform: translate(-50%, 0px);');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCurrentThumbnailIsSelected(): Promise<void> {
|
async checkCurrentThumbnailIsSelected(): Promise<void> {
|
||||||
const selectedThumbnail = element(by.css('adf-pdf-thumb.adf-pdf-thumbnails__thumb.adf-pdf-thumbnails__thumb--selected > img'));
|
const selectedThumbnail = element(by.css('adf-pdf-thumb.adf-pdf-thumbnails__thumb.adf-pdf-thumbnails__thumb--selected > img'));
|
||||||
const pageNumber = await this.pageSelectorInput.getAttribute('value');
|
const pageNumber = await BrowserActions.getInputValue(this.pageSelectorInput);
|
||||||
|
|
||||||
await expect('Page ' + pageNumber).toEqual(await selectedThumbnail.getAttribute('title'));
|
await expect('Page ' + pageNumber).toEqual(await BrowserActions.getAttribute(selectedThumbnail, 'title'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkThumbnailsCloseIsDisplayed(): Promise<void> {
|
async checkThumbnailsCloseIsDisplayed(): Promise<void> {
|
||||||
@@ -239,11 +239,11 @@ export class ViewerPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getLastButtonTitle(): Promise<string> {
|
async getLastButtonTitle(): Promise<string> {
|
||||||
return this.lastButton.getAttribute('title');
|
return BrowserActions.getAttribute(this.lastButton, 'title');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMoreActionsMenuTitle(): Promise<string> {
|
async getMoreActionsMenuTitle(): Promise<string> {
|
||||||
return this.moreActionsMenu.getAttribute('title');
|
return BrowserActions.getAttribute(this.moreActionsMenu, 'title');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkDownloadButtonIsDisplayed(): Promise<void> {
|
async checkDownloadButtonIsDisplayed(): Promise<void> {
|
||||||
@@ -298,8 +298,7 @@ export class ViewerPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkPageSelectorInputIsDisplayed(checkNumber): Promise<void> {
|
async checkPageSelectorInputIsDisplayed(checkNumber): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorInput);
|
await expect(await BrowserActions.getInputValue(this.pageSelectorInput)).toEqual(checkNumber);
|
||||||
await expect(await this.pageSelectorInput.getAttribute('value')).toEqual(checkNumber);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkImgContainerIsDisplayed(): Promise<void> {
|
async checkImgContainerIsDisplayed(): Promise<void> {
|
||||||
@@ -355,7 +354,7 @@ export class ViewerPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkRotation(text): Promise<void> {
|
async checkRotation(text): Promise<void> {
|
||||||
const rotation = await this.imgContainer.getAttribute('style');
|
const rotation = await BrowserActions.getAttribute(this.imgContainer, 'style');
|
||||||
await expect(rotation).toEqual(text);
|
await expect(rotation).toEqual(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -138,6 +138,12 @@ export class TestElement {
|
|||||||
async isEnabled(): Promise<boolean> {
|
async isEnabled(): Promise<boolean> {
|
||||||
return this.elementFinder.isEnabled();
|
return this.elementFinder.isEnabled();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Query whether the DOM element represented by this instance is disabled.
|
||||||
|
*/
|
||||||
|
async isDisabled(): Promise<boolean> {
|
||||||
|
return !(await this.elementFinder.isEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether this element is currently displayed.
|
* Test whether this element is currently displayed.
|
||||||
@@ -153,11 +159,10 @@ export class TestElement {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Query for the value of the given attribute of the element.
|
* Query for the value of the given attribute of the element.
|
||||||
* @param name The name of the attribute to query.
|
* @param attributeName The name of the attribute to query.
|
||||||
*/
|
*/
|
||||||
async getAttribute(name: string): Promise<string> {
|
async getAttribute(attributeName: string): Promise<string> {
|
||||||
await this.waitVisible();
|
return BrowserActions.getAttribute(this.elementFinder, attributeName);
|
||||||
return this.elementFinder.getAttribute(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -91,6 +91,12 @@ export class BrowserActions {
|
|||||||
return browser.get(url, timeout);
|
return browser.get(url, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async getAttribute(elementFinder: ElementFinder, attribute: string): Promise<string> {
|
||||||
|
await BrowserVisibility.waitUntilElementIsPresent(elementFinder);
|
||||||
|
const attributeValue: string = await browser.executeScript(`return arguments[0].getAttribute(arguments[1])`, elementFinder, attribute);
|
||||||
|
return attributeValue || '';
|
||||||
|
}
|
||||||
|
|
||||||
static async getText(elementFinder: ElementFinder): Promise<string> {
|
static async getText(elementFinder: ElementFinder): Promise<string> {
|
||||||
Logger.info(`Get Text ${elementFinder.locator().toString()}`);
|
Logger.info(`Get Text ${elementFinder.locator().toString()}`);
|
||||||
|
|
||||||
@@ -123,7 +129,7 @@ export class BrowserActions {
|
|||||||
|
|
||||||
const present = await BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
const present = await BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
||||||
if (present) {
|
if (present) {
|
||||||
return elementFinder.getAttribute('value');
|
return browser.executeScript(`return arguments[0].value`, elementFinder);
|
||||||
} else {
|
} else {
|
||||||
Logger.error(`Get Input value ${elementFinder.locator().toString()} not present`);
|
Logger.error(`Get Input value ${elementFinder.locator().toString()} not present`);
|
||||||
return '';
|
return '';
|
||||||
@@ -145,12 +151,14 @@ export class BrowserActions {
|
|||||||
await elementFinder.click();
|
await elementFinder.click();
|
||||||
await elementFinder.sendKeys(protractor.Key.END);
|
await elementFinder.sendKeys(protractor.Key.END);
|
||||||
|
|
||||||
const value = await elementFinder.getAttribute('value');
|
const value: string = await browser.executeScript(`return arguments[0].value`, elementFinder);
|
||||||
|
if (value) {
|
||||||
for (let i = value.length; i >= 0; i--) {
|
for (let i = value.length; i >= 0; i--) {
|
||||||
await elementFinder.sendKeys(protractor.Key.BACK_SPACE);
|
await elementFinder.sendKeys(protractor.Key.BACK_SPACE);
|
||||||
await browser.sleep(sleepTime);
|
await browser.sleep(sleepTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static async clearSendKeys(elementFinder: ElementFinder, text: string = '', sleepTime: number = 0): Promise<void> {
|
static async clearSendKeys(elementFinder: ElementFinder, text: string = '', sleepTime: number = 0): Promise<void> {
|
||||||
Logger.info(`Clear and sendKeys text:${text} locator:${elementFinder.locator().toString()}`);
|
Logger.info(`Clear and sendKeys text:${text} locator:${elementFinder.locator().toString()}`);
|
||||||
@@ -177,14 +185,6 @@ export class BrowserActions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async checkIsDisabled(elementFinder: ElementFinder): Promise<void> {
|
|
||||||
Logger.info(`Check is disabled locator:${elementFinder.locator().toString()}`);
|
|
||||||
|
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
|
||||||
const valueCheck = await elementFinder.getAttribute('disabled');
|
|
||||||
await expect(valueCheck).toEqual('true');
|
|
||||||
}
|
|
||||||
|
|
||||||
static async rightClick(elementFinder: ElementFinder): Promise<void> {
|
static async rightClick(elementFinder: ElementFinder): Promise<void> {
|
||||||
Logger.info(`Right click locator:${elementFinder.locator().toString()}`);
|
Logger.info(`Right click locator:${elementFinder.locator().toString()}`);
|
||||||
|
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
import { browser, by, element, ElementFinder, protractor, until } from 'protractor';
|
import { browser, by, element, ElementFinder, protractor, until } from 'protractor';
|
||||||
import { Logger } from './logger';
|
import { Logger } from './logger';
|
||||||
|
import { falseIfMissing } from 'protractor/built/util';
|
||||||
|
|
||||||
export class BrowserVisibility {
|
export class BrowserVisibility {
|
||||||
|
|
||||||
@@ -89,7 +90,16 @@ export class BrowserVisibility {
|
|||||||
static async waitUntilElementHasValue(elementToCheck: ElementFinder, elementValue, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise<any> {
|
static async waitUntilElementHasValue(elementToCheck: ElementFinder, elementValue, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise<any> {
|
||||||
Logger.info(`Wait Until Element has value ${elementToCheck.locator().toString()} for ${waitTimeout}`);
|
Logger.info(`Wait Until Element has value ${elementToCheck.locator().toString()} for ${waitTimeout}`);
|
||||||
|
|
||||||
return browser.wait(protractor.ExpectedConditions.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, `Element doesn\'t have a value ${elementValue} ${elementToCheck.locator()}`);
|
return browser.wait(BrowserVisibility.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, `Element doesn\'t have a value ${elementValue} ${elementToCheck.locator()}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static textToBePresentInElementValue(elementFinder: ElementFinder, text: string) {
|
||||||
|
const hasText = async () => {
|
||||||
|
return browser.executeScript(`return arguments[0].value`, elementFinder).then((actualText: string) => {
|
||||||
|
return actualText.indexOf(text) > -1;
|
||||||
|
}, falseIfMissing);
|
||||||
|
};
|
||||||
|
return protractor.ExpectedConditions.and(protractor.ExpectedConditions.presenceOf(elementFinder), hasText);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -51,8 +51,7 @@ export class EditProcessFilterDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFilterName(): Promise<string> {
|
async getFilterName(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filterNameInput);
|
return BrowserActions.getInputValue(this.filterNameInput);
|
||||||
return this.filterNameInput.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async setFilterName(filterName: string): Promise<void> {
|
async setFilterName(filterName: string): Promise<void> {
|
||||||
|
@@ -51,8 +51,7 @@ export class EditTaskFilterDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFilterName(): Promise<string> {
|
async getFilterName(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filterNameInput);
|
return BrowserActions.getInputValue(this.filterNameInput);
|
||||||
return this.filterNameInput.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async setFilterName(filterName: string): Promise<void> {
|
async setFilterName(filterName: string): Promise<void> {
|
||||||
|
@@ -166,8 +166,7 @@ export class EditProcessFilterCloudComponentPage {
|
|||||||
|
|
||||||
async getProperty(property: string): Promise<string> {
|
async getProperty(property: string): Promise<string> {
|
||||||
const locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first();
|
const locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first();
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(locator);
|
return BrowserActions.getInputValue(locator);
|
||||||
return locator.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async setProperty(property: string, option: string): Promise<void> {
|
async setProperty(property: string, option: string): Promise<void> {
|
||||||
|
@@ -251,7 +251,7 @@ export class EditTaskFilterCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getId(): Promise<string> {
|
async getId(): Promise<string> {
|
||||||
return this.id.getAttribute('value');
|
return BrowserActions.getInputValue(this.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setTaskName(option: string): Promise<void> {
|
async setTaskName(option: string): Promise<void> {
|
||||||
@@ -259,7 +259,7 @@ export class EditTaskFilterCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getTaskName(): Promise<string> {
|
async getTaskName(): Promise<string> {
|
||||||
return this.taskName.getAttribute('value');
|
return BrowserActions.getInputValue(this.taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setProcessDefinitionId(option: string): Promise<void> {
|
async setProcessDefinitionId(option: string): Promise<void> {
|
||||||
@@ -267,7 +267,7 @@ export class EditTaskFilterCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getProcessDefinitionId(): Promise<string> {
|
async getProcessDefinitionId(): Promise<string> {
|
||||||
return this.processDefinitionId.getAttribute('value');
|
return BrowserActions.getInputValue(this.processDefinitionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setProcessInstanceId(option: string): Promise<void> {
|
async setProcessInstanceId(option: string): Promise<void> {
|
||||||
@@ -284,7 +284,7 @@ export class EditTaskFilterCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getProcessInstanceId(): Promise<string> {
|
async getProcessInstanceId(): Promise<string> {
|
||||||
return this.processInstanceId.getAttribute('value');
|
return BrowserActions.getInputValue(this.processInstanceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -66,8 +66,7 @@ export class AttachFileWidgetCloudPage {
|
|||||||
|
|
||||||
async getFileId(name: string): Promise<string> {
|
async getFileId(name: string): Promise<string> {
|
||||||
const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
return BrowserActions.getAttribute(fileAttached, 'id');
|
||||||
return fileAttached.getAttribute('id');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickActionMenu(fileName: string, actionName: string): Promise<void> {
|
async clickActionMenu(fileName: string, actionName: string): Promise<void> {
|
||||||
|
@@ -34,8 +34,7 @@ export class GroupCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getGroupsFieldContent(): Promise<string> {
|
async getGroupsFieldContent(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.groupCloudSearch);
|
return BrowserActions.getInputValue(this.groupCloudSearch);
|
||||||
return this.groupCloudSearch.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectGroupFromList(name: string): Promise<void> {
|
async selectGroupFromList(name: string): Promise<void> {
|
||||||
|
@@ -57,8 +57,7 @@ export class PeopleCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAssignee(): Promise<string> {
|
async getAssignee(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudSearch);
|
return BrowserActions.getInputValue(this.peopleCloudSearch);
|
||||||
return this.peopleCloudSearch.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getChipAssignee(): Promise<string> {
|
async getChipAssignee(): Promise<string> {
|
||||||
@@ -106,8 +105,7 @@ export class PeopleCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAssigneeFieldContent(): Promise<string> {
|
async getAssigneeFieldContent(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.assigneeField);
|
return BrowserActions.getInputValue(this.assigneeField);
|
||||||
return this.assigneeField.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getFieldLabel(fieldId: string): Promise<string> {
|
getFieldLabel(fieldId: string): Promise<string> {
|
||||||
|
@@ -50,8 +50,7 @@ export class StartProcessCloudPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getProcessName(): Promise<string> {
|
async getProcessName(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.processNameInput);
|
return BrowserActions.getInputValue(this.processNameInput);
|
||||||
return this.processNameInput.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectFromProcessDropdown(name: string): Promise<void> {
|
async selectFromProcessDropdown(name: string): Promise<void> {
|
||||||
|
@@ -52,8 +52,7 @@ export class StartProcessPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDefaultName(): Promise<string> {
|
async getDefaultName(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.defaultProcessName);
|
return BrowserActions.getInputValue(this.defaultProcessName);
|
||||||
return this.defaultProcessName.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteDefaultName() {
|
async deleteDefaultName() {
|
||||||
@@ -105,8 +104,7 @@ export class StartProcessPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getProcessDefinitionValue(): Promise<string> {
|
async getProcessDefinitionValue(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.processDefinition);
|
return BrowserActions.getInputValue(this.processDefinition);
|
||||||
return this.processDefinition.getAttribute('value');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickCancelProcessButton(): Promise<void> {
|
async clickCancelProcessButton(): Promise<void> {
|
||||||
@@ -139,9 +137,7 @@ export class StartProcessPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkSelectProcessPlaceholderIsDisplayed(): Promise<string> {
|
async checkSelectProcessPlaceholderIsDisplayed(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.processDefinition);
|
return BrowserActions.getInputValue(this.processDefinition);
|
||||||
const processPlaceholder = await this.processDefinition.getAttribute('value');
|
|
||||||
return processPlaceholder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkValidationErrorIsDisplayed(error: string, elementRef = 'mat-error'): Promise<void> {
|
async checkValidationErrorIsDisplayed(error: string, elementRef = 'mat-error'): Promise<void> {
|
||||||
|
34977
package-lock.json
generated
34977
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user