Skip to content

[Critical Error]: Please ensure 'outputDirectory' is is set to a value - need to update RunTest.PS1 #670

Description

Issue

There needs to be a small change to the RunTest.ps1 to be able to run the test file in one of the sample directories. Without this change, I just got this lovely error:

[Critical Error]: Please ensure 'outputDirectory' is set to a value resolving to a location inside the permitted output location.

To Reproduce

  1. Clone repo: # Clone GitHub repo
    git clone https://github.com/microsoft/PowerApps-TestEngine.git

  2. CD PowerApps-TestEngine\src

  3. dotnet build

  4. Install browsers required by Playwright
    .\bin\Debug\PowerAppsTestEngine\playwright.ps1 install

  5. Navigate to desired sample folder eg. /samples/buttonclicker

  6. Import desired solution to environment e.g. ButtonClicker_1_0_0_4.zip

  7. Create config.dev.json in the /buttonclicker folder

{
  "environmentId": "<environmentId>",
  "tenantId": "<tenantId>",
  "testPlanFile": "./testPlan.fx.yaml",
  "outputDirectory": "",
  "runInstall": false,
  "installPlaywright": false,
  "user1Email": "my@email.com",
  "logLevel": "1",
  "domain": "",
  "queryParams": ""
}

  1. Make some changes to RunTest.ps1 in the same folder
    Essentially change the dame of the config.json file we're reading and also add an additional parameter outputDirectory
$config = Get-Content -Path .\config.dev.json -Raw  | ConvertFrom-Json
$tenantId = $config.tenantId
$environmentId = $config.environmentId
$user1Email = $config.user1Email
$outputDirectory = $config.outputDirectory

Ensure we reference the name of the output directory with an additional parameter below, even though this is empty in the config file

dotnet PowerAppsTestEngine.dll -u "storagestate" --provider "canvas" -a "none" -i "$currentDirectory\testPlan.fx.yaml" -t $tenantId -e $environmentId --outputDirectory "$outputDirectory" --logLevel $config.logLevel

If you comment out --outputDirectory "$outputDirectory" , you can reproduce the error.

Image

Now the tests will run.

Setting installPlaywright=true in the config file, just briefly oppended command window with a few errors but this didn't seem stop me running the tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    newAn Issue created that needs to be looked at by the team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions