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
import { ViewBase } from '../../libappbase/viewbase';
import { AppMP } from '../appmp';
import { FormUnitAccount } from '../forms/form.unitaccount';
import { FormUnitCost } from '../forms/form.unitcost';
import { ButtonFinancesContextMenuItem } from '../actionbarpages/abp.data';
 
/**
 * Data > Finances > Unit Costs view.
 */
export class ViewUnitCost extends ViewBase {
  public readonly name = 'Unit Costs';
  public readonly viewPath = 'Data > Finances > Unit Costs';
 
  public frmUnitAccount = new FormUnitAccount();
  public frmUnitCost = new FormUnitCost();
 
  /**
   * Switch to unit cost view
   */
  public async switchTo(): Promise<void> {
    const appMP = AppMP.getInstance();
 
    // wait until abp develop is visible
    await appMP.abpData.isVisible();
    // Open Develop action bar page
    await appMP.abpData.click();
    // Click on the Start Demo button
    await appMP.abpData.btnFinances.clickDropdownAndSelectMenu(ButtonFinancesContextMenuItem.UnitCosts);
    // Wait until form unit account and unit cost is present
    await this.frmUnitAccount.waitUntilPresent();
    await this.frmUnitCost.waitUntilPresent();
  }
}