Skip to main content

Pos Automation

Overview

Enactor includes the ability to run automation scripts that can drive the POS behaviour

What You Will Learn

  • How to setup Eclipse to support POS Automation
  • How to set up the Eclipse workspace to run POS Automation using Maven scripts and MSI POS.

Pre-requisites

  • Java
  • Eclipse IDE

See Required Software for further details

Setup an MSI POS in Automation Mode

You will also need an installed Enactor POS (installed using the standard Enactor MSI).

Fresh Installation

Install MSI POS:

  • The following installer property should be set in the .ini file during the installation
    AUTOMATION_TEST_MODE=true

Existing Installation

If you have installed the Enactor POS without the property above in the .ini file, you can activate the Automation Mode using the following step:

  • Navigate to the POS installation directory (e.g. C:\enactor\pos\scripts), open the setEnv.ps script using a text editor and add the following line:

    set AUTOMATION_TEST_MODE=true
note

The following guide has been written with Microsoft Windows as the base operating system. As a result, some references to application options and screenshots may differ.

Using the Workspace Setup

Download the following zip file WorkspaceSetup.zip and extract it into the C:\Development directory

Launch Eclipse and when prompted for a workspace enter the following path C:\Development

Launch Eclipse Development Dir Workspace

Click Launch... button

Cucumber Plugin Installation

To install the Cucumber plugin, Open the Install New Software wizard by selecting the Help Menu → Install New Software

Select Install New Software

Click Add... button.

Install New Software Dialoge

Enter the name Cucumber in the name text box

Enter the URL https://cucumber.github.io/cucumber-eclipse/update-site/main/ in the Location text box

Add Cucumber Repository Details

Click Add…button

Click OK…button

Select all the available plugins Ansi Console and Cucumber Eclispe Plugin plugin and Click Next…button

Select All Enactor Tool Kit Plugins

Complete the installation and allow Eclipse to restart.

Setting up Maven

To use the Maven Dependency manager with Enactor you will first need to set up Maven.

Create a new Maven respository directory named .m2 within you user account directory C:\Users\<USER_NAME>\.m2

Create M2 Directory

From your OS file system, copy the checkout setting.xml file found within /WorkspaceSetup/Config/maven to the newly created .m2 directory.

Checked Out Settings XML

Edit the settings.xml file and replace the following placeholders USER_NAME and PASSWORD with your Enactor Active Directory Credentials

Edit Settings XML

Open the Eclipse Preferences menu and enter Maven in the search bar.

Select the Maven → User Settings

Open Maven Preferences

Confirm that your settings.xml appears in the User Settings Field and that the local Repository Field is also populated

Confirm Maven Settings

Switching to the Automation Workspace

Create a new Directory within the /WorkspaceSetup/ folder named AutomationWorkspace

Enactor development using the To switch the Development workspace, select File menu → Switch Workspace → Other

Switch Workspace

When prompted for a workspace browse to and select the /WorkspaceSetup/AutomationWorkspace directory and click the Select Folder... button

Browse To Workspace

Click Launch... button

Launch New Workspace

Import Config

Select File menu → Import

From the Import dialog, Expand the General collection and select Existing Projects into Workspace

Click Next... button

Update the Select root directory text box by browsing to the location of the /WorkspaceSetup/Config

Select Search for nested projects

Select the Config project

Select Config Enactor Home

Click Finish

Importing The Working Projects

Select File menu → Import

From the Import dialogue, Expand the Maven collection and select Existing Maven Projects

Select Import Existing Maven Projects

Click Next... button

Update the Root directory text box by browsing to the location of the /WorkspaceSetup/CustomerProducts

Expand Advanced and from the drop-down of Name Template select name

Click Finish... button

Select To Import Workspace Projects

As the projects are imported they will trigger a build phase. This can take some time. If the projects do not build successfully or the build phase did not start, you will need to perform a manual maven install on the project Workspace Projects using the supplied MVN Install (Traning Projects).

To run MVN Install (Traning Projects), Select Run menu → Run Configurations

GRD Select Run Configurations

Select MVN Install (Training Projetcs)

Maven Install Workspace Projects

Once the build is completed right click on the WorkspaceProject → Maven → Update Projects...

Select Maven Update

Click Select All... button

Click OK... button

Maven Update Select All

Import General Runtime Dependencies Project

Select File menu → Import

From the Import dialogue, Expand the Maven collection and select Existing Maven Projects

Click Next... button

Update the Root directory text box by browsing to the location of the /WorkspaceSetup/GeneralRuntimeDependencies

Expand Advanced and from the drop-down of Name Template select name

Click Finish... button

Deploy General Runtime Dependencies

The runtime Enactor application requires a few additional dependencies to be made available to it such as JDBC connection drivers, licence binaries etc

Select Run menu → Run Configurations

GRD Select Run Configurations

From the Run Configurations dialog, expand the Maven Build section and select Deploy General Runtime Dependencies

Click Run... button

Run GRD

When complete you will have a directory structure similar to the following within C:\Developemnt\WorkspaceSetup

."C:\Developemnt"
`-- "WorkspaceSetup"
|-- "Configuration"
|-- "EnactorHome"
|-- "estateManager"
|-- "BPELProcesses"
|-- "deploy"
activity-flow-compensation.par
generic-activity-flow.par
|-- "licence"
licenceManager_x64.dll
|-- "shared"
licence-helper.jar
mariadb-java-client-2.7.9.jar
mysql-connector-java-5.1.49.jar
mysql-connector-java-8.0.33.jar
|-- "Software"
|-- "axis2"
|-- "coreAutomation"
|-- "server"
|-- "WebCore"
|-- "WebMaintenance"
|-- "WebPos"
|-- "WebReports"
|-- "WebRetailProcessing"
|-- tomcat

Adding Core Automation Jar to the POS

For the AUT Launcher to successfully run you will need to update the classpath of your POS Application

Copy the Jar file found at Development\WorkspaceSetup\Software\coreAutomation and place it into the custom-lib directory of your POS Application Enactor\pos\custom-lib

Running a feature

To run a feature you should have a Maven Run Configuration.

Run menu → Run Configurations → Maven Build

Select Config Enactor Home

Parameters should be changed appropriately. You can refer Lauch Configurations and update accordingly.

Select Config Enactor Home

Property Changes

  • If you are running Automation on React POS add following to the posNextGen1024x768.properties file. Development\WorkspaceSetup\CustomerProducts\TrainingPosAutomationTests\test\posNextGen1024x768.properties

    POS_APPLICATION_TYPE=HTML_FIXED
  • Update username and password (POS login) in testData.properties Development\WorkspaceSetup\CustomerProducts\TrainingPosAutomationTests\test\testData.properties

Run Automation

Run the maven launch TrainingFunc1