HI!
It is possible to create BC container in which the specific features will be automatically enabled. I know I can enable them on page "Feature Management", but I need to create container during CI/CD pipeline and to run automated tests in it.
I tried to use this command for creating container:
$artifactUrl = Get-BCArtifactUrl -type OnPrem -country "w1" -version "23.2.14098.14274" -select Closest
$credential = New-Object pscredential 'admin', (ConvertTo-SecureString -String 'admin' -AsPlainText -Force)
$licenseFile = "-"
$featureKeys = @{ "SalesPrices" = "1" }
$containerName = "features"
New-BcContainer `
-accept_eula `
-containerName $containerName `
-artifactUrl $artifactUrl `
-Credential $credential `
-auth UserPassword `
-updateHosts `
-restart always `
-licenseFile $licenseFile `
-shortcuts none `
-includeTestToolkit `
-imagename local17 `
-enableTaskScheduler `
-featureKeys $featureKeys
and got message "Container features successfully created" but in client i saw that feature isn't enabled.
and then I called command:
$featureKeys = @{ "SalesPrices" = "1" }
$containerName = "features"
Set-BcContainerFeatureKeys -containerName $containerName -featureKeys $featureKeys
But I got message: Unable to set feature key SalesPrices
And in feature management, SalesPricing feature was not enabled.
My another idea is to write AL code in beginning of test to enable feature, but I am not sure if that is possible.
Do anyone have some experience with it? How to test non-default enabled features in automated test?