In order to show you how to implement a UI handler function, we are going to have a go at the following scenario:
- [Feature] Gifts
- [Scenario #0010] Assign quantity on sales line to trigger active promotion message
- [Given] Packt setup with Gift Tolerance Qty set
- [Given] Customer with non-blocked customer category with Free Gifts Available
- [Given] Item
- [Given] Gift campaign for item and customer category with Minimum Order Quantity set
- [Given] Sales invoice for customer with line for item
- [When] Set quantity on invoice line smaller than Minimum Order Quantity and within Gift Tolerance Qty
- [Then] Active promotion message is displayed
As this is quite an extensive scenario, you will also explore and learn from a somewhat more complex test code sample.