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

Open
#670 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
powershell
Domain
testing-qa

Research direction

Start with RunTest.ps1 and compare its config.dev.json fields with the PowerAppsTestEngine.dll command shown in the issue. Run the buttonclicker sample using the provided reproduction steps and confirm the critical outputDirectory error no longer occurs.

Written by the indexing model from the issue text.

Description

new

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.

Dominant language
C#
Stars
150
Forks
55
Avg merge
5d 23h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/PowerApps-TestEngine

All issues in microsoft/PowerApps-TestEngine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.