Ok, Acumatica provides as part of platform is Acumatica Test Framework. Acumatica test Framework is a set of tools and libraries that can be used for unattended black-box testing of any product or customization that is based on Acumatica Platform right in your favorite browser. For interacting with UI controls and components Acumatica Test Framework uses Selenium Web Driver. You can read more about Selenium here or nice example of it is this video.
The high level diagram of Test Framework components is described here:
Acumatica Test Framework Architecture:
As you can see here the core thing of the test framework is Element IDs – Each HTML element has own ID how browser can find it. Out page generator tool will extract all IDs and generate some sort of Object representaiton of the page using controls and IDs.
Later you can write a test using the classes generated. IDs will be passed by Acumatica Test Framework to Selenium Web Driver so it can find control by ID and execute as user it agains the browser.
The usage flow is like this:
- You have Acumatica ERP instance with required module or customization that you want to test.
- Using Page Wrapper Generation Tool you create a set of classes that will represents Acumatica page structure including controls, buttons, grids, columns, panels and so on. This tool is related on Acumatica platform and can dynamically analyse all standard and custom pages including customization. You need to create wrappers for each page that you want to test.
- Test Framework contains all required classes and methods that you can use to work with browser pages and controls. For example you can open selectors, search values, type or past values, click buttons, wait for long run operations and so on.
- Based on Wrappers and Framework classes you write your own Tests (that is classes) that will contains test logic.
- Using Test Runner you can lunch required tests. Test runner will load all test libraries and using interaction with Selenium Web Driver will open browser and execute all required steps.
- Selenium Web Driver is intermediate layer between test and browser. This tool knows browser API and can simulate user clicks with mouse and keyboards on each control separately. Also it can get values back to validate result. We tell about it later in practice part.
- Browser is embedded in test SDK, as it requires specific version of browser to run smoothly. When you run test you will see browser window and can check how your test is running.
Please note that version of Test SDK should be equal to version of your Acumatica. In this examle I use SDK for version 17.209.0028 .
After, when you download and unzip your SDK your filder will be look like this:
Good thing that Test SDK contains documentation, getting started training and a lot of examples. Just check file SDK – README.pdf - it is only 446 pages :).
All list of components in this folder:
So, for example we can write test one time, modificate logic of graph or add new functionality and execute test. It is good for economy time and validation of page.
In this example we are elaborate how to write test for create new POOrder.
After executing you can see result (log) of testing, that include comments, events, screenshots and other:
So lets go to practice - Acumatica Test Framework in Acumatica. Part 2 (practice)