| 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(); | 
|   } | 
| } |