| /** | 
|  * @file        ADSO-50544 | 
|  * @description Enable shift optimization in the optimizer strategies - UI | 
|  * @author      Clarence (ccn7@3ds.com) | 
|  * @copyright   Dassault Systèmes | 
|  */ | 
| import { qCustomMatcher } from '../../e2elib/lib/src/main/qmatchers.const'; | 
| import { AppMP, Demo, Scenario } from '../../libmp/appmp'; | 
| import { StepDialog } from '../../libappsop/dialogsop'; | 
| import { StepList } from '../../libappsop/listsop'; | 
| import { DataMetalStrategyName } from '../../libmp/data/data.strategy'; | 
| import { DialogStrategy } from '../../libmp/dialogs/dialog.strategy'; | 
| import { ListStrategy, ListStrategyContextMenuItem } from '../../libmp/forms/form.optimizerstrategies'; | 
|   | 
| describe('ADSO-50544 - Enable shift optimization in the optimizer strategies - UI', () => { | 
|   const appMP = AppMP.getInstance(); | 
|   const listStrategy = appMP.viewOptimizerStrategies.frmOptimizerStrategies.listStrategy; | 
|   let dlgStrategy: DialogStrategy; | 
|   | 
|   beforeAll(async () => { | 
|     jasmine.addMatchers(qCustomMatcher); | 
|     await appMP.login(); | 
|   }); | 
|   | 
|   afterAll(async () => { | 
|     await appMP.cleanupAndLogout(); | 
|   }); | 
|   | 
|   afterEach(async () => { | 
|     await appMP.checkToastMessage(); | 
|   }); | 
|   | 
|   it(`Setup - ${AppMP.getDemoDataPath(Demo.Metals, Scenario.Base)}`, async () => { | 
|     await appMP.createDemoDataset(Demo.Metals, Scenario.Base, false); | 
|   }); | 
|   | 
|   it(`Step 1 - Open view ${appMP.viewOptimizerStrategies.viewPath}.`, async () => { | 
|     await appMP.viewOptimizerStrategies.switchTo(); | 
|   }); | 
|   | 
|   it(`Step 2 - ${StepList.selectRowAndClickMenu(ListStrategy.title, {Name: DataMetalStrategyName.Default}, ListStrategyContextMenuItem.Edit.Label)}`, async () => { | 
|     const row = await listStrategy.getRow({Name: DataMetalStrategyName.Default}); | 
|     [dlgStrategy] = await listStrategy.selectContextMenu(ListStrategyContextMenuItem.Edit, row); | 
|   }); | 
|   | 
|   it(`Step 3 - ${StepDialog.clickTab('Advanced')}`, async () => { | 
|     await dlgStrategy.panelAdvanced.clickTab(); | 
|   }); | 
|   | 
|   it(`Step 4 - ${StepDialog.verifyDialogValues(DialogStrategy.title, {UseShiftPatternOptimization: 'false'})}`, async () => { | 
|     // Verify default, shift pattern optimization toggled off | 
|     await dlgStrategy.verifyDialogValues({UseShiftPatternOptimization: 'false'}); | 
|   }); | 
|   | 
|   it(`Step 5 - ${StepDialog.updateDialogValues(DialogStrategy.title, {UseShiftPatternOptimization: 'true'})} ${StepDialog.clickOK()}`, async () => { | 
|     await dlgStrategy.updateDialogValues({UseShiftPatternOptimization: 'true'}); | 
|     await dlgStrategy.clickOK(); | 
|   }); | 
|   | 
|   it(`Step 6 - ${StepList.selectRowAndClickMenu(ListStrategy.title, {Name: DataMetalStrategyName.Default}, ListStrategyContextMenuItem.Edit.Label)}`, async () => { | 
|     const row = await listStrategy.getRow({Name: DataMetalStrategyName.Default}); | 
|     [dlgStrategy] = await listStrategy.selectContextMenu(ListStrategyContextMenuItem.Edit, row); | 
|   }); | 
|   | 
|   it(`Step 7 - ${StepDialog.clickTab('Advanced')}`, async () => { | 
|     await dlgStrategy.panelAdvanced.clickTab(); | 
|   }); | 
|   | 
|   it(`Step 8 - ${StepDialog.verifyDialogValues(DialogStrategy.title, {UseShiftPatternOptimization: 'true'})}`, async () => { | 
|     await dlgStrategy.verifyDialogValues({UseShiftPatternOptimization: 'true'}); | 
|   }); | 
|   | 
|   it(`Step 9 - ${StepDialog.updateDialogValues(DialogStrategy.title, {UseShiftPatternOptimization: 'false'})} ${StepDialog.clickOK()}`, async () => { | 
|     await dlgStrategy.updateDialogValues({UseShiftPatternOptimization: 'false'}); | 
|     await dlgStrategy.clickOK(); | 
|   }); | 
|   | 
|   it(`Step 10 - ${StepList.selectRowAndClickMenu(ListStrategy.title, {Name: DataMetalStrategyName.Default}, ListStrategyContextMenuItem.Edit.Label)}`, async () => { | 
|     const row = await listStrategy.getRow({Name: DataMetalStrategyName.Default}); | 
|     [dlgStrategy] = await listStrategy.selectContextMenu(ListStrategyContextMenuItem.Edit, row); | 
|   }); | 
|   | 
|   it(`Step 11 - ${StepDialog.clickTab('Advanced')}`, async () => { | 
|     await dlgStrategy.panelAdvanced.clickTab(); | 
|   }); | 
|   | 
|   it(`Step 12 - ${StepDialog.verifyDialogValues(DialogStrategy.title, {UseShiftPatternOptimization: 'false'})} ${StepDialog.clickCancel()}`, async () => { | 
|     await dlgStrategy.verifyDialogValues({UseShiftPatternOptimization: 'false'}); | 
|     await dlgStrategy.clickCancel(); | 
|   }); | 
| }); |