Search code examples
navisiondynamics-navdynamics-business-centralmicrosoft-dynamics-navbusinesscentral

Test Automation in business central


I am trying to create a test automation project for my business central app (version 21). But I am unable to reference test libraries in the project.

I followed the manual, installed business central ver.21 sandbox on docker,

however I am unable to reference test libraries. Here is my app.json:


{
    "id": "e6010585-50b3-4e3a-8c9a-65c9fd591a0f",
    "name": "GeoLocalizationTest",
    "publisher": "Default publisher",
    "version": "1.0.0.0",
    "brief": "",
    "description": "",
    "privacyStatement": "",
    "EULA": "",
    "help": "",
    "url": "",
    "logo": "",
    "dependencies":
    {
        "id": "99aa9ff9-ec49-40ca-9fa0-5726b66419fa",
        "name": "GeoLocalization",
        "publisher": "BIT",
        "version": "1.0.0.0"
    },
    "test": "21.0.0.0",
    "screenshots":,
    "platform": "1.0.0.0",
    "application": "21.0.0.0",
    "idRanges":
    {
        "from": 71372600,
        "to": 71372600
    },
    "resourceExposurePolicy": {
        "allowDebugging": true,
        "allowDownloadingSource": true,
        "includeSourceInSymbolFile": true
    },
    "runtime": "10.0",
    "features": "NoImplicitWith"
}

here is the error:

The request for path /BC/dev/packages?publisher=Microsoft&appName=Test&versionText=21.0.0.0&appId=00000000-0000-0000-0000-000000000000&tenant=default failed with code NotFound. Reason: No published package matches the provided arguments.


Solution

  • So I found this:

    "For those who come from a C/AL based version (per-BC15) note that the test keyword in the app.json no longer applies. To reference any of the test related apps (see list above) you need to explicitly reference them as dependencies. You can copy the relevant dependency definition line in the code block above and past that into your dependencies collection in your app.json."

    Link: https://www.fluxxus.nl/index.php/bc/test-apps-dependencies/

    Apparently "test" property only worked in the versions that still had development environment.

    Now you have to add every test library you need in the dependencies.