NAVDEMO / RunTests

5 stars 7 forks source link

Using Codeunit 130402 instead custom page #4

Closed kine closed 5 years ago

kine commented 5 years ago

Hi Freddy, is it an issue to use Codeunit 130402 instead the custom page? Or, is this tool able only pages?

The test Apps I am using are "installing" themselfs into the table CALTestEnabledCodeunit (130403) thus I do not need to select whatever to run them.

freddydk commented 5 years ago

The tool simulates a client and as such can only work with pages (you cannot run a codeunit from the webclient either). You would have to create a page, which runs your codeunit.

The idea for this tool is that apps should create a testsuite for themselves on install - and then you would run the testsuite for that app. Is there a reason why this is a bad idea?

BTW The custom page contains enough information to generate test results, stack traces and everything as output. This means that there is no reason to run xml ports and other things to get the results after te run - IMO that has a lot of advantages

kine commented 5 years ago

Ok, agree. This is simpler. Just wanted to check if there is a way how to easily transfer my current pipeline to this tool. Will just need to change the install code of the apps to do something else.

Thanks for the info.

freddydk commented 5 years ago

I have added the mechanism to the test-app which is the foundation of my CI/CD blog post series, here (based on a suggestion by Mike Glue): https://dev.azure.com/businesscentralapps/_git/HelloWorld?path=%2Ftest&version=GBmaster Only problem right now is that two apps will delete the tests added by the other - will fix this. Also the sample is now using Run-TestsInNavContainer for CI - works really well.