Skip to main content

Pos Automation - Validate Running Postman Collection

Overview

This tutorial will provides step-by-step guidance on automating the feature of verifying customer basket creation through REST API using a postman collection

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. Running a Postman Collection

  8. Adding User Privilege for the Current User

Pre-requisites

  • Should have a POS Setup and Automation Workspace Setup

  • Recall by Customer Basket button should be visible under the Sales -> Store / Recall Options in the POS menu.

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.changeUserPrivileges

note

Make sure your package is registered in the testNG.xml

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

Add the Steps

  • First you need to run a Postman Collection/Script to store the Transaction by Customer Basket. Refer Run Postman Collection

  • To run this you need to build the POS-POS Automatued Tests project with the maven-postman-integration profile using the below command.

mvn clean install -Pmaven-postman-integration

  • Then add the step to sign on as a given user. Refer Login as a user

  • Using the component Inspection find the Component ID for the "Stored Customer Baskets List Selection" list (Refer Component Inspection).

Stored Customer List

your entry would be like

COMPONENT_STORED_CUSTOMER_BASKETS_LIST_SELECTION=SelectionList
  • When you press the buttons to continue , 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. "Stored Customer Baskets List Selection Prompt" page

Stored Customer Basket

  1. ""Display Transaction With Msg Config" page

Msg Config Display

  1. "Select Tender" page

Select Tender

  1. "Enter Cash Tender Amount" page

Enter Cash Tender

  1. "Await Drawer Closed" page

Await Drawer Closed

  1. External "Cash Drawer" window

Cash Drawer

  1. "Transaction Basket" page

Transaction Basket

  1. "Enter User" page

Enter User

When updated the client property file,

your entries would be like

WINDOW_STORED_CUSTOMER_BASKETS_LIST_SELECTION_PROMPT=Point-of-Sale Application:  Pos/StoreRecall/StoredCustomerBaskets/DisplayStoredCustomerBasketsList  SelectBasketPrompt  Pos/General/SelectionPrompt
WINDOW_DISPLAY_TRANSACTION_WITH_MSG_CONFIG=Point-of-Sale Application:Point-of-Sale Application:Display Transaction Pos/Print/DisplayAndPrintTransaction DisplayTransactionWithMSGConfig Pos/Transaction/DisplayTransaction
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
  Scenario: Verify customer basket creation through REST API using a postman collection
# Create basket through API
Given the Postman collection "basket/CreateBasketPostmanCollection.json" is executed
# Recall the basket
When user signs on as "Sales Assistant"
And user presses "Sales" button
And user presses "Store / Recall Options" button
When privilege "enactor.pos.AuthorisesRecallStoredCustomerBasket" is added to the current user
When privilege "enactor.pos.RecallStoredCustomerBasket" is added to the current user
And user presses "Recall by Customer Basket" button and "Stored Customer Baskets List Selection Prompt" page shown
And user selects "Test_Customer_Basket_001" from "Stored Customer Baskets List Selection" list
And user presses "View" button and "Display Transaction With Msg Config" page shown
And user presses "OK" button
And "Transaction Basket" page is shown
And 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
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_STORED_CUSTOMER_BASKETS_LIST_SELECTION=SelectionList

WINDOW_STORED_CUSTOMER_BASKETS_LIST_SELECTION_PROMPT=Point-of-Sale Application: Pos/StoreRecall/StoredCustomerBaskets/DisplayStoredCustomerBasketsList SelectBasketPrompt Pos/General/SelectionPrompt
WINDOW_DISPLAY_TRANSACTION_WITH_MSG_CONFIG=Point-of-Sale Application:Point-of-Sale Application:Display Transaction Pos/Print/DisplayAndPrintTransaction DisplayTransactionWithMSGConfig Pos/Transaction/DisplayTransaction
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,
SALES_ASSISTANT_USERNAME=1010
SALES_ASSISTANT_PASSWORD=1010