The certification program at Acumatica is meant to provide customers of Acumatica with a selection of trusted Acumatica integrations that adhere to Acumatica best practices. Our product, SPS Commerce EDI, has been a part of the certification process since the early days of its inception and every year we’ve found that the program has become more robust and rigorous. Over the last few certification iterations, the program has been integrating automatic testing to the certification process so that participants can be tested against minor updates as they come out. For 2023 R1, the automatic testing aspect of the certification process has been formalized and made mandatory. This article discusses the recent requirement for a Customization Plug-in for anyone who participates in the program as well as anyone who would like to use the technology to improve their own internal processes.
In past certification iterations, we have submitted a TEST SDK script, page extensions, and a snapshot of our test data. The idea was that the test engineer would restore the snapshot of the data, generate page wrappers (code files to manipulate pages in Acumatica), and then run the automated test script. Starting with 2023 R1 Certification, this will no longer be a valid methodology. The current certification process is to submit a TEST SDK script, page extensions, and a Customization Plug-In. The Customization Plug-In was listed as optional on 2022r2 certification materials but is now required. The Customization Plug-In is meant to programmatically create testing data at the start of a test. This will eliminate the version-specific, manual, and inefficient process of restoring snapshots.
The Customization Plug-In is an Acumatica customization with a code file that inherits the simple object CustomizationPlugin. The CustomizationPlugin object provides two events to override and a function for writing messages to the customization screen. Overriding the events allows you to run code during two key moments in the publishing process. You can execute code ‘after website files were updated, but before website was restarted’ or ‘after customization was published and website was restarted.’
The Customization Plugin is meant to accomplish two key goals.
- A key function of the Customization Plugin is to get the installation ready for the TEST SDK script to run. Part of that is to make sure that the custom pages of the tested customization are available. When the automated test kicks off it will create Test SDK code files for each page that it needs to run its test. If one of these pages is secured, then the process will fail. SPS Commerce limits access to customization pages depending on the customer’s setup. So, before the test can run, the installation must be setup to allow access to these screens. See below for an example of a page that needs to be authorized before the test can be conducted. The ‘Set Permissions’ region in the second code snippet deals with this task.
- Install or refresh test data. SPS Commerce EDI turns staging table data into Acumatica Sales Orders as part of its Key functionality. The Customization PlugIn needs to be able to detect if data needs to be inserted into these staging tables or if the data within needs to be reset to its ’ready to be imported’ state.
Here is an example of a plugin that will make sure there are always records to import at the start of a test.
Even if you’re not currently gearing up for the certification process, I think this technology will be interesting to anyone considering any kind of automated testing.