POS Automation - Validate Product Search After Sign Out
Overview
This tutorial provides step-by-step guidance on automating the process of validating that the user's name is no longer displayed in the Header Panel after signing out and performing a product search.
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.signoutvalidation
Make sure your package is registered in the testNG.xml
Right click on the package and create a new cucumber test PosSignOutValidation.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 logging in, inspect the component ID of the panel on the transaction page to validate whether the specified text is present or not in the panel. ( Refer Component Inspector to identify the component ID)
- When you press the "SignOff" button, you will be navigated to the "Enter User" page. Therfore the Window name should be inspected and add the window entry to
.properties
file ( Refer Window Details to set up Client Property file).
When updated the client property file,
your entries would be like
WINDOW_ENTER_USER=Point-of-Sale Application:Point-of-Sale Application:Enter User Pos/SignOn/SignOn EnterUserState NextGen1024x768/Pos/SignOn/EnterUser
- After that you have to inspect the Component Id for the Products icon in the Enter User page. (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_PRODUCT_SEARCH=SignOnMenuButton2
-
When you press the Products button, you will be navigated to the "Rich Product Search Result" page. Therfore the Window name should be inspected and add the window entry to
.properties
file ( Refer Window Details to set up Client Property file). -
After that you have to inspect the component Id for the Header Panel. (Refer Component Inspection).
-
Add panel entry to the
.properties
file ( Refer Component Details to set up Client Property file). -
When updated the client property file,
your entry would be like
COMPONENT_HEADER_PANEL=HeaderDetail.ReferenceHeader.HeaderDetailsPanel
WINDOW_RICH_PRODUCT_SEARCH_RESULT=Point-of-Sale Application: NextGen/Pos/Product/RichProductSearch/RichProductSearch MainResultFullScreen NextGen1024x768/Pos/Product/RichProductSearch/RichProductSearchFullScreenResults
- You can directly add the user's name 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
SALES_ASSISTANT_NAME=Michael Browne
- Finally, Your feature file would be like ,
Scenario: Verify Product Search on Sign Out and validate that previously logged user details are still displayed
Given user signs on as "Sales Assistant"
And "${Sales Assistant Name}" is displayed in "Header Panel" panel
When user presses "SignOff" button
Then "Enter User" page is shown
And user presses "Product Search" icon button
And "Rich Product Search Result" page is shown
And "${Sales Assistant Name}" is not displayed in "Header Panel" panel
And user presses "Back Button" icon button
And "Enter User" page is shown
- Your client properties file entries would be like,
COMPONENT_USER_NAME_TEXT=INPUT_TEXT_1
COMPONENT_PASSWORD_TEXT=INPUT_TEXT_2
COMPONENT_HEADER_PANEL=HeaderDetail.ReferenceHeader.HeaderDetailsPanel
COMPONENT_PRODUCT_SEARCH=SignOnMenuButton2
COMPONENT_BACK_BUTTON=BackButton
WINDOW_ENTER_USER=Point-of-Sale Application:Point-of-Sale Application:Enter User Pos/SignOn/SignOn EnterUserState NextGen1024x768/Pos/SignOn/EnterUser
WINDOW_RICH_PRODUCT_SEARCH_RESULT=Point-of-Sale Application: NextGen/Pos/Product/RichProductSearch/RichProductSearch MainResultFullScreen NextGen1024x768/Pos/Product/RichProductSearch/RichProductSearchFullScreenResults
- Your data properties file entries would be like,
SALES_ASSISTANT_USERNAME=1010
SALES_ASSISTANT_PASSWORD=1010
SALES_ASSISTANT_NAME=Michael Browne