Skip to main content

POS Automation - Validate New Appointment in CRM Diary

Overview

This tutorial provides step-by-step guidance on automating the process of validating that a newly added appointment is visible in the Diary Month View in the CRM after adding it and navigating through the relevant pages.

What you will learn

How to use the following steps

  1. Login as a user

  2. Press an Icon Button

  3. Check page display

  4. Press a button and check another page displays

  5. Check item NOT display

  6. Wait for x number of seconds

  7. Enter text into a field

  8. Verify text field value

  9. Enter date into a date field

  10. Enter time into a time field

  11. Press a Button

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

note

Make sure your package is registered in the testNG.xml

Right click on the package and create a new cucumber test PosCRMDiary.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 "Transaction Basket CRM button" icon button (Refer Component Inspection).

CRM Icon

  • Add the component entries to .properties file ( Refer Component Details to set up Client Property file).

your entry would be like

COMPONENT_TRANSACTION_BASKET_CRM_BUTTON=CRMButton
  • On the "CRM Menu Screen" page you have to inspect the component id for the "Diary" icon button and "Home Button" icon button. After inspecting add the component entries to .properties file.

Menu Screen Icons

your entries would be like

COMPONENT_DIARY = ButtonPanel.CRMButton3
COMPONENT_HOME_BUTTON=HomeButton
  • On the "CRM Diary Month View" page you have to inspect the component id for the following.
    • "CRM Diary New Appointment Button" icon button
    • "CRM Diary Month View" page

Diary Month View Icons

  • Add the component entries to .properties file.

your entry would be like

COMPONENT_CRM_DIARY_NEW_APPOINTMENT_BUTTON=PAGE_PANEL.BORDER_PANEL.NEW_APPOINTMENT_BUTTON

WINDOW_CRM_DIARY_MONTH_VIEW=Point-of-Sale Application:Point-of-Sale Application:Diary CRM/DiaryMaintenance MonthView NextGen1024x768/Pos/CRM/DiaryMaintenance/MonthView
  • On the "CRM Diary Edit Appointment" page you have to inspect the component id for the search icon button.

Search Icon

  • Add the component entries to .properties file.

your entry would be like

COMPONENT_CRM_DIARY_CLIENT_SEARCH_BUTTON=PAGE_PANEL.BORDER_PANEL.PANEL_1.BUTTON_CLIENT_SEARCH
  • On the "CRM Select Customers Screen" page you have to inspect the component id for the following.
    • "CRM Customer Search Page Name Text" field
    • "CRM Customer Search Page Search Button" icon button
    • "CRM Customer Search Page Select Customer Button" icon button

Client Search

  • Add the component entries to .properties file.

your entry would be like

COMPONENT_CRM_CUSTOMER_SEARCH_PAGE_NAME_TEXT=PAGE_PANEL.BORDER_PANEL.PANEL_6.SEARCH_NAME_TEXT
COMPONENT_CRM_CUSTOMER_SEARCH_PAGE_SEARCH_BUTTON=PAGE_PANEL.BORDER_PANEL.PANEL_6.SEARCH_PANEL
COMPONENT_CRM_CUSTOMER_SEARCH_PAGE_SELECT_CUSTOMER_BUTTON=PAGE_PANEL.BORDER_PANEL.RESULTS_SCROLL.PANEL_5.RESULTS_TABLE.ROW:0.CELL:4.ITEM:0.PANEL_2.SELECT_BUTTON
  • On the "CRM Diary Edit Appointment" page you have to inspect the component id for the following.
    • "CRM Diary Appointment Customer Name" field
    • "CRM Diary Appointment Subject" field
    • "Appointment Start Date" date field
    • "CRM Diary Appointment Details" field
    • "CRM Diary Appointment Start Time" time field
    • "CRM Diary Appointment End Time" time field
    • "CRM Save Button" icon button

Client Search

  • Add the component entries to .properties file.

your entry would be like

COMPONENT_CRM_DIARY_APPOINTMENT_CUSTOMER_NAME=PAGE_PANEL.BORDER_PANEL.PANEL_1.CUSTOMER_NAME
COMPONENT_CRM_DIARY_APPOINTMENT_SUBJECT=PAGE_PANEL.BORDER_PANEL.PANEL_1.APPOINTMENT_SUBJECT
COMPONENT_APPOINTMENT_START_DATE=PAGE_PANEL.BORDER_PANEL.PANEL_1.DATE_PANEL.PANEL_4.APPOINTMENT_START_DATE
COMPONENT_CRM_DIARY_APPOINTMENT_DETAILS=PAGE_PANEL.BORDER_PANEL.PANEL_1.APPOINTMENT_DETAILS
COMPONENT_CRM_DIARY_APPOINTMENT_START_TIME=PAGE_PANEL.BORDER_PANEL.PANEL_1.DATE_PANEL.PANEL_3.START_TIME
COMPONENT_CRM_DIARY_APPOINTMENT_END_TIME=PAGE_PANEL.BORDER_PANEL.PANEL_1.DATE_PANEL.PANEL_3.END_TIME
COMPONENT_CRM_SAVE_BUTTON=PAGE_PANEL.BORDER_PANEL.SAVE_PANEL
  • On the "CRM Diary Month View" page you have to inspect the component id for the back icon button.
    • "Back button" icon button

Back Button

  • Add the component entries to .properties file.

your entry would be like

COMPONENT_BACK_BUTTON=BackButton
  • On the "CRM Menu Screen" page you have to inspect the component id for the home button.
    • "Home Button" icon button

Home Button

  • Add the component entries to .properties file.

your entry would be like

COMPONENT_HOME_BUTTON=HomeButton
  • Finally, Your feature file would be like ,
  Scenario: Verify that New Appointment added is viewable in Diary Month View
Given user signs on as "Manager 2"
When user presses "Transaction Basket CRM button" icon button
And "CRM Menu Screen" page is shown
And user presses "Diary" icon button
And "CRM Diary Month View" page is shown
And user presses "< 1 Month" button and "CRM Diary Month View" page shown
And user confirms "CRM Diary New Appointment Button" not display
And user presses "> 1 Month" button and "CRM Diary Month View" page shown
And user presses "> 1 Month" button and "CRM Diary Month View" page shown
And user presses "CRM Diary New Appointment Button" icon button
And "CRM Diary Edit Appointment" page is shown
And user presses "CRM Diary Client Search Button" icon button
And "CRM Select Customers Screen" page is shown
And user waits "5" seconds
And user enters "${Customer 1 Name}" into "CRM Customer Search Page Name Text" field
And "CRM Customer Search Page Name Text" field displays the text "${Customer 1 Name}"
And user presses "CRM Customer Search Page Search Button" icon button
And user presses "CRM Customer Search Page Select Customer Button" icon button
Then "CRM Diary Edit Appointment" page is shown
And "CRM Diary Appointment Customer Name" field displays the text "Mark Harrison"
And user enters "Test NOT Hide Diary View" into "CRM Diary Appointment Subject" field
When user enters "31/12/2024" into "Appointment Start Date" date field
And user enters "Test NOT Hide Diary View - Description" into "CRM Diary Appointment Details" field
And user enters "01:30" into "CRM Diary Appointment Start Time" time field
And user enters "02:30" into "CRM Diary Appointment End Time" time field
And user waits "2" seconds
When user presses "CRM Save Button" icon button
And "CRM Diary Month View" page is shown
And user presses "Back button" icon button
And "CRM Menu Screen" page is shown
And user presses "Home Button" icon button
And "Transaction Basket" page is shown
And user presses "SignOff" 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_TRANSACTION_BASKET_CRM_BUTTON=CRMButton
COMPONENT_DIARY=ButtonPanel.CRMButton3
COMPONENT_HOME_BUTTON=HomeButton
COMPONENT_CRM_DIARY_NEW_APPOINTMENT_BUTTON=PAGE_PANEL.BORDER_PANEL.NEW_APPOINTMENT_BUTTON
COMPONENT_CRM_DIARY_CLIENT_SEARCH_BUTTON=PAGE_PANEL.BORDER_PANEL.PANEL_1.BUTTON_CLIENT_SEARCH
COMPONENT_CRM_CUSTOMER_SEARCH_PAGE_NAME_TEXT=PAGE_PANEL.BORDER_PANEL.PANEL_6.SEARCH_NAME_TEXT
COMPONENT_CRM_CUSTOMER_SEARCH_PAGE_SEARCH_BUTTON=PAGE_PANEL.BORDER_PANEL.PANEL_6.SEARCH_PANEL
COMPONENT_CRM_CUSTOMER_SEARCH_PAGE_SELECT_CUSTOMER_BUTTON=PAGE_PANEL.BORDER_PANEL.RESULTS_SCROLL.PANEL_5.RESULTS_TABLE.ROW:0.CELL:4.ITEM:0.PANEL_2.SELECT_BUTTON
COMPONENT_CRM_DIARY_APPOINTMENT_CUSTOMER_NAME=PAGE_PANEL.BORDER_PANEL.PANEL_1.CUSTOMER_NAME
COMPONENT_CRM_DIARY_APPOINTMENT_SUBJECT=PAGE_PANEL.BORDER_PANEL.PANEL_1.APPOINTMENT_SUBJECT
COMPONENT_APPOINTMENT_START_DATE=PAGE_PANEL.BORDER_PANEL.PANEL_1.DATE_PANEL.PANEL_4.APPOINTMENT_START_DATE
COMPONENT_CRM_DIARY_APPOINTMENT_DETAILS=PAGE_PANEL.BORDER_PANEL.PANEL_1.APPOINTMENT_DETAILS
COMPONENT_CRM_DIARY_APPOINTMENT_START_TIME=PAGE_PANEL.BORDER_PANEL.PANEL_1.DATE_PANEL.PANEL_3.START_TIME
COMPONENT_CRM_DIARY_APPOINTMENT_END_TIME=PAGE_PANEL.BORDER_PANEL.PANEL_1.DATE_PANEL.PANEL_3.END_TIME
COMPONENT_CRM_SAVE_BUTTON=PAGE_PANEL.BORDER_PANEL.SAVE_PANEL
COMPONENT_BACK_BUTTON=BackButton
COMPONENT_HOME_BUTTON=HomeButton

WINDOW_CRM_MENU_SCREEN=Point-of-Sale Application: NextGen/CRM/CRMMenuEventHandler Prompt State NextGen1024x768/Pos/CRM/Menu/CRMMenu
WINDOW_CRM_DIARY_MONTH_VIEW=Point-of-Sale Application:Point-of-Sale Application:Diary CRM/DiaryMaintenance MonthView NextGen1024x768/Pos/CRM/DiaryMaintenance/MonthView
WINDOW_CRM_DIARY_EDIT_APPOINTMENT=Point-of-Sale Application:Point-of-Sale Application:Edit Appointment CRM/DiaryMaintenance/EditAppointment EditAppointment NextGen1024x768/Pos/CRM/DiaryMaintenance/EditAppointment
WINDOW_CRM_SELECT_CUSTOMERS_SCREEN=Point-of-Sale Application:Point-of-Sale Application:Client Search CRM/CustomerMaintenance SelectCustomer NextGen1024x768/Pos/CRM/CustomerMaintenance/SelectCustomer
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,
MANAGER_2_USERNAME=M1
MANAGER_2_PASSWORD=m1

CUSTOMER_1_NAME=Mark