Skip to content

Testing

Jani Giannoudis edited this page Jul 24, 2023 · 22 revisions

Payroll Testing

The following test methods exist for testing the payroll

Test method Test scope Payroll Console JSON Extension
Case Available Test Test the case available actions and scripts CaseTest .ct.json
Case Build Test Test the case build actions and scripts CaseTest .ct.json
Case Validate Test Test the case validate actions and scripts CaseTest .ct.json
Payrun Test Test company payrun, all employees PayrunTest .pt.json
Payrun Employee Test Test employee payrun PayrunEmployeeTest .et.json
Report Build Test Test the report build scripts ReportTest .rt.json
Report Execute Test Test the report execute scripts ReportTest .rt.json
Payroll Testing

Case Testing

The following case test shows the validation of the salary lower limit from the start example.

Example Case Validation Test Test.Salary.ct.json:

1{
2  "$schema": "PayrollEngine.CaseTest.schema.json",
3  "testName": "Test.Salary",
4  "tenantIdentifier": "StartTenant",
5  "userIdentifier": "[email protected]",
6  "employeeIdentifier": "mario.nuñ[email protected]",
7  "payrollName": "StartPayroll",
8  "validateTests": [
9    {
10      "testName": "Employee.Salary.499.Test",
11      "input": {
12        "userIdentifier": "[email protected]",
13        "employeeIdentifier": "mario.nuñ[email protected]",
14        "divisionName": "StartDivision",
15        "case": {
16          "caseName": "Salary",
17          "values": [
18            {
19              "caseFieldName": "Salary",
20              "value": "499",
21              "start": "2023-02-01T00:00:00.0Z",
22              "created": "2023-02-15T18:22:45.0Z"
23            }
24          ]
25        }
26      },
27      "output": {
28        "issues": [
29          {
30            "caseFieldName": "Salary",
31            "issueType" : "CaseInvalid",
32            "number": 400
33          }
34        ]
35      }
36    },
37    {
38      "testName": "Employee.Salary.500.Test",
39      "input": {
40        "userIdentifier": "[email protected]",
41        "employeeIdentifier": "mario.nuñ[email protected]",
42        "divisionName": "StartDivision",
43        "case": {
44          "caseName": "Salary",
45          "values": [
46            {
47              "caseFieldName": "Salary",
48              "value": "500",
49              "start": "2023-02-01T00:00:00.0Z",
50              "created": "2023-02-15T18:22:45.0Z"
51            }
52          ]
53        }
54      },
55      "output": {
56        "values": [
57          {
58            "caseFieldName": "Salary",
59            "value": "500",
60            "start": "2023-02-01T00:00:00.0Z",
61            "created": "2023-02-15T18:22:45.0Z"
62          }
63        ]
64      }
65    }
66  ]
67}

The steps for testing Payroll in detail:

  • 2: Path to the JSON schema (adjust this to your local environment).

The test is executed with the Payroll console:

PayrollConsole CaseTest Test.Salary.ct.json

See also Example Case Test.

Payrun Testing

Report Testing

Clone this wiki locally