Skip to main content

Pos Automation - Validate Transaction Void

Overview

This tutorial will provides step-by-step guidance on automating the feature of Transaction Void

What you will learn

How to use the following steps

  1. Login as a user

  2. Check page display

  3. Enter text into a field

  4. Press a Button

  5. Press an Icon Button

  6. Select item from a selection list

  7. Check text display on the receipt

Pre-requisites

Should have a POS Setup and Automation Workspace Setup

Exercises

Add Automation Script File

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

note

Make sure your package is registered in the testNG.xml

Right click on the package and create a new cucumber test TransactionVoid.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_1=001
PRODUCT_1_DESCRIPTION=KAT VON D Eye Liner
  • Using the component Inspection find the Component ID for the "Reason Selection List" (Refer Component Inspection).

Selection List

your entry would be like

COMPONENT_SELECTION_LIST=SelectionList
  • When you press the buttons to continue the Transaction Void, you will be navigated to the following pages. Therefore 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 Reason" page

Reason Page

  1. "Transaction Basket" page

Transaction Basket

  1. "Enter User" page

Enter User

When updated the client property file,

your entries would be like

WINDOW_SELECT_REASON=Point-of-Sale Application:  Pos/Reason/SelectReasonCode  SelectReasonCode  Pos/Reason/SelectReason
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
Scenario: Attempt to void the transaction.
Given user signs on as "Manager 2"
And user enters "${Product 1}" into "Input Box" field
And user presses "ENT" button
And user presses "Voids" button
And user presses "Void Transaction" button and "Select Reason" page shown
When user selects "Customer Left Store" from "Selection List" list
And user presses "OK" button
Then "Transaction Basket" page is shown
And receipt display with following details
| address | ${Street 1},${Street 2},${Town},${County},${Postcode} |
| telephone | Tel: ${Store Phone 1} |
| text | *** TRANSACTION VOID *** |
| text | Manager signature |
| text | £0.00 |
When user presses "SignOff" button
Then "Enter User" page is shown
  • Your client properties file entries would be like,
COMPONENT_INPUT_BOX=InputBox
COMPONENT_SELECTION_LIST=SelectionList

WINDOW_SELECT_REASON=Point-of-Sale Application: Pos/Reason/SelectReasonCode SelectReasonCode Pos/Reason/SelectReason
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_1=001
PRODUCT_1_DESCRIPTION=KAT VON D Eye Liner

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

MANAGER_2_USERNAME=M1
MANAGER_2_PASSWORD=m1