Lai,Risheng
2023-11-02 30c02e0c981b16be0918483543f4b812956c45d4
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
import { ViewBase } from '../../libappbase/viewbase';
import { UIWaitSOP } from '../../libappsop/objectsop';
import { AppMP } from '../appmp';
import { FormPriorities } from '../forms/form.priorities';
import { FormSalesLevel } from '../forms/form.saleslevel';
import { FormSalesSegment } from '../forms/form.salessegment';
 
/**
 * Sales > Sales Segments view.
 */
export class ViewSalesSegments extends ViewBase implements UIWaitSOP {
  public readonly name = 'View Sales Segments';
  public readonly viewPath = 'Sales > Sales Segments';
 
  // Forms
  public formPriorities = new FormPriorities();
  public formSalesLevel = new FormSalesLevel();
  public formSalesSegment = new FormSalesSegment();
 
  public async switchTo(): Promise<void> {
    const appMP = AppMP.getInstance();
 
    // wait until abp Sales is visible
    await appMP.abpSales.isVisible();
    // Open Sales action bar page
    await appMP.abpSales.click();
    // Click on the Sales Segment button
    await appMP.abpSales.btnSalesSegments.click();
 
    await this.waitUILoaded();
  }
 
  public async waitUILoaded(): Promise<void> {
    // Wait until forms present
    await this.formPriorities.waitUntilPresent();
    await this.formSalesLevel.waitUntilPresent();
    await this.formSalesSegment.waitUntilPresent();
  }
}