[ACS-6071] fix jsdoc warnings and errors (#8948)

* fix content docs

* fix extensions docs

* fix insights docs

* [ci:force] fix jsdoc errors and warnings

* enable jsdoc linter

* [ci:force] fix demo shell jsdoc

* [ci:force] fix e2e typings

* fix typo

* fix typo
This commit is contained in:
Denys Vuika
2023-09-29 08:11:58 +01:00
committed by GitHub
parent 501516c8f5
commit d72eb5ebd3
86 changed files with 1233 additions and 254 deletions

View File

@@ -46,7 +46,7 @@ export class DocumentListPage {
await this.dataTable.selectRow('Display name', nodeName);
}
/** @deprecated Use Playwright API instead */
// @deprecated Use Playwright API instead
async selectRowsWithKeyboard(...contentNames: string[]): Promise<void> {
let option: any;
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();

View File

@@ -21,7 +21,6 @@ import { StringUtil } from '../../../shared/utils/string.util';
* Create tenant JSON Object
*
* @param details - JSON object used to overwrite the default values
* @constructor
*/
export class Tenant {

View File

@@ -132,20 +132,20 @@ export class DataTableComponentPage {
/**
* Check the list is sorted.
*
* @param sortOrder: 'ASC' if the list is await expected to be sorted ascending and 'DESC' for descending
* @param columnTitle: titleColumn column
* @param listType: 'string' for string typed lists and 'number' for number typed (int, float) lists
* @return 'true' if the list is sorted as await expected and 'false' if it isn't
* @param sortOrder 'ASC' if the list is await expected to be sorted ascending and 'DESC' for descending
* @param columnTitle titleColumn column
* @param listType 'string' for string typed lists and 'number' for number typed (int, float) lists
* @returns 'true' if the list is sorted as await expected and 'false' if it isn't
*/
async checkListIsSorted(sortOrder: string, columnTitle: string, listType: string = 'STRING'): Promise<any> {
const column = $$(`div.adf-datatable-cell[title='${columnTitle}'] span`);
await BrowserVisibility.waitUntilElementIsVisible(column.first());
const initialList = [];
const initialList: string[] = [];
const length = await column.count();
for (let i = 0; i < length; i++) {
const text = await BrowserActions.getText(column.get(i));
const text: string = await BrowserActions.getText(column.get(i));
if (text.length !== 0) {
initialList.push(text.toLowerCase());
}
@@ -155,7 +155,7 @@ export class DataTableComponentPage {
if (listType.toLocaleLowerCase() === 'string') {
sortedList = sortedList.sort();
} else if (listType.toLocaleLowerCase() === 'number') {
sortedList = sortedList.sort((a, b) => a - b);
sortedList = sortedList.sort((a, b) => parseInt(a, 10) - parseInt(b, 10));
} else if (listType.toLocaleLowerCase() === 'priority') {
sortedList = sortedList.sort(this.sortPriority);
}
@@ -259,7 +259,7 @@ export class DataTableComponentPage {
await BrowserVisibility.waitUntilElementIsVisible(this.tableBody);
}
/** @deprecated Use Playwright API instead */
// @deprecated Use Playwright API instead
async getFirstElementDetail(detail: string): Promise<string> {
const firstNode = $$(`adf-datatable div[title="${detail}"] span`).first();
return BrowserActions.getText(firstNode);
@@ -268,7 +268,8 @@ export class DataTableComponentPage {
/**
* Sort the list by name column.
*
* @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant
* @param sortOrder 'ASC' to sort the list ascendant and 'DESC' for descendant
* @param titleColumn column title
*/
async sortByColumn(sortOrder: string, titleColumn: string): Promise<void> {
const locator = $(`div[data-automation-id="auto_id_${titleColumn}"]`);
@@ -327,7 +328,7 @@ export class DataTableComponentPage {
return this.rootElement.all(by.xpath(`//div[starts-with(@title, '${columnName}')]//div[contains(@data-automation-id, '${columnValue}')]//ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row')]`)).first();
}
/** @deprecated use Playwright instead **/
// @deprecated use Playwright instead
getRowByIndex(index: number): ElementFinder {
return this.rootElement.element(by.xpath(`//div[contains(@class,'adf-datatable-body')]//adf-datatable-row[contains(@class,'adf-datatable-row')][${index}]`));
}
@@ -400,7 +401,7 @@ export class DataTableComponentPage {
}
}
/** @deprecated use Playwright instead **/
// @deprecated use Playwright instead
async isColumnDisplayed(columnTitle: string): Promise<boolean> {
const isColumnDisplayed = (await this.allColumns).some(
async column => {
@@ -412,7 +413,7 @@ export class DataTableComponentPage {
return isColumnDisplayed;
}
/** @deprecated use Playwright instead **/
// @deprecated use Playwright instead
async getNumberOfColumns(): Promise<number> {
return this.allColumns.count();
}

View File

@@ -30,6 +30,7 @@ export class TestElement {
* Create a new instance with the element located by the id
*
* @param id The id of the element
* @returns test element wrapper
*/
static byId(id: string): TestElement {
return new TestElement(element(by.id(id)));
@@ -39,6 +40,7 @@ export class TestElement {
* Create a new instance with the element located by the CSS class name
*
* @param selector The CSS class name to lookup
* @returns test element wrapper
*/
static byCss(selector: string): TestElement {
return new TestElement($(selector));
@@ -49,6 +51,7 @@ export class TestElement {
*
* @param selector the CSS selector
* @param text the text within the target element
* @returns test element wrapper
*/
static byText(selector: string, text: string): TestElement {
return new TestElement(element(by.cssContainingText(selector, text)));
@@ -58,6 +61,7 @@ export class TestElement {
* Create a new instance with the element with specific HTML tag name
*
* @param selector the HTML tag name
* @returns test element wrapper
*/
static byTag(selector: string): TestElement {
return new TestElement(element(by.tagName(selector)));
@@ -186,6 +190,8 @@ export class TestElement {
/**
* Gets the `value` attribute for the given input element
*
* @returns input value
*/
getInputValue(): Promise<string> {
return BrowserActions.getInputValue(this.elementFinder);

View File

@@ -20,9 +20,9 @@ export class ArrayUtil {
/**
* Returns TRUE if the first array contains all elements from the second one.
*
* @param superset
* @param subset
*
* @param superset source array
* @param subset target array
* @returns `true` if array is included, otherwise `false`
*/
static arrayContainsArray(superset: any[], subset: any[]): boolean {
if (0 === subset.length) {

View File

@@ -22,6 +22,8 @@ import { ElementFinder, browser } from 'protractor';
*
* @example ```const item = byCss`.adf-breadcrumb-item-current`;```
* @example ```const item = byCss`${variable}`;```
* @param literals literals
* @param placeholders placeholders
* @returns Instance of `ElementFinder` type.
*/
export const byCss = (literals: TemplateStringsArray, ...placeholders: string[]): ElementFinder => {

View File

@@ -47,6 +47,8 @@ export class ApiService {
/**
* Login using one of the account profiles from the `browser.params.testConfig`.
* Example: loginWithProfile('admin')
*
* @param profileName profile name
*/
async loginWithProfile(profileName: string): Promise<void> {
const profile = this.config.users[profileName];
@@ -64,7 +66,7 @@ export class ApiService {
}
}
/** @deprecated */
// @deprecated
async performBpmOperation(path: string, method: string, queryParams: any, postBody: any): Promise<any> {
return new Promise((resolve, reject) => {
const uri = this.config.appConfig.hostBpm + path;
@@ -85,7 +87,7 @@ export class ApiService {
});
}
/** @deprecated */
// @deprecated
async performIdentityOperation(path: string, method: string, queryParams: any, postBody: any): Promise<any> {
return new Promise((resolve, reject) => {
const uri = this.config.appConfig.oauth2.host.replace('/realms', '/admin/realms') + path;
@@ -106,7 +108,7 @@ export class ApiService {
});
}
/** @deprecated */
// @deprecated
async performECMOperation(path: string, method: string, queryParams: any, postBody: any): Promise<any> {
return new Promise((resolve, reject) => {
const uri = this.config.appConfig.hostEcm + path;

View File

@@ -30,6 +30,7 @@ export class StringUtil {
* Generates a random string.
*
* @param length If this parameter is not provided the length is set to 8 by default.
* @returns random string
*/
static generateRandomString(length: number = 8): string {
return StringUtil.generateRandomCharset(length, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789');
@@ -39,6 +40,7 @@ export class StringUtil {
* Generates a random lowercase string.
*
* @param length If this parameter is not provided the length is set to 8 by default.
* @returns random string
*/
static generateRandomLowercaseString(length: number = 8): string {
return StringUtil.generateRandomCharset(length, 'abcdefghijklmnopqrstuvwxyz0123456789');
@@ -47,8 +49,9 @@ export class StringUtil {
/**
* Generates a random email address following the format: abcdef@activiti.test.com
*
* @param domain
* @param length
* @param domain email domain
* @param length email length
* @returns email address
*/
static generateRandomEmail(domain: string, length: number = 5): string {
let email = StringUtil.generateRandomCharset(length, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789');
@@ -59,7 +62,8 @@ export class StringUtil {
/**
* Generates a random string - digits only.
*
* @param length {int} If this parameter is not provided the length is set to 8 by default.
* @param length If this parameter is not provided the length is set to 8 by default.
* @returns random string
*/
static generateRandomStringDigits(length: number = 8): string {
return StringUtil.generateRandomCharset(length, '0123456789');
@@ -68,7 +72,8 @@ export class StringUtil {
/**
* Generates a random string - non-latin characters only.
*
* @param length {int} If this parameter is not provided the length is set to 3 by default.
* @param length If this parameter is not provided the length is set to 3 by default.
* @returns random string
*/
static generateRandomStringNonLatin(length: number = 3): string {
return StringUtil.generateRandomCharset(length, '密码你好𠮷');
@@ -79,6 +84,7 @@ export class StringUtil {
*
* @param length If this parameter is not provided the length is set to 8 by default.
* @param charSet to use
* @returns random string
*/
static generateRandomCharset(length: number = 8, charSet: string): string {
let text = '';
@@ -93,11 +99,11 @@ export class StringUtil {
/**
* Generates a sequence of files with name: baseName + index + extension (e.g.) baseName1.txt, baseName2.txt, ...
*
* @param startIndex
* @param endIndex
* @param startIndex start index
* @param endIndex end index
* @param baseName the base name of all files
* @param extension the extension of the file
* @return fileNames
* @returns list of file names
*/
static generateFilesNames(startIndex: number, endIndex: number, baseName: string, extension: string): string [] {
const fileNames: string[] = [];
@@ -107,17 +113,21 @@ export class StringUtil {
return fileNames;
}
/** Generates a random name for a process
/**
* Generates a random name for a process
*
* @param length {int} If this parameter is not provided the length is set to 5 by default.
* @returns process name
*/
static generateProcessName(length: number = 5): string {
return 'process_' + StringUtil.generateRandomString(length);
}
/** Generates a random name for a process
/**
* Generates a random name for a user task
*
* @param length {int} If this parameter is not provided the length is set to 5 by default.
* @param length If this parameter is not provided the length is set to 5 by default.
* @returns task name
*/
static generateUserTaskName(length: number = 5): string {
return 'userTask_' + StringUtil.generateRandomString(length);