POS Automation - Validate Voucher Subtype Selection
Overview
This tutorial provides step-by-step guidance on automating the process of validating that the default voucher subtype is correctly selected in the "Selection List".
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.voucher
Make sure your package is registered in the testNG.xml
Right click on the package and create a new cucumber test PosVoucherSubtypeSelection.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, press the button labeled "Sales" on the transaction page. Refer Press a button
- After pressing the Sales button, press the button labeled "More" on the transaction page. Refer Press a button
- After pressing the More button, press the button labeled "Gift Voucher" on the transaction page.. Refer Press a button
- When you press the "Gift Voucher" button you will be navigated to the "Select Voucher Type" 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 entry would be like
WINDOW_SELECT_VOUCHER_TYPE=Point-of-Sale Application: Pos/Voucher/IssueVoucherMain VoucherTypeSelection Pos/General/SelectionPrompt
After that you have to inspect the Component Id for the "Selection List" list (Refer Component Inspection).
- Add the component entry to
.properties
file ( Refer Component Details to set up Client Property file).
your entry would be like
COMPONENT_SELECTION_LIST=SelectionList
When you press the "OK" button you will be navigated to the "Select Voucher Sub Type" 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 entry would be like
WINDOW_SELECT_VOUCHER_SUB_TYPE=Point-of-Sale Application: Pos/Voucher/IssueVoucherMain SelectSubType Pos/General/SelectionPrompt
After that you have to inspect the Component Id for the "Selection List" list (Refer Component Inspection).
- Add the component entry to
.properties
file ( Refer Component Details to set up Client Property file).
your entry would be like
COMPONENT_SELECTION_LIST=SelectionList
When you press the "Cancel" button you will be navigated to the "Transaction Basket" 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 entry would be like
WINDOW_TRANSACTION_BASKET=Point-of-Sale Application:Point-of-Sale Application:Sale Pos/Sale/Sale SignedOnState NextGen1024x768/Pos/Sale/Sale
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 entry would be like
WINDOW_ENTER_USER=Point-of-Sale Application:Point-of-Sale Application:Enter User Pos/SignOn/SignOn EnterUserState NextGen1024x768/Pos/SignOn/EnterUser
- Finally, Your feature file would be like ,
Scenario: Verify Voucher subtype default selection is the first item in the list
Given user signs on as "Sales Assistant"
And user presses "Sales" button
And user presses "More" button
And user presses "Gift Voucher" button and "Select Voucher Type" page shown
And user selects "Gift Voucher UK" from "Selection List" list
And user presses "OK" button
And "Select Voucher Sub Type" page is shown
And "£5" is selected in "Selection List" list
And user presses "Cancel" 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_USER_NAME_TEXT=INPUT_TEXT_1
COMPONENT_PASSWORD_TEXT=INPUT_TEXT_2
COMPONENT_SELECTION_LIST=SelectionList
WINDOW_SELECT_VOUCHER_TYPE=Point-of-Sale Application: Pos/Voucher/IssueVoucherMain VoucherTypeSelection Pos/General/SelectionPrompt
WINDOW_SELECT_VOUCHER_SUB_TYPE=Point-of-Sale Application: Pos/Voucher/IssueVoucherMain SelectSubType Pos/General/SelectionPrompt
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