1

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.

  • It depends on how you created your container. Maybe you need to add some parameters to have test libraries published – Mak Sim Oct 28 '22 at 14:35
  • I Checked and and test libraries are there, I even was able to add dependency like this: { "id": "5d86850b-0d76-4eca-bd7b-951ad998e997", "name": "Tests-TestLibraries", "publisher": "Microsoft", "version": "21.0.46256.48475" } this works and gives me access to assert codeunit and other libraries, but I don't think it's a correct way to do it. – David Makharadze Oct 28 '22 at 14:49
  • Dependency is the only way I think. Do you still have error after adding it? – Mak Sim Oct 29 '22 at 06:02
  • No, it works with dependency. However it is not done that way in microsoft official docs, that's why I am not sure if adding it with a dependency is a correct way. I am doing it with dependency now because I have not found any other way, I will write here if I find the solution to it. – David Makharadze Oct 30 '22 at 10:40

1 Answers1

1

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.