/**
|
* @file ADSO-10028
|
* @description Cannot delete an event from capacity gantt chart if it belongs to common calendar
|
* @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 { dataFoodUnits } from '../../libmp/data/data.unit';
|
import { GanttChartCapacityPlanning, GanttChartCapacityPlanningContextMenuItem } from '../../libmp/forms/form.capacityplanning';
|
import { StepGanttChart } from '../../libappsop/ganttchartsop';
|
import { contextMenuItemDisabledTooltip, GanttChartCapacityPlanningEditCalendar, GanttChartCapacityPlanningEditCalendarContextMenuItem } from '../../libmp/dialogs/dialog.capacityplanningeditcalendar';
|
import { StepDialog } from '../../libappsop/dialogsop';
|
|
describe('ADSO-10028 - Cannot delete an event from capacity gantt chart if it belongs to common calendar', () => {
|
const appMP = AppMP.getInstance();
|
const gcCapacityPlanning = appMP.viewSupplyPlanning.frmCapacityPlanning.ganttChartCapacityPlanning;
|
const dlgCapacityPlanningEditCalendar = gcCapacityPlanning.dlgCapacityPlanningEditCalendar;
|
const gcCapacityPlanningEditCalendar = dlgCapacityPlanningEditCalendar.gcCapacityPlanningEditCalendar;
|
|
const rowTitle = 'Always available';
|
|
beforeAll(async () => {
|
jasmine.addMatchers(qCustomMatcher);
|
await appMP.login();
|
});
|
|
afterAll(async () => {
|
await appMP.resetActiveView(appMP.viewSupplyPlanning);
|
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.viewSupplyPlanning.viewPath}.`, async () => {
|
await appMP.viewSupplyPlanning.switchTo();
|
});
|
|
it(`Step 3 - ${StepGanttChart.rightClickRowAndSelectContextMenu(GanttChartCapacityPlanning.title, dataFoodUnits.DEFermenter.Name, GanttChartCapacityPlanningContextMenuItem.EditCalendarRow.Label)}`, async () => {
|
const [row] = await gcCapacityPlanning.getRowsByTitle(dataFoodUnits.DEFermenter.Name);
|
await gcCapacityPlanning.rightClickRowAndSelectMenu(row, GanttChartCapacityPlanningContextMenuItem.EditCalendarRow);
|
|
// Wait dialog displays before proceeding next
|
await dlgCapacityPlanningEditCalendar.waitUntilPresent();
|
});
|
|
it(`Step 4 - ${StepGanttChart.verifyRowContextMenuItemDisabled(GanttChartCapacityPlanningEditCalendar.title, rowTitle, GanttChartCapacityPlanningEditCalendarContextMenuItem.DeleteEventRow.Label, contextMenuItemDisabledTooltip.notEvent())}`, async () => {
|
// Edit calendar dialog displays, verify cannot delete common calendar event
|
await gcCapacityPlanningEditCalendar.verifyRowContextMenuItemDisabled(rowTitle, GanttChartCapacityPlanningEditCalendarContextMenuItem.DeleteEventRow, contextMenuItemDisabledTooltip.notEvent(), false);
|
});
|
|
it(`Step 5 - ${StepGanttChart.verifyRowContextMenuItemDisabled(GanttChartCapacityPlanningEditCalendar.title, rowTitle, GanttChartCapacityPlanningEditCalendarContextMenuItem.EditEventRow.Label, contextMenuItemDisabledTooltip.notEvent())}`, async () => {
|
// Verify cannot edit common calendar event
|
await gcCapacityPlanningEditCalendar.verifyRowContextMenuItemDisabled(rowTitle, GanttChartCapacityPlanningEditCalendarContextMenuItem.EditEventRow, contextMenuItemDisabledTooltip.notEvent(), false);
|
});
|
|
it(`Step 6 - ${StepDialog.clickOK()}`, async () => {
|
await dlgCapacityPlanningEditCalendar.clickOK();
|
});
|
});
|