limj
2023-10-24 93652435728de839582440eefd5122c281181d35
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
import { AppMP } from '../appmp';
import { ViewBase } from '../../libappbase/viewbase';
import { UIWaitSOP } from '../../libappsop/objectsop';
import { FormCampaign } from '../forms/form.campaign';
import { FormCampaignPlanning } from '../forms/form.campaignplanning';
import { FormCampaignTypesReadOnly } from '../forms/form.campaigntypesreadonly';
 
export class ViewCampaigns extends ViewBase implements UIWaitSOP {
  public readonly name = 'Campaign planning';
  public readonly viewPath = 'Plan > Campaigns';
 
  public formCampaign = new FormCampaign();
  public formCampaignType = new FormCampaignTypesReadOnly();
  public formCampaignPlanning = new FormCampaignPlanning();
 
  public async switchTo(): Promise<void> {
    const appMp = AppMP.getInstance();
    // Click Plan action bar page
    await appMp.abpPlan.click();
    await appMp.abpPlan.btnCampaign.click();
    await this.waitUILoaded();
  }
 
  public async waitUILoaded(): Promise<void> {
    await this.formCampaignType.waitUntilPresent();
    await this.formCampaign.waitUntilPresent();
    await this.formCampaignPlanning.waitUntilPresent();
  }
}