| import { WebMessageBox } from '../../libappbase/webmessagebox'; | 
| import { Timeout } from '../appmp'; | 
| import { DialogBase } from '../../libappbase/dialogbase'; | 
| import { DropDownStringListSOP } from '../../libappsop/dropdownstringlistsop'; | 
|   | 
| export class DialogSelectDemoDataset extends DialogBase { | 
|   private readonly _ddStringListSelectDemo = new DropDownStringListSOP('DropDownStringListCategory'); | 
|   private readonly _ddStringListSelectScenario = new DropDownStringListSOP('DropDownStringListScenario'); | 
|   private readonly _webMessageBox = new WebMessageBox(); | 
|   | 
|   public constructor() { | 
|     super('DialogSelectDemoDataset', 'btnOk', 'btnCancel'); | 
|   } | 
|   | 
|   public async selectDemoDataset(demo: string, scenario: string): Promise<void> { | 
|     // select demo and scenario | 
|     await this.waitUntilPresent(); | 
|     await this._ddStringListSelectDemo.selectItem(demo); | 
|     await this._ddStringListSelectScenario.selectItem(scenario); | 
|     // Do not use DialogBase.clickOK. | 
|     // In this case, there will be a confirmation message box to check before closing the demo data dialog. | 
|     // Hence, check waitUntilHidden after closing confirmation message box. | 
|     await this.btnOk.click(); | 
|   | 
|     // select yes for the confirmation | 
|     await this._webMessageBox.waitUntilPresent(false); | 
|     await this._webMessageBox.selectYes(); | 
|     await this._webMessageBox.waitUntilHidden(Timeout.Short); | 
|     await this.waitUntilHidden(Timeout.Medium); | 
|   } | 
| } |