Pos Automation - Validate Capture Customer
Overview
This tutorial provides step-by-step guidance on automating the feature of Capturing a Customer and doing a basic sale.
What you will learn
How to use the following steps
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.captureCustomer
Make sure your package is registered in the testNG.xml
Right click on the package and create a new cucumber test CaptureCustomer.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).
- 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=1
PRODUCT_1_DESCRIPTION=KAT VON D Eye Liner
PRODUCT_1_PRICE=£18.00
- In the same way, you can add the customer details to data property file.
your entries for customer data would be like
CUSTOMER_1_NAME=Mark Harrison
- Using the component Inspection, find the Component ID for the "Customer Selection List" (Refer Component Inspection).
your entry would be like
COMPONENT_SELECTION_LIST=SelectionList
- When you press the buttons to continue the Capture Customer feature, 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).
- "Capture Customer Name" page
- "Enter Search Name" page
- "Select Customer" page
- "Confirm Customer" page
-
"Transaction Basket" page
-
"Select Tender" page
-
"Enter Cash Tender Amount" page
-
"Await Drawer Closed" page
- External "Cash Drawer" window
- "Enter User" page
your entries would be like
WINDOW_CAPTURE_CUSTOMER_NAME=Point-of-Sale Application: NextGen/Pos/Name/CaptureName NameValidatingForm Pos/Name/NamePrompt
WINDOW_ENTER_SEARCH_NAME=Point-of-Sale Application:Point-of-Sale Application:Enter search name NextGen/Pos/Name/CaptureName EnterSearchName Pos/Name/EnterSearchName
WINDOW_SELECT_CUSTOMER=Point-of-Sale Application: NextGen/Pos/Name/CaptureName SelectCustomer Pos/General/SelectionPrompt
WINDOW_CONFIRM_CUSTOMER=Point-of-Sale Application: NextGen/Pos/Name/CaptureName ConfirmCustomer NextGen1024x768/Pos/Customer/ConfirmCustomer
WINDOW_TRANSACTION_BASKET=Point-of-Sale Application:Point-of-Sale Application:Sale Pos/Sale/Sale SignedOnState NextGen1024x768/Pos/Sale/Sale
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_ENTER_USER=Point-of-Sale Application:Point-of-Sale Application:Enter User Pos/SignOn/SignOn EnterUserState NextGen1024x768/Pos/SignOn/EnterUser
-
To check the receipt details Refer Check Receipt Details
-
Finally, Your feature file would be like ,
Scenario: Sale with customer capture
Given user signs on as "Sales Assistant"
And user enters "${Product 1}" into "Input Box" field
And user presses "ENT" button
And "${Product 1 Description}" is displayed in "Receipt" list
When user presses "Sales" button
And user presses "More" button
And user presses "Customers" button
And user presses "Capture Customer" button
Then "Capture Customer Name" page is shown
When user presses "Search By Name" button and "Enter Search Name" page shown
And user enters "M" into "Input Box" field
And user presses "OK" button
Then "Select Customer" page is shown
When user selects "${Customer 1 Name}" from "Selection List" list
And user presses "OK" button and "Confirm Customer" page shown
And user presses "Confirm" button and "Transaction Basket" page shown
And "Customer: Mr Mark Harrison" is displayed in "Receipt" list
And "Address: 1 Enactor House Bluecoats Avenue Hertford SG141PB" 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} |
| text | Customer: ${Customer 1 Name} |
| item | ${Product 1 Description},${Product 1 Price} |
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
COMPONENT_SELECTION_LIST=SelectionList
WINDOW_CAPTURE_CUSTOMER_NAME=Point-of-Sale Application: NextGen/Pos/Name/CaptureName NameValidatingForm Pos/Name/NamePrompt
WINDOW_ENTER_SEARCH_NAME=Point-of-Sale Application:Point-of-Sale Application:Enter search name NextGen/Pos/Name/CaptureName EnterSearchName Pos/Name/EnterSearchName
WINDOW_SELECT_CUSTOMER=Point-of-Sale Application: NextGen/Pos/Name/CaptureName SelectCustomer Pos/General/SelectionPrompt
WINDOW_CONFIRM_CUSTOMER=Point-of-Sale Application: NextGen/Pos/Name/CaptureName ConfirmCustomer NextGen1024x768/Pos/Customer/ConfirmCustomer
WINDOW_TRANSACTION_BASKET=Point-of-Sale Application:Point-of-Sale Application:Sale Pos/Sale/Sale SignedOnState NextGen1024x768/Pos/Sale/Sale
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_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=1
PRODUCT_1_DESCRIPTION=KAT VON D Eye Liner
PRODUCT_1_PRICE=£18.00
CUSTOMER_1_NAME=Mark Harrison
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