Retail:Developers Guide/Retail/Automation architecture
Contents |
The basics
The automation architecture was created focused on easy test creation and maintenance
Test creation
Concetps:
- Every UI element of the application is mapped in the TestId class
- There are 2 commands available to the developer
- tap: simulates a tap in the application
- verify: verifies that a field in the application contains the expected value
- There are also 2 database commands
- DatabaseHelperSelect: executes a SQL select in the database
- DatabaseHelperInsertUpdateOrDelete: executes an update or delete in the database
- For waits there is 1 command:
- new Wait
- To directly send javascript commands to the application there is 1 commnad:
- SeleniumHelper.executeJavascriptWithReturn
Automation engine
The automation engine picks up all the tests, then sort them, then executes the tests. When a test is executed, the
Project hierarchy
| +-- common | +-- retail | +-- pack | +-- extmodules | +-- stress
This is the basic project hierarchy. The common package holds support classes that overhaul the automation logic. The retail package contains the suites and tests. Inside the retail package, suites and tests are separated based on goal; e.g: the pack package verifies the Openbravo Retail Pack, the extmodules package verifies several modules added to the Retail Pack and the stress package verifies the Retail Pack under heavy load.
Execution flow
How to create a new project
A project in Retail automation contains the logic required for a complete set of test to be run in a server. For example, the Retail Pack is tested in several servers that run the contents in the org.openbravo.test.mobile.retail.pack package
To create a new project:
- create a new package under org.openbravo.test.mobile.retail. Customer packages should start with custom*. E.g. for custombut:
- create the directory structure and files as in the image. Copy the files from another project if needed
- in the build.xml file, add a new task. Copy the "test.retail.highvolmodules" task and adapt directories and target suite. If the automation is going to be run in several servers, then copy the "test.retail.concurrent" suite
- RM must execute this new ant task in the server
Note: an example can be shown in pi-mobile, rev 5362, changeset 0cb2bd0e751f, description 'Added a new custom project for BUT'