Launch Configuration for Pos Automation
Overview
Enactor lets you run automation scripts that can drive the POS behaviour. Currently, Automation tests are run using Maven launches. This guide explains how to create a new maven launch.
Steps to create the Launch
Given a Pos Automation Feature we can create a maven launch and execute the tests.
Go to Run -> Run Configuration -> Maven Build and create a new maven launch.
Choose the Automated Test
Project containing the feature files as the Base Directory.
Populate the Goals
clean install test -DforkCount=0 -Dcucumber.plugin="pretty" -Dcucumber.filter.tags="@PT-20000" -Dcucumber.publish.quiet=true
-Dcucumber.filter.tags
refers to the tags associated with scenarios in your feature files that needs to be executed.
Add Parameters
Parameter Name | Value |
---|---|
autConfigPropertyFileNames | posNextGen1024x768 (Note: This property file name can be any name and the name should be similar to the created property file) |
autClient.configFolder | Path to the local pos config folder e.g., C:\Enactor\pos\config |
enactor.tests.profile | uitest |
debug.enabled | true |
autHostName | localhost (If you are running on a remote POS, provide the IP of the remote POS machine. If you are running on a local machine, use localhost ) |
autPort | 4099 |
forkMode | never |
autSimulateMouseMode | false |
testDataPropertyFileNames | testData |
cucumber.filter.tags | Test Case num e.g., @PT-649 |
Terminal number | Terminal number of the POS that you will use to run the automation eg: 01 |
For React POS
If it is a React POS, following properties are additional.
Parameter | Value |
---|---|
autConfigPropertyFileNames | posNextGen1024x768,webPos,htmlFixedPos (Note: This property is already added from the above given properties. For React POS, you should also add the given filenames for the value) |
driver.exec.path | Download the chrome driver from https://chromedriver.chromium.org/downloads. Version should be equal to the Chromium Version of the POS. (Chromium version of the POS is stated in the Release Note) Create a new folder WebDrivers in /WorkspaceSetup/Software/WebDrivers and copy the downloaded driver to that folder eg:- C:\Development\training-workspace-1.0.12\WorkspaceSetup\Software\webDrivers\chromedriver.exe |
driver.type | org.openqa.selenium.chrome.ChromeDriver |
driver.remote.debugging.port | localhost:9222 (If you are running on a remote POS, provide the IP of the remote POS machine. Also, after you have done Port forwarding, change the port to 9223) |
Launcher Properties will be shown as below.
Port Forwarding
For security reasons JCEF framework does not support accessing the remote debugging URL outside the “localhost” content.(i.e You cannot remote debug remote POS machine)
To enable accessing accessing this port from a remote host, use port forwarding to allow accessing the chromium remote debugging URL.
When React Fixed POS is up and running, it exposes React App through a http://localhost:9222/
Selenium uses this remote debugging port to execute automation. 9222 is not exposed to external, so run following command in command prompt to forward traffic to 9223.
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=9223 connectaddress=localhost connectport=9222
Click run to execute the automation