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
/**
 * S&OP interface for UI element that has following behaviors:
 * - Receives user input to set into component
 * - Verify component value is as user expected value
 * S&OP custom page objects in libappsop (e.g dialogsop, editfieldsop) implements this interface so that
 * reusable logic can be centralized instead of spec files (and page objects) re-implementing the logic over and over.
 */
export interface UIActionSOP {
  clickActionLinkText(expectedActionLinkText: string): Promise<void>;
  getValueString(): Promise<string>; // cannot use getValue() as numberpicker uses getValue()
  setValue(value?: string): Promise<void>;
  toggleValue?(): Promise<void>;
  verifyBatchEditEnabled(expectedEnabled: boolean, expectedActionLinkText: string): Promise<void>;
  verifyTooltip(expectedValue: string): Promise<void>;
  verifyEnabled(expectedValue: boolean, expectedDisabledTooltip?: string): Promise<void>;
  verifyHasMaskError(expectedValue: boolean): Promise<void>;
  verifyValue(expectedValue?: string): Promise<void>;
  verifyVisible(expectedValue?: string): Promise<void>;
}
 
/**
 * S&OP interface for UI element that needs to wait for other elements to be loaded.
 * For example: View that has multiple forms thus need wait for them present.
 */
export interface UIWaitSOP {
  /**
   * Navigate web UI to open view (waiting for UI loaded to be handled via separate method waitUILoaded.
   * Making this optional for now so that other views not impacted, BUT future to refactor all views to
   * must implement this and we can then safely remove the optional (?).
   */
  openView?(): Promise<void>;
 
  /**
   * Wait UI loaded (e.g for view waiting its forms to be present)
   */
  waitUILoaded(): Promise<void>;
}