/** 
 | 
 * @file        ADSO-9811 
 | 
 * @description Cannot define more than 24 hours of capacity 
 | 
 * @author      Pethaperumal Natarajan (Pethaperumal.NATARAJAN.intern@3ds.com) 
 | 
 * @copyright   Dassault Systèmes 
 | 
 */ 
 | 
  
 | 
import { AppMP, Demo, Scenario } from '../../libmp/appmp'; 
 | 
import { qCustomMatcher } from '../../e2elib/lib/src/main/qmatchers.const'; 
 | 
import { CellLocator } from '../../libappbase/matrixeditorbase'; 
 | 
import { DataMetalBaseShiftPattern } from '../../libmp/data/data.shiftpattern'; 
 | 
import { monday } from '../../libmp/data/data.period'; 
 | 
import { StepMatrix } from '../../libappsop/matrixeditorsop'; 
 | 
import { MatrixEditorShiftPattern, toastMatrixEditorShiftPattern } from '../../libmp/forms/form.shiftpattern'; 
 | 
import { StepToast, ToastSOP } from '../../libappsop/toastsop'; 
 | 
  
 | 
describe('ADSO-9811 - Cannot define more than 24 hours of capacity', () => { 
 | 
  const appMP = AppMP.getInstance(); 
 | 
  const meShiftPatterns = appMP.viewCapacitiesTime.formShiftPattern.meShiftPattern; 
 | 
  const toast = new ToastSOP(); 
 | 
  
 | 
  const cellLocation1: CellLocator = { columnName: monday, rowName: DataMetalBaseShiftPattern.SixteenTimesFive }; 
 | 
  
 | 
  const inputExceeded = '25:00'; 
 | 
  const inputNotExceeded = '17:00'; 
 | 
  
 | 
  beforeAll(async () => { 
 | 
    jasmine.addMatchers(qCustomMatcher); 
 | 
    await appMP.login(); 
 | 
  }); 
 | 
  
 | 
  afterAll(async () => { 
 | 
    await appMP.resetActiveView(appMP.viewCapacitiesTime); 
 | 
    await appMP.cleanupAndLogout(); 
 | 
  }); 
 | 
  
 | 
  afterEach(async () => { 
 | 
    await appMP.checkToastMessage(); 
 | 
  }); 
 | 
  
 | 
  it(`Step 1 - ${AppMP.getDemoDataPath(Demo.Metals, Scenario.Base)}`, async () => { 
 | 
    await appMP.createDemoDataset(Demo.Metals, Scenario.Base, false); 
 | 
  }); 
 | 
  
 | 
  it(`Step 2 - Open view ${appMP.viewCapacitiesTime.viewPath}.`, async () => { 
 | 
    await appMP.viewCapacitiesTime.switchTo(); 
 | 
  }); 
 | 
  
 | 
  it(`Step 3 - ${StepMatrix.editCellValues(MatrixEditorShiftPattern.title, [cellLocation1], inputExceeded)} ${StepToast.verifyToastMessageAndClose(toastMatrixEditorShiftPattern.valueGreaterThanMaxAllowed())}`, async () => { 
 | 
    await meShiftPatterns.editCellValues([cellLocation1], inputExceeded); 
 | 
    await toast.verifyToastMessageAndClose(toastMatrixEditorShiftPattern.valueGreaterThanMaxAllowed()); 
 | 
  }); 
 | 
  
 | 
  it(`Step 4 - ${StepMatrix.editCellValues(MatrixEditorShiftPattern.title, [cellLocation1], inputNotExceeded)}`, async () => { 
 | 
    await meShiftPatterns.editCellValues([cellLocation1], inputNotExceeded); 
 | 
  }); 
 | 
  
 | 
  it(`Step 5 - ${StepMatrix.verifyCellValue(MatrixEditorShiftPattern.title, cellLocation1.rowName, cellLocation1.columnName, inputNotExceeded)}`, async () => { 
 | 
    await meShiftPatterns.verifyCellValue(cellLocation1.rowName, 0, cellLocation1.columnName, inputNotExceeded); 
 | 
  }); 
 | 
}); 
 |