Open Requirements Tests
These tests will verify that requirements are correctly created when orders are approved. These tests will use product GZ-1005 which is configured to use requirement method PRODRQM_AUTO by default, which creates requirements for every order. We will also be testing PRODRQM_ATP, which creates requirements when the stock goes below minimum quantity specified in ProductFacility.
- 1 Auto Requirement Tests
- 2 Minimum Stock Requirement Tests
- 2.1 Test 5: Minimum stock requirement not created when ATP stays above minimum stock
- 2.2 Test 6: Minimum stock requirement created when ATP goes below minimum stock
- 2.3 Test 7: Minimum stock requirement not created until order is approved
- 2.4 Test 8: Minimum stock requirement not duplicated when order is put on hold then re approved
Auto Requirement Tests
As a setup step, go into catalog manager and ensure GZ-1005 has requirement method auto for every order PRODRQM_AUTO.
Test 1: Auto requirement not created when order is first created
Create an order for the product GZ-1005 for DemoAccount1, using "Offline Payment" and the default ecommerce store.
No requirements are created when the order is first created.
Test 2: Auto requirement not created when order is approved
Approve your Order
A requirement is created for GZ-1005.
Test 3: Auto requirement can be seen in Open Requirements screen
Go to Purchasing > Planning >> Open Requirements.
You should see your new Requirement there.
Test 4: Changing Order from Hold to Approved does not create more Requirements
Change your order status to Hold. Now change it back to Approved.
No new requirements are created.
Minimum Stock Requirement Tests
Change the requirement method for GZ-1005 to PRODRQM_ATP (there's another one for PRODRQM_STOCK_ATP which is different). Find the ProductFacility for GZ-1005 and facility WebStoreWarehouse in webtools. Create it by hand if it doesn't exist and give it a minimumStock of 10. Go to warehouse and make sure the ATP is at 15. Receive inventory until ATP reaches 15 if not.
Test 5: Minimum stock requirement not created when ATP stays above minimum stock
Create an order for 1 GZ-1005 with a credit card so it gets auto approved.
No requirements generated. Order is approved. ATP for GZ-1005 is now 14.
Test 6: Minimum stock requirement created when ATP goes below minimum stock
Create an order for 10 GZ-1005 with a credit card so it gets auto approved.
ATP of GZ-1005 is now 4. Requirement created for 6 GZ-1005 (minimum stock is the upper bound for these kinds of requirements).
Test 7: Minimum stock requirement not created until order is approved
Create another order for 5 GZ-1005, this time with an offline payment so it is not auto approved.
No requirements created, ATP is still 4.
Approve the order
Requirement for 5 GZ-1005 created. ATP is now -1.
Test 8: Minimum stock requirement not duplicated when order is put on hold then re approved
Place the order on hold, then approve it again.
No new requirements generated, ATP remains the same.