mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-2380] refactor actions-available tests (#1144)
* compare arrays of actions instead of checking the available actions one by one add more tests for more file types reorganise and separate test files use correct capitalisation of “Leave Library”, according to ACA-2473 add some try catch blocks * fix test and rebalance suites * remove hidden old info button - that exists in DOM, even though hidden, after fix of [ACA-2288] issue * change actions order after ACA-2649
This commit is contained in:
committed by
Cilibiu Bogdan
parent
1bcb29473d
commit
b0121f06f8
@@ -235,20 +235,29 @@ export class DataTable extends Component {
|
||||
const item = this.getRowFirstCell(name, location);
|
||||
await Utils.waitUntilElementClickable(item);
|
||||
await browser.actions().mouseMove(item).perform();
|
||||
await browser.actions().click().click().perform();
|
||||
await browser.actions().doubleClick().perform();
|
||||
} catch (error) {
|
||||
console.log('--- catch: doubleClickOnRowByName', error);
|
||||
}
|
||||
}
|
||||
|
||||
async selectItem(name: string, location: string = '') {
|
||||
try{
|
||||
const item = this.getRowFirstCell(name, location);
|
||||
await item.click();
|
||||
const isSelected = await this.hasCheckMarkIcon(name, location);
|
||||
if (!isSelected) {
|
||||
try {
|
||||
const item = this.getRowFirstCell(name, location);
|
||||
await item.click();
|
||||
|
||||
} catch (e) {
|
||||
console.log('--- select item catch : ', e);
|
||||
} catch (e) {
|
||||
console.log('--- select item catch : ', e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async clickItem(name: string, location: string = '') {
|
||||
const item = this.getRowFirstCell(name, location);
|
||||
await item.click();
|
||||
}
|
||||
|
||||
async clickNameLink(itemName: string) {
|
||||
|
@@ -127,6 +127,13 @@ export class Menu extends Component {
|
||||
return await this.items.count();
|
||||
}
|
||||
|
||||
async getMenuItems(): Promise<string[]> {
|
||||
return this.items.map(async (elem) => {
|
||||
const text = await elem.element(by.css('span')).getText();
|
||||
return text;
|
||||
});
|
||||
}
|
||||
|
||||
async clickNthItem(nth: number) {
|
||||
try {
|
||||
const elem = this.getNthItem(nth);
|
||||
|
@@ -43,7 +43,7 @@ export class Toolbar extends Component {
|
||||
print: `.mat-icon-button[title='Print']`,
|
||||
fullScreen: `.mat-icon-button[title='Activate full-screen mode']`,
|
||||
joinLibrary: `.mat-icon-button[title='Join']`,
|
||||
leaveLibrary: `.mat-icon-button[title='Leave library']`,
|
||||
leaveLibrary: `.mat-icon-button[title='Leave Library']`,
|
||||
permanentlyDelete: `.mat-icon-button[title='Permanently Delete']`,
|
||||
restore: `.mat-icon-button[title='Restore']`
|
||||
};
|
||||
@@ -77,6 +77,12 @@ export class Toolbar extends Component {
|
||||
return await this.buttons.count();
|
||||
}
|
||||
|
||||
async getButtons(): Promise<string[]> {
|
||||
return this.buttons.map(async elem => {
|
||||
return await elem.getAttribute('title');
|
||||
});
|
||||
}
|
||||
|
||||
async isButtonPresent(title: string) {
|
||||
const elem = this.component.element(by.css(`${Toolbar.selectors.button}[title="${title}"]`));
|
||||
return await elem.isPresent();
|
||||
|
Reference in New Issue
Block a user