| /** | 
|  * @file        ADSO-9989 | 
|  * @description Time capacity units available by default | 
|  * @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 { GanttChartResourceCalendar, ListResourceCalendars, ListResourceCalendarsColumn, ListResourceCalendar, ListResourceCalendarColumn, PanelResourceCalendarList, PanelResourceCalendarGanttChart } from '../../libmp/forms/resourcecalendars'; | 
| import { DataCalendar, DataEventCategoryName } from '../../libmp/data/data.calendar'; | 
| import { DataFoodBaseEntityName } from '../../libmp/data/data.navigation'; | 
| import { StepList } from '../../libappsop/listsop'; | 
| import { StepGanttChart } from '../../libappsop/ganttchartsop'; | 
| import { StepDialog } from '../../libappsop/dialogsop'; | 
|   | 
| describe('ADSO-9989 - Time capacity units available by default', () => { | 
|   const appMP = AppMP.getInstance(); | 
|   const formResourceCalendar = appMP.viewCalendar.formResourceCalendars; | 
|   const pnlResourceCalendarList = formResourceCalendar.pnlResourceCalendarList; | 
|   const pnlResourceCalendarGanttChart = formResourceCalendar.pnlResourceCalendarGanttChart; | 
|   const listResourceCalendar = pnlResourceCalendarList.listResourceCalendar; | 
|   const gcResourceCalendar = pnlResourceCalendarGanttChart.gcResourceCalendar; | 
|   const listCalendars = formResourceCalendar.listCalendars; | 
|   | 
|   const deFermenterCalendar: ListResourceCalendarsColumn = { CalendarID: DataFoodBaseEntityName.DEFermenter }; | 
|   const rowCalendarsNotExist: ListResourceCalendarsColumn = { CalendarID: DataFoodBaseEntityName.DEDairySupplier }; | 
|   const rowCalendarEventList: ListResourceCalendarColumn = { CalendarID: DataFoodBaseEntityName.DEFermenter, Name: DataCalendar.AlwaysAvailable, Initiator: DataCalendar.CommonCalendar }; | 
|   const parentCalendarEventList: ListResourceCalendarColumn[] = [{ Category: DataEventCategoryName.General }]; | 
|   | 
|   beforeAll(async () => { | 
|     jasmine.addMatchers(qCustomMatcher); | 
|     await appMP.login(); | 
|   }); | 
|   | 
|   afterAll(async () => { | 
|     await appMP.resetActiveView(appMP.viewCalendar); | 
|     await appMP.cleanupAndLogout(); | 
|   }); | 
|   | 
|   afterEach(async () => { | 
|     await appMP.checkToastMessage(); | 
|   }); | 
|   | 
|   it(`Step 1 - ${AppMP.getDemoDataPath(Demo.Food, Scenario.Base)}`, async () => { | 
|     await appMP.createDemoDataset(Demo.Food, Scenario.Base, false); | 
|   }); | 
|   | 
|   it(`Step 2 - Open view ${appMP.viewCalendar.viewPath}.`, async () => { | 
|     await appMP.viewCalendar.switchTo(); | 
|   }); | 
|   | 
|   it(`Step 3 - ${StepList.selectRow(ListResourceCalendars.title, deFermenterCalendar)}`, async () => { | 
|     await listCalendars.selectRow(deFermenterCalendar); | 
|   }); | 
|   | 
|   it(`Step 4 - ${StepDialog.clickTab(PanelResourceCalendarList.title)} ${StepList.verifyRowExists(ListResourceCalendar.title, rowCalendarEventList, parentCalendarEventList)}`, async () => { | 
|     await pnlResourceCalendarList.switchTo(); | 
|     await listResourceCalendar.verifyRowExists(rowCalendarEventList, parentCalendarEventList); | 
|   }); | 
|   | 
|   it(`Step 5 - ${StepDialog.clickTab(PanelResourceCalendarGanttChart.title)} ${StepGanttChart.verifyRowExists(GanttChartResourceCalendar.title, DataFoodBaseEntityName.DEFermenter)}`, async () => { | 
|     await pnlResourceCalendarGanttChart.switchTo(); | 
|     await gcResourceCalendar.verifyRowExists(DataFoodBaseEntityName.DEFermenter); | 
|   }); | 
|   | 
|   // TODO: Verify if node Always available is yellow. Currently API not able get the node. Skip as not super important, but to be investigated | 
|   | 
|   it(`Step 6 - ${StepList.verifyRowNotExist(ListResourceCalendars.title, rowCalendarsNotExist)}`, async () => { | 
|     // Verify non-time unit not present in list (not able use calendar) | 
|     await listCalendars.verifyRowNotExist(rowCalendarsNotExist); | 
|   }); | 
| }); |