/** 
 | 
 * @file        ADSO-50252 
 | 
 * @description Visualize only customer orders in Customer Orders view 
 | 
 * @author      Clarence (ccn7@3ds.com) 
 | 
 * @copyright   Dassault Systèmes 
 | 
 */ 
 | 
import { AppMP, StepAppMP } from '../../libmp/appmp'; 
 | 
import { DataMetalBaseSalesSegmentName } from '../../libmp/data/data.salessegment'; 
 | 
import { DataMetalBaseProductName } from '../../libmp/data/data.product'; 
 | 
import { ListCustomerOrdersColumn } from '../../libmp/forms/form.customerorders'; 
 | 
import { StepList } from '../../libappsop/listsop'; 
 | 
import { ListForecastsColumn } from '../../libmp/forms/form.forecasts'; 
 | 
import { DataMetalStockingPointName } from '../../libmp/data/data.stockingpoint'; 
 | 
  
 | 
describe('ADSO-50252 - Visualize only customer orders in Customer Orders view', () => { 
 | 
  const appMP = AppMP.getInstance(); 
 | 
  const scenarioToSelect = 'ADSO-50251'; 
 | 
  const listCustomerOrders = appMP.viewCustomerOrders.formCustomerOrders.listCustomerOrders; 
 | 
  const listForecasts = appMP.viewForecasts.formForecasts.listForecasts; 
 | 
  // Invalid as stocking point is empty as invalid stocking point passed in during creation in UTF 
 | 
  const invalidCustomerOrderRow: ListCustomerOrdersColumn = {'Stocking point': '', 'Sales segment': DataMetalBaseSalesSegmentName.CanManChina, Product: DataMetalBaseProductName.BCCBWide}; 
 | 
  const forecastRow: ListForecastsColumn = {'Stocking point': DataMetalStockingPointName.NorthAmerica, 'Sales segment': DataMetalBaseSalesSegmentName.AllOrganics, Product: DataMetalBaseProductName.CPNCoil}; 
 | 
  
 | 
  beforeAll(async () => { 
 | 
    await appMP.login(); 
 | 
  }); 
 | 
  
 | 
  afterAll(async () => { 
 | 
    await appMP.resetActiveView(appMP.viewForecasts); 
 | 
    await appMP.cleanupAndLogout(); 
 | 
  }); 
 | 
  
 | 
  afterEach(async () => { 
 | 
    await appMP.checkToastMessage(); 
 | 
  }); 
 | 
  
 | 
  it(`Step 1 - ${StepAppMP.selectScenario(scenarioToSelect)}`, async () => { 
 | 
    await appMP.selectScenario(scenarioToSelect); 
 | 
  }); 
 | 
  
 | 
  it(`Step 2 - Open view ${appMP.viewCustomerOrders.viewPath}.`, async () => { 
 | 
    await appMP.viewCustomerOrders.switchTo(); 
 | 
  }); 
 | 
  
 | 
  it(`Step 3 - ${StepList.verifyRowExists(listCustomerOrders.title, invalidCustomerOrderRow)}`, async () => { 
 | 
    await listCustomerOrders.verifyRowExists(invalidCustomerOrderRow); 
 | 
  }); 
 | 
  
 | 
  it(`Step 4 - ${StepList.verifyRowNotExist(listCustomerOrders.title, forecastRow)}`, async () => { 
 | 
    await listCustomerOrders.verifyRowNotExist(forecastRow); 
 | 
  }); 
 | 
  
 | 
  it(`Step 5 - Open view ${appMP.viewForecasts.viewPath}.`, async () => { 
 | 
    await appMP.viewForecasts.switchTo(); 
 | 
  }); 
 | 
  
 | 
  it(`Step 6 - ${StepList.verifyRowExists(listForecasts.title, forecastRow)}`, async () => { 
 | 
    await listForecasts.verifyRowExists(forecastRow); 
 | 
  }); 
 | 
  
 | 
  it(`Step 7 - ${StepList.verifyRowNotExist(listForecasts.title, invalidCustomerOrderRow)}`, async () => { 
 | 
    await listForecasts.verifyRowNotExist(invalidCustomerOrderRow); 
 | 
  }); 
 | 
}); 
 |