Pos Automation - Validate Change User Privileges
Overview
This tutorial will provides step-by-step guidance on automating the feature of Changing User Privileges feature by verifying Modify Quantity Function is allowed to Privileged Users.
We will change a product quantity as a given user, revoke their modify privilege, and verify behavior. Then, restore the privilege and void the transaction.
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.changeUserPrivileges
Make sure your package is registered in the testNG.xml
Right click on the package and create a new cucumber test ChangeUserPrivileges.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
SKU_PRODUCT_6=MB709SN-1
SKU_PRODUCT_6_DESCRIPTION=Rose Print Tea Dress
- Using the component Inspection find the Component ID for the "Reason Selection List" (Refer Component Inspection).
your entry would be like
COMPONENT_SELECTION_LIST=SelectionList
- When you press the buttons to continue the Verifying the user privilege change feature, you will be navigated to the following pages. Therefore the following Window names should be inspected and add the window entries to
.properties
file ( Refer Window Details to set up Client Property file).
-
"Modify Item" page
-
"Enter Quantity" page shown
-
"Transaction Basket" page
-
"Enter Authorising User" page
-
"Select Reason" page
-
"Enter User" page
your entries would be like
WINDOW_MODIFY_ITEM=Point-of-Sale Application:Point-of-Sale Application:Discount Options Pos/Sale/DoDisplayModifyItemFunctions Prompt State Pos/Modifier/ModifyItemOptionsPrompt
WINDOW_ENTER_QUANTITY=Point-of-Sale Application:Point-of-Sale Application:Enter quantity Pos/Product/GetItemQuantity EnterQuantity Pos/Product/EnterQuantity
WINDOW_ENTER_AUTHORISING_USER=Point-of-Sale Application:Point-of-Sale Application:Enter Authorising User Pos/SignOn/SignOnAuthorisingUser EnterUserState Pos/SignOn/EnterAuthorisingUser
WINDOW_TRANSACTION_BASKET=Point-of-Sale Application:Point-of-Sale Application:Sale Pos/Sale/Sale SignedOnState NextGen1024x768/Pos/Sale/Sale
WINDOW_SELECT_REASON=Point-of-Sale Application: Pos/Reason/SelectReasonCode SelectReasonCode Pos/Reason/SelectReason
WINDOW_ENTER_USER=Point-of-Sale Application:Point-of-Sale Application:Enter User Pos/SignOn/SignOn EnterUserState NextGen1024x768/Pos/SignOn/EnterUser
-
Refer Add User Privilges for the step defintion.
-
Refer Remove User Privilges for the step defintion.
-
Finally, Your feature file would be like ,
Scenario: Verify Modify Quantity Function is Allowed to Privileged Users
Given user signs on as "Sales Assistant"
When user enters "${SKU Product 6}" into "Input Box" field
When user presses "ENT" button
When "${SKU Product 6 Description}" is displayed in "Receipt" list
When user selects "${SKU Product 6 Description}" from "Receipt" list
When "Modify Item" page is shown
When user presses "Change Quantity" button and "Enter Quantity" page shown
And user enters "2" into "Input Box" field
And user presses "ENT" button and "Transaction Basket" page shown
When privilege "enactor.pos.AuthorisesModifyQuantity" is removed from the current user
When user selects "${SKU Product 6 Description}" from "Receipt" list
When "Modify Item" page is shown
When user presses "Change Quantity" button
Then "Enter Authorising User" page is shown
When user presses "Cancel" button and "Transaction Basket" page shown
When privilege "enactor.pos.AuthorisesModifyQuantity" is added to the current user
When user selects "${SKU Product 6 Description}" from "Receipt" list
When "Modify Item" page is shown
When user presses "Change Quantity" button and "Enter Quantity" page shown
When user enters "4" into "Input Box" field
When user presses "ENT" button and "Transaction Basket" page shown
When user presses "Voids" button
When user presses "Void Transaction" button and "Select Reason" page shown
When user selects "Operator Error" from "Selection List" list
When user presses "OK" button and "Transaction Basket" page 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_SELECTION_LIST=SelectionList
WINDOW_MODIFY_ITEM=Point-of-Sale Application:Point-of-Sale Application:Discount Options Pos/Sale/DoDisplayModifyItemFunctions Prompt State Pos/Modifier/ModifyItemOptionsPrompt
WINDOW_ENTER_QUANTITY=Point-of-Sale Application:Point-of-Sale Application:Enter quantity Pos/Product/GetItemQuantity EnterQuantity Pos/Product/EnterQuantity
WINDOW_ENTER_AUTHORISING_USER=Point-of-Sale Application:Point-of-Sale Application:Enter Authorising User Pos/SignOn/SignOnAuthorisingUser EnterUserState Pos/SignOn/EnterAuthorisingUser
WINDOW_TRANSACTION_BASKET=Point-of-Sale Application:Point-of-Sale Application:Sale Pos/Sale/Sale SignedOnState NextGen1024x768/Pos/Sale/Sale
WINDOW_SELECT_REASON=Point-of-Sale Application: Pos/Reason/SelectReasonCode SelectReasonCode Pos/Reason/SelectReason
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,
SKU_PRODUCT_6=MB709SN-1
SKU_PRODUCT_6_DESCRIPTION=Rose Print Tea Dress
SALES_ASSISTANT_USERNAME=1010
SALES_ASSISTANT_PASSWORD=1010