yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Form } from '../../e2elib/lib/src/pageobjects/form.component';
import { ListBase } from '../../libappbase/listbase';
import { ListRow } from '../../e2elib/lib/src/pageobjects/list/listrow.component';
 
export class FormOperations extends Form {
  public listOperations = new ListOperations();
  public constructor() {
    super('FormOperations');
  }
}
 
export class ListOperations extends ListBase {
  public constructor() {
    super('ListOperations');
  }
 
  public async getAllOperationRows(): Promise<ListRow[]> {
    return this.getAllRows();
  }
 
  /**
   * Get column cell value of pass-in row and column name
   *
   * @param row target that you want to retrieve column cell value
   * @param columnName Target column name
   */
  public async getOperationRowCellValue(row: ListRow, columnName: string): Promise<string> {
    const cell = await row.getCell(columnName);
    return cell.getValue();
  }
 
  /**
   * To verify is all pass-in operation rows is matched with expected values
   *
   * @param rowsToMatchValues Operation rows that need to satisfy expected values
   * @param expectedValues A string array that store a list of string values that need to be matched
   */
  public async verifyAllRowsSatisfyColumnValuesByUnit(rowsToMatchValues: ListRow[], expectedValues: string[]): Promise<boolean> {
    return this.rowHasValidValue(
      rowsToMatchValues,
      'Unit',
      expectedValues,
    );
  }
}