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
/**
 * @file        S&OP Form component to wrap common methods the team encounter during development
 * @description Form class extending libappbase's Form.
 * All S&OP page objects inherit from our own class (inheriting e2e/libappbase), but we can propose common methods to them.
 * @author      Clarence (clarence.chan@3ds.com)
 * @copyright   Dassault Systèmes
 */
import { ElementFinder } from '../e2elib/node_modules/protractor/built';
import { QForm } from '../e2elib/lib/api/pageobjects/qform.component';
 
export class FormSOP extends QForm {
  public constructor(componentPath: string, isCustomPath?: boolean, elementObj?: ElementFinder) {
    super(componentPath, isCustomPath, elementObj);
  }
 
  public async openDockedForm(): Promise<void> {
    // Check if form is close
    if (await this.isOpen(false)) {
      await this.restore();
    }
    await this.waitUntilPresent();
  }
 }
 
// Step description to re-use in spec file to prevent scriptor re-write each time
const stepForm = {
  clickPanel: (formName: string, panelName: string): string => `In form "${formName}", click the panel "${panelName}".`,
};
 
export { stepForm as StepForm };