Skip to main content

POS Automation - Perform a Sale with customized trailer line in receipt

Overview

This tutorial provides step-by-step guidance on automating the validation of a sale with a customized trailer line in the receipt while dynamically changing the location template and updating the location properties within the same automated test.

What you will learn

How to use the following steps

  1. Login as a user

  2. Enter text into a field

  3. Press a button

  4. Check item display in a selection list

  5. Press a button and check another page displays

  6. Check text display on the receipt

  7. Press a button on a test peripheral

  8. Check page display

  9. Set a different template for the POS Location

Pre-requisites

  • Should have a POS Setup and Automation Workspace Setup

  • You should have a Location Template with the customized trailer line. The property should be fixed and the template should be broadcast to POS before running the test. (For more details you can refer Setting Up Location Templates)

Location Template Setting

Exercises

Add Automation Script File

Right click on the Automated Tests project and create a new package in the test folder, feature.retail.pos.posRetailFunction.sales

note

Make sure your package is registered in the testNG.xml

Right click on the package and create a new cucumber test ItemSale.feature

Add the Steps

  • First you have to start from adding the step to sign on as a given user. Refer Login as a user

  • After login, you have to inspect the Component Id for the Input Box in the transaction page so that you can enter the productID. (Refer Component Inspection).

Produc ID Input

  • Add the component entries to .properties file ( Refer Component Details to set up Client Property file).

your entry would be like

COMPONENT_INPUT_BOX=InputBox
  • You can directly add the ProductID and Product Description to the step or else you can add data entries to data property file and use the variables. Refer Data property File

If defined in the data property file,

your entries would be like

PRODUCT_2=2
PRODUCT_2_DESCRIPTION=HD Complexion Starter Kit
  • Using the component Inspection find the Component ID for the Receipt List. (Refer Component Inspection).

Receipt List

  • Add the component entries to .properties file ( Refer Component Details to set up Client Property file).

your entry would be like

COMPONENT_RECEIPT=Receipt
  • When you press the buttons to continue the sale, you will be navigated to the following pages. Therfore the Window names should be inspected and add the window entries to .properties file ( Refer Window Details to set up Client Property file).
  1. "Select Tender" page

Select Tender

  1. "Enter Cash Tender Amount" page

Enter Cash Tender

  1. "Await Drawer Closed" page

Await Drawer Closed

  1. Validate that the receipt displays the provided details.

Receipt

  1. External "Cash Drawer" window

Cash Drawer

  1. "Transaction Basket" page

Transaction Basket

  1. "Enter User" page

Enter User

Produc ID Input

  • When you press the buttons to continue the sale, you will be navigated to the following pages. Therfore the Window names should be inspected and add the window entries to .properties file ( Refer Window Details to set up Client Property file).
  1. "Select Tender" page

Select Tender

  1. "Enter Cash Tender Amount" page

Enter Cash Tender

  1. "Await Drawer Closed" page

Await Drawer Closed

  1. Validate that the receipt displays the given details.

Receipt Receipt

  1. External "Cash Drawer" window

Cash Drawer

  1. "Transaction Basket" page

Transaction Basket

  1. "Enter User" page

Enter User

  • Finally, Your feature file would be like ,
  Scenario: Perform a Sale with customized trailer line in receipt
Given user signs on as "Sales Assistant"
And user enters "${Product 2}" into "Input Box" field
And user presses "ENT" button
And "${Product 2 Description}" is displayed in "Receipt" list
When user presses "TOTAL" button and "Select Tender" page shown
And user presses "Cash" button and "Enter Cash Tender Amount" page shown
And user presses "OK" button and "Await Drawer Closed" page shown
And receipt display with following details
| address | ${Street 1},${Street 2},${Town},${County},${Postcode} |
| telephone | Tel: ${Store Phone 1} |
| item | ${Product 2 Description},${Product 2 Price} |
| text | Thankyou for shopping at Enactor |
When user presses "Close" button on external "Cash Drawer" window
Then "Transaction Basket" page is shown
When user presses "SignOff" button
Then "Enter User" page is shown
Given user signs on as "Sales Assistant"
When template "AUT_STORE_TEMPLATE_UK" is set for the current POS location
And user enters "${Product 2}" into "Input Box" field
And user presses "ENT" button
And "${Product 2 Description}" is displayed in "Receipt" list
When user presses "TOTAL" button and "Select Tender" page shown
And user presses "Cash" button and "Enter Cash Tender Amount" page shown
And user presses "OK" button and "Await Drawer Closed" page shown
And receipt display with following details
| address | ${Street 1},${Street 2},${Town},${County},${Postcode} |
| telephone | Tel: ${Store Phone 1} |
| item | ${Product 2 Description},${Product 2 Price} |
| text | Thank you for shopping with us |
When user presses "Close" button on external "Cash Drawer" window
Then "Transaction Basket" page is shown
When user presses "SignOff" button
Then "Enter User" page is shown
  • Your client properties file entries would be like,
COMPONENT_INPUT_BOX=InputBox
COMPONENT_RECEIPT=Receipt

WINDOW_SELECT_TENDER=Point-of-Sale Application:Point-of-Sale Application:Select Tender Pos/Tender/DoTender SelectTender NextGen1024x768/Pos/Tender/SelectTender
WINDOW_ENTER_CASH_TENDER_AMOUNT=Point-of-Sale Application:Point-of-Sale Application:Enter Tender Amount Pos/Tender/GetTenderAmountMain EnterTenderAmountWithSuggestions Pos/Tender/EnterCashTenderAmount
WINDOW_AWAIT_DRAWER_CLOSED=Point-of-Sale Application:Point-of-Sale Application:Wait Drawer Closed Pos/Transaction/AwaitDrawerClosed AwaitDrawerClosed Pos/Transaction/AwaitDrawerClosed
WINDOW_CASH_DRAWER=Cashdrawer
WINDOW_TRANSACTION_BASKET=Point-of-Sale Application:Point-of-Sale Application:Sale Pos/Sale/Sale SignedOnState NextGen1024x768/Pos/Sale/Sale
WINDOW_ENTER_USER=Point-of-Sale Application:Point-of-Sale Application:Enter User Pos/SignOn/SignOn EnterUserState NextGen1024x768/Pos/SignOn/EnterUser
  • Your data properties file entries would be like,
PRODUCT_2=2
PRODUCT_2_DESCRIPTION=HD Complexion Starter Kit

STREET_1=Enactor House
STREET_2=1 Bluecoats
TOWN=Hertford
COUNTY=Hertfordshire
POSTCODE=SG14 1PB
STORE_PHONE_1=01992 500881

SALES_ASSISTANT_USERNAME=1010
SALES_ASSISTANT_PASSWORD=1010