yanweiyuan3
2023-10-10 d901b1ab0ee0b690f5ac211b9cdb1db3a58bca86
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
 * @file        ADSO-10086
 * @description Verify there are only two accounts for unit cost
 * @author      Gay Er Xuan (erxuan.gay@3ds.com)
 * @copyright   Dassault Systemes
 */
import { qCustomMatcher } from '../../../e2elib/lib/src/main/qmatchers.const';
import { AppMP, Demo, Scenario } from '../../../libmp/appmp';
import { DataFoodBaseAccountName } from '../../../libmp/data/data.account';
 
describe('ADSO-10086 - Food demo shows 2 accounts related to unit cost', () => {
  const appMP = AppMP.getInstance();
 
  beforeAll(async () => {
    jasmine.addMatchers(qCustomMatcher);
    await appMP.login();
  });
 
  afterAll(async () => {
    await appMP.cleanupAndLogout();
  });
 
  afterEach(async () => {
    await appMP.checkToastMessage();
  });
 
  it(`Setup - ${AppMP.getDemoDataPath(Demo.Food, Scenario.Base)}`, async () => {
    await appMP.createDemoDataset(Demo.Food, Scenario.Base, false);
  });
 
  it(`Step 1 - Open view ${appMP.viewUnitCost.viewPath}. Verify only General fixed costs, Changeover cost and Shift pattern costs exist in Unit Account list`, async () => {
    await appMP.viewUnitCost.switchTo();
 
    const listUnitAccount = appMP.viewUnitCost.frmUnitAccount.listAccount;
    // Verify the list only contain 3 unit accounts
    expect(await listUnitAccount.getRowCount()).toBe(3, 'Number of unit accounts should be exactly 3');
 
    // Verify costs exist in the list
    await listUnitAccount.verifyRowExists({ Account: DataFoodBaseAccountName.GeneralFixedCosts });
    await listUnitAccount.verifyRowExists({ Account: DataFoodBaseAccountName.ChangeoverCost });
    await listUnitAccount.verifyRowExists({ Account: DataFoodBaseAccountName.ShiftPatternCosts });
  });
});