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
46
47
48
import { ActionBarPage } from '../../e2elib/lib/src/pageobjects/actionbarpage.component';
import { ButtonSOP } from '../../libappsop/buttonsop';
import { FormPostponementSettings } from '../forms/form.postponementsettings';
 
export class ActionBarPageSales extends ActionBarPage {
  // Views
  public btnSalesSegments = new ButtonSOP('ButtonSalesSalesSegments');
  public btnForecasts = new ButtonSOP('ButtonSalesForecasts');
  public btnCustomerOrders = new ButtonSOP('ButtonSalesCustomerOrders');
 
  // Create edit delete buttons
  public btnCreate = new ButtonSOP('ButtonSalesCreate');
  public btnEdit = new ButtonSOP('ButtonSalesEdit');
  public btnDelete = new ButtonSOP('ButtonSalesDelete');
  // Forecasts and customer orders buttons
  public btnAdjustQuantity = new ButtonSOP('ButtonSalesAdjustQuantity');
  public btnPostponeForecast = new ButtonSOP('ButtonSalesPostpone');
 
  // Toggle right docked forms
  public btnFulfillmentTarget = new ButtonSOP('ButtonFulfillmentTargets');
  public btnPostponementSettings = new ButtonSOP('ButtonPostponementSettings');
 
  // Right docked forms
  public formPostponementSettings = new FormPostponementSettings();
 
  public constructor() {
    super('ActionBarPageSales');
  }
 
  /**
   * Toggle show right docked Postponement Settings form.
   *
   * @param show True to show, false to hide.
   */
  public async toggleShowPostponementSettings(show: boolean): Promise<void> {
    if (show !== await this.formPostponementSettings.isOpen()) {
      await this.btnPostponementSettings.click();
    }
  }
}
 
// Step description to re-use in spec file to prevent scriptor re-write each time
const stepActionBarSales = {
  hidePostponementSettingsRightDockedPanel: (): string => 'Click on action bar button Postponement Settings to hide right docked panel.',
  showPostponementSettingsRightDockedPanel: (): string => 'Click on action bar button Postponement Settings to display right docked panel.',
};
 
export { stepActionBarSales as StepActionBarSales };