NAVDEMO / RunTests

5 stars 7 forks source link

RunTests

This is a Proof Of Concept prototype of a PowerShell based test runner for NAV / Business Central.

The Test Runner will execute a test suite with GUI Allowed set to True to allow you to run normal tests and also testpages.

It is NOT part of this POC how to create test suites or add tests to the test suite. The idea is that this should be done in the OnInstall trigger of the app you want to test, from a RapidStart package, an API, some PowerShell cmdlets or whats best.

Files

Get Started

Create a container for testing. You can use a script like this:

$imageName = "mcr.microsoft.com/businesscentral/onprem:w1"
$credential = New-Object pscredential 'admin', (ConvertTo-SecureString -String 'P@ssword1' -AsPlainText -Force)
$containerName = "fkdev"
New-NavContainer -imageName $imageName -containerName $containerName -accept_eula -updateHosts -auth NavUserPassword -Credential $credential -includeCSide -enableSymbolLoading -includeTestToolkit

Import the PsTestTool page manually, or using a script like this:

$fobfile = Join-Path $env:TEMP "PSTestTool.fob"
Download-File -sourceUrl "https://aka.ms/pstesttoolfob" -destinationFile $fobfile
Import-ObjectsToNavContainer -containerName $containerName -objectsFile $fobfile -sqlCredential $credential

Open page 130401 in the Web Client (use the shortcut on the desktop called fkdev Test Tool) and import a number of tests to the DEFAULT test suite.

Run RunTests2.ps1 to invoke the test runner from the host.

Run Run-TestsInNavContainer.ps1 to invoke the test runner inside the container

If you have issues or ideas

If you run into any issues or have any ideas that you think we should consider, please create issues on this repository. Please also follow the issues list, the commits/checkins or this readme to see what is happening on the project.

What next