Fieldpine Logo Documentation Home  

Automatic Regression Testing

This information is PRELIMINARY. Use Caution or Contact Fieldpine for assistance


Fieldpine uses built in automatic regression testing to test new releases. Some customers may like to create their own test cases to be run each time a new release is ready for deployment. This ensures that version changes are tested in your environment. Creating and managing test environments does take effort and ongoing management to ensure it stays current, so automated regression testing is more for retailers with IT teams or technical staff.

This documentation is not introductory and assumes the reader has good knowledge about Fieldpine at a technical level

When PosCommands are executed, a number of primitives are invoked internally. A primitive is a low level operation that affects the state of the sale. A regression script can be build using (PosCommands?) and Primitives. The Pos will execute these commands directly, and can check the state of the sale as it is processing. Primitives cannot cause user interface questions or messages, each primitive command fully specifies the operation

Starting with version P1923, the Pos will write (some of) the primitives into the SaleJournal. This means you can interactively run a sale, and then copy the primitives to repeat the sale.

1 Create a test file. TestPrice.txt

; Verify that happy hour kit does not apply
; but default kit does apply
new sale
test set date 4:23
test verify totalprice = 0
add pid 6020
add pid 6007
test verify totalprice = 10.05
cancel sale


; Verify that happy hour kit worked
new sale
test set date 11:44
test verify totalprice = 0
add pid 6007
add pid 6020
test verify totalprice = 9.05
cancel sale

2 Start Pos on test database, causing all tests in file to be executed.

posgreen /auto=TestPrice.txt

Primitives are text like commands that can be stored in a simple text file.

Rules....?

new sale
Create a new sale
cancel sale
Cancel the current sale
add pid NNN
Add product id NNN to the sale

Test Primitives

Primitives that start with the word "test" do not affect sale state, but can be used to control the environment or check various values stored

test set date NNN
Sets the processing date/time or just time for this sale. This primitive requires a sale to be active and only applies to that single sale. Not all functions in Pos can handle the processing date being changed.
test verify totalprice = NNN
Check that the current total price of the sale is NNN