MTA HOW TO’s
How can MTA access my Mendix projects?
How can I create an API key for my Mendix account?
How can MTA access the environment that my Mendix App is running on?
How can I add the MTA Plugin user to my Mendix project?
How can MTA test logic that exists only in pages?
To access Mendix projects, the user who logs in to MTA must be linked to a Mendix user.
After MTA can access the projects linked to the Mendix user, the Mendix model can be downloaded for a selected revision. However, to communicate with the environment the App is running on, the MTA Plugin User must be linked as well.
Note: If this check is performed three times unsuccessfully because the password is incorrect, Mendix can temporarily block the user.
Download the MTA plugin module from Github with the highest Mendix version possible for your project. Check the version that is displayed on the Plugin. It represents the lowest supported Mendix version, all higher Mendix versions are supported.
https://github.com/Menditect/MENDITECT-MTA-Plugin/releases
Import the MTA plugin module package in your test application as a new module.
Make sure to delete any old JAR files like mta-plugin-***.jar from the userlib subfolder in your project directory.
Create a user role 'MTAPluginUser' and make sure not to select any modules in this step
Select the following roles for user role 'MTAPluginUser'
'MTAPluginUser' from MTAPlugin module
'User' from System module
'User' from Administration module
Go to navigation and create a role-based home page for MTAPluginUser for the primary navigation layout
Select Edit. Mendix shows page 'Role-based home pages'
Select New. Mendix shows page 'Select user role'
Select user role 'MTAPluginUser'
Select target and select page HomepageMTAPluginModule
Repeat this step for all other navigation layouts in use (tablet, phone, hybrid)
Start the test application and login with a user role that has Create rights on Account
Create a local user (not a web service user) with the role 'MTAPluginUser'. Give the user a name and note it for later.
There can be different scenarios in a Mendix project where logic exists in pages. For every scenario, there is a different solution to test the logic in MTA. In the case of a microflow being executed from a page, these are the steps to follow:
Other frontend logic not concerning microflows, like frontend validation or visibility constraints, can be simulated in MTA.
Testing an API means creating an integration test where two apps communicate. One hypothetical app (A) executes a REST call. The other app (B) hosting a REST service, will answer. In MTA it is not possible to directly execute a REST call or host a REST service, but it is possible to use the microflows where the REST call or service depends on.
To test app (A), a microflow that performs the REST call can be used. This microflow is executed from MTA, and will contain the following elements:
Alternatively, only the submicroflow containing the logic could be used for unit testing. This means however the JSON string must be manually entered in MTA, using a Create Object test step.
Finally the steps in MTA to test are:
To test app (B), the microflow is executed that is part of the REST operation.
To find this microflow, open the Published REST service in Mendix Studio Pro en select Show for that REST operation:
This microflow will contain the same input parameter data as the microflow executing the REST call for app (A), but the parameters are typed. For example:
The output of this microflow is an httpresponse.
Finally the steps in MTA to test are: