Pos Automation - Validate Rich Product Search
Overview
This tutorial provides step-by-step guidance on automating the process of selling a Style Colour Size item from Rich 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.richProductSearch
Make sure your package is registered in the testNG.xml
Right click on the package and create a new cucumber test RichProductSearch.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 "Product Search Input" field and "Product Search" icon Button on the Rich Product Search page so that you can enter the productID and search. Refer Component Inspection.
- Add the component entries to
.properties
file ( Refer Component Details to set up Client Property file).
your entries would be like
COMPONENT_PRODUCT_SEARCH_INPUT=RPSFullPagePanel.DescriptionFiltterPanel.SearchInputPanel.ProductSearchInput
COMPONENT_PRODUCT_SEARCH_BUTTON=RPSFullPagePanel.DescriptionFiltterPanel.ProductSearchButton
- 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
STYLE_COLOUR_SIZE_PRODUCT_2_DESCRIPTION=Rose Print Tea Dress
STYLE_COLOUR_SIZE_PRODUCT_2_LONG_DESCRIPTION=Lightweight cotton tea dress. Back shirring for improved fit.
STYLE_COLOUR_SIZE_PRODUCT_2_EXTENDED_DESCRIPTION=Length 39in/99cm. Sits on the knee.\nMachine washable.\nCotton.
STYLE_COLOUR_SIZE_PRODUCT_2_COLOUR_1=Navy Blue
STYLE_COLOUR_SIZE_PRODUCT_2_SIZE_1=8
STYLE_COLOUR_SIZE_PRODUCT_2_SIZE_2=10
- On the Rich Product Search Results Page, you have to inspect the component id for the "Product Search Results Input" field and "Product Search Result Item 1". After inspecting add the component entries to
.properties
file.
your entries would be like
COMPONENT_PRODUCT_SEARCH_RESULTS_INPUT=FullScreenControlPanel.FIltersPanel.SearchInputPanel.ProductSearchInput
COMPONENT_PRODUCT_SEARCH_RESULT_ITEM_1=RPSFullScreenMainPanel.ResultPanel.ProductListDataTable.ROW:0.CELL:0.ITEM:0.PRODUCT_DETAILS_CELL.PRODUCT_ROOT.PANEL_6
-
On the Rich Product Search Details Page, you have to inspect the component id for the following
- "Product Description Field" field
- "Product ID Field" field
- "Product Long Description Field"
- "Product Price Field"
- "Product Info Field"
- "Product Details You've Just Seen Button"
- "Product Color Combo" combobox
- "PRODUCT SIZE 2 BUTTON" icon button
- After inspecting add the component entries to
.properties
file.
your entries would be like
COMPONENT_PRODUCT_DESCRIPTION_FIELD=RPSFullPagePanel.DescriptionField
COMPONENT_PRODUCT_ID_FIELD=RPSFullPagePanel.ProductIdField
COMPONENT_PRODUCT_LONG_DESCRIPTION_FIELD=ProductLongDescriptionField
COMPONENT_PRODUCT_PRICE_FIELD=RPSFullPagePanel.CURRENT_PRICE_PANEL.CURRENT_PRICE
COMPONENT_PRODUCT_INFO_FIELD=ProductInfoField
COMPONENT_PRODUCT_DETAILS_YOU'VE_JUST_SEEN_BUTTON=RPSFullPagePanel.FOTTER_PANEL.FeaturedButtonsTable.RECEINT_VIEWD_BUTTON
COMPONENT_PRODUCT_COLOR_COMBO=RPSFullPagePanel.ControlPanel.PANEL_3.ProductOptionsPanel.TABLE_2.ROW:0.CELL:0.ITEM:0.PANEL_7.ColourCombo
COMPONENT_PRODUCT_SIZE_2_BUTTON=RPSFullPagePanel.ControlPanel.PANEL_3.ProductOptionsPanel.TABLE_2.ROW:3.CELL:0.ITEM:0.SizeDataTable.ROW:1.CELL:0.ITEM:0.PANEL_4.SizeButton
- When you press the buttons to continue the rich product search, you will be navigated to the following pages. Therfore the Window names should be inspected and add the window entries to
.properties
file ( Refer Window Details to set up Client Property file).
- "Rich Product Search" page
- "Rich Product Search Result" page
- "Rich Product Details" page is shown
- And "Transaction Basket" page is shown
- "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_RICH_PRODUCT_SEARCH=Point-of-Sale Application: NextGen/Pos/Product/RichProductSearch/RichProductSearchMainCategoriesSelection RichProductSearchMainCategories NextGen1024x768/Pos/Product/RichProductSearch/RichProductSearchMainCategories
WINDOW_RICH_PRODUCT_SEARCH_RESULT=Point-of-Sale Application: NextGen/Pos/Product/RichProductSearch/RichProductSearch MainResultFullScreen NextGen1024x768/Pos/Product/RichProductSearch/RichProductSearchFullScreenResults
WINDOW_RICH_PRODUCT_DETAILS=Point-of-Sale Application: NextGen/Pos/Product/RichProductSearch/DisplayRichProductDetails DisplayRichProductDetails NextGen1024x768/Pos/Product/RichProductSearch/DisplayRichProductDetails
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
-
To check selecting a combobox feature refer ComboBox Selection
-
Finally, Your feature file would be like ,
Scenario: Sell Style Colour Size item from Rich Product Search
Given user signs on as "Manager 6"
When user presses "Sales" button
And user presses "Rich Product Search" button
Then "Rich Product Search" page is shown
When user enters "${Style Colour Size Product 2 Description}" into "Product Search Input" field
And user presses "Product Search Button" icon button
Then "Rich Product Search Result" page is shown
And "Product Search Results Input" field displays the text "${Style Colour Size Product 2 Description}"
And user waits "Product Search Result Item 1" to display
And user waits "2" seconds
When user presses "Product Search Result Item 1" icon button
Then "Rich Product Details" page is shown
And "Product Description Field" field displays the text "${Style Colour Size Product 2 Description}"
And "Product ID Field" field displays the text "PRODUCT NO ${Style Colour Size Product 2}"
And "Product Long Description Field" field displays the text "${Style Colour Size Product 2 Long Description}"
And "Product Price Field" field displays the text "${Style Colour Size Product 2 Price}"
And "Product Info Field" field displays the text "${Style Colour Size Product 2 Extended Description}"
When user presses "Product Details You've Just Seen Button" icon button
And "Rich Product Details" page is shown
And user waits "2" seconds
And user selects "${Style Colour Size Product 2 Colour 1}" from "Product Color Combo" combobox
And user presses "PRODUCT SIZE 2 BUTTON" icon button
And user presses "ADD TO BAG" button
Then "Transaction Basket" page is shown
And "${Style Colour Size Product 2 Description}" is displayed in "Receipt" list
And "${Style Colour Size Product 2 Price}" is displayed in "Receipt" list
And "${Style Colour Size Product 2}" is displayed in "Receipt" list
And "${Style Colour Size Product 2 Size 2}" 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} |
| item | ${Style Colour Size Product 2 Description},${Style Colour Size Product 2 Price} |
| item | Style: ${Style Colour Size Product 2} |
| item | Colour: ${Style Colour Size Product 2 Colour 1} |
| item | Size: ${Style Colour Size Product 2 Size 2} |
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_PRODUCT_SEARCH_INPUT=RPSFullPagePanel.DescriptionFiltterPanel.SearchInputPanel.ProductSearchInput
COMPONENT_PRODUCT_SEARCH_BUTTON=RPSFullPagePanel.DescriptionFiltterPanel.ProductSearchButton
COMPONENT_PRODUCT_SEARCH_RESULTS_INPUT=FullScreenControlPanel.FIltersPanel.SearchInputPanel.ProductSearchInput
COMPONENT_PRODUCT_SEARCH_RESULT_ITEM_1=RPSFullScreenMainPanel.ResultPanel.ProductListDataTable.ROW:0.CELL:0.ITEM:0.PRODUCT_DETAILS_CELL.PRODUCT_ROOT.PANEL_6
COMPONENT_PRODUCT_DESCRIPTION_FIELD=RPSFullPagePanel.DescriptionField
COMPONENT_PRODUCT_ID_FIELD=RPSFullPagePanel.ProductIdField
COMPONENT_PRODUCT_LONG_DESCRIPTION_FIELD=ProductLongDescriptionField
COMPONENT_PRODUCT_PRICE_FIELD=RPSFullPagePanel.CURRENT_PRICE_PANEL.CURRENT_PRICE
COMPONENT_PRODUCT_INFO_FIELD=ProductInfoField
COMPONENT_PRODUCT_DETAILS_YOU'VE_JUST_SEEN_BUTTON=RPSFullPagePanel.FOTTER_PANEL.FeaturedButtonsTable.RECEINT_VIEWD_BUTTON
COMPONENT_PRODUCT_COLOR_COMBO=RPSFullPagePanel.ControlPanel.PANEL_3.ProductOptionsPanel.TABLE_2.ROW:0.CELL:0.ITEM:0.PANEL_7.ColourCombo
COMPONENT_PRODUCT_SIZE_2_BUTTON=RPSFullPagePanel.ControlPanel.PANEL_3.ProductOptionsPanel.TABLE_2.ROW:3.CELL:0.ITEM:0.SizeDataTable.ROW:1.CELL:0.ITEM:0.PANEL_4.SizeButton
WINDOW_RICH_PRODUCT_SEARCH=Point-of-Sale Application: NextGen/Pos/Product/RichProductSearch/RichProductSearchMainCategoriesSelection RichProductSearchMainCategories NextGen1024x768/Pos/Product/RichProductSearch/RichProductSearchMainCategories
WINDOW_RICH_PRODUCT_SEARCH_RESULT=Point-of-Sale Application: NextGen/Pos/Product/RichProductSearch/RichProductSearch MainResultFullScreen NextGen1024x768/Pos/Product/RichProductSearch/RichProductSearchFullScreenResults
WINDOW_RICH_PRODUCT_DETAILS=Point-of-Sale Application: NextGen/Pos/Product/RichProductSearch/DisplayRichProductDetails DisplayRichProductDetails NextGen1024x768/Pos/Product/RichProductSearch/DisplayRichProductDetails
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,
STYLE_COLOUR_SIZE_PRODUCT_2_DESCRIPTION=Rose Print Tea Dress
STYLE_COLOUR_SIZE_PRODUCT_2_LONG_DESCRIPTION=Lightweight cotton tea dress. Back shirring for improved fit.
STYLE_COLOUR_SIZE_PRODUCT_2_EXTENDED_DESCRIPTION=Length 39in/99cm. Sits on the knee.\nMachine washable.\nCotton.
STYLE_COLOUR_SIZE_PRODUCT_2_COLOUR_1=Navy Blue
STYLE_COLOUR_SIZE_PRODUCT_2_SIZE_1=8
STYLE_COLOUR_SIZE_PRODUCT_2_SIZE_2=10
STREET_1=Enactor House
STREET_2=1 Bluecoats
TOWN=Hertford
COUNTY=Hertfordshire
POSTCODE=SG14 1PB
STORE_PHONE_1=01992 500881
MANAGER_6_USERNAME=M6
MANAGER_6_PASSWORD=m6