Get Started Now
Welcome, early adopters! If you’re eager to try the current version of Power Platform Automated Testing, you’re in the right place. This guide will help you get started with the necessary components and provide you with two paths to explore automated testing.
Prerequisites
To get started, you’ll need the following components:
- Ability to Clone Repository: Use Git command line or GitHub Desktop to clone the repository.
- PowerShell: Ensure you have PowerShell installed on your machine.
- Power Platform Command Line Tools: Install the Power Platform Command Line tools to interact with your Power Platform environment.
- .NET 8.0 SDK: Download and install the .NET 8.0 SDK to build the code.
This can seem daunting but the following steps will help you with this process assuming you are using Microsoft Windows as your local operating system.
These install steps ise winget for install.
Ability to Clone Repository
To install a GitHub client you can follow these steps. You can also follow Download GitHub Desktop to download the application
- If you don’t already have Git installed, you can install it using
winget
:
winget install --id Git.Git -e --source winget
- Alternatively, you can use GitHub Desktop. Install it using
winget
:
winget install --id GitHub.GitHubDesktop -e --source winget
- Use Git command line or GitHub Desktop to clone the repository. For Git command line, open your terminal and run:
git clone https://github.com/microsoft/PowerApps-TestEngine.git
- Verification: After cloning, navigate to the repository folder and list the contents to ensure the files are there:
cd PowerApps-TestEngine
PowerShell
PowerShell is typically pre-installed on Windows. But for these instructions we assume PowerShell Core is assumed. You can also follow instructions on Installing for different operating systems.
- PowerShell Core can be installed using
winget
:
winget install --id Microsoft.PowerShell --source winget
- Verification: Run the following command in PowerShell Core to check the version:
pwsh --version
.Net 8.0 SDK
You can install the .Net 8.0 SDK using the following commands in Microsoft Windows. You can also follow Download .NET 8.0 for different operating systems and install steps.
- Download and install the .NET 8.0 SDK using
winget
:
winget install Microsoft.DotNet.SDK.8
- Verification: Verify the installation by running:
dotnet --version
- Close and reopen your terminal to ensure the new components are in the system path.
Power Platform Command Line Interface (CLI)
You can install the .Net 8.0 SDK using the following commands in Microsoft Windows. We can also follow Install Microsoft Power Platform CLI for different operating systems and install types.
- Install Power Platform Command Line Interface (CLI) using dotnet command line interface
dotnet tool install --global Microsoft.PowerApps.CLI.Tool
- Verification: Verify the installation by running:
pac -v
- Close and reopen your terminal to ensure the new components are in the system path.
Getting Started
Have the prerequisites installed and verified? If so lets looks at some samples to get started. For each sample reference the README.md for more information.
Sample Configuration Settings
Each of the samples will need a config.json file in the folder using the following format. This file should be placed in each samples folder as the same level as RunTest.ps1
{
"tenantId": "a222222-1111-2222-3333-444455556666",
"environmentId": "12345678-1111-2222-3333-444455556666",
"customPage": "admin_initialsetuppage_d45cf",
"user1Email": "test@contoso.onmicrosoft.com",
"runInstall": true,
"installPlaywright": true
}
To complete this file
-
Open
https://make.powerapps.com
-
Navigate to the Environment you want to test
-
On the command bar, select Settings (gear)
-
Select session details
-
Copy the Environment Id and Tenant Id to the config.json file you have created
-
Update user1Email to your test user email address.
-
Note: Some samples will not require the customPage setting
Git Branch Notes
Samples are currently in the grant-archibald-md/integration-merge
branch as changes are reviewed and updated they will move to main and the Power Platform pac test run
command. To use this branch
git checkout grant-archibald-md/integration-merge
Simplest Example: Clicking the Button of a Canvas App
For those looking for a straightforward example, you can start with a simple scenario like clicking a button in a Canvas App. This example will help you understand the basics of automated testing in the Power Platform.
-
Import the ButtonClicker_*.zip file from the cloned repository using Import solutions
-
Copy you completed config.json file into the folder
-
Run the test
pwsh -File RunTests.ps1
Advanced Example: CoE Starter Kit Setup and Upgrade Wizard
For a more comprehensive example, you can explore the CoE Starter Kit Setup and Upgrade wizard. This low-code solution offers a broader scope for testing and provides a deeper understanding of automated testing in the Power Platform.
Running tests
-
Install the CoE Kit using Get started with setup
-
Copy you completed config.json file into the folder
-
Run the test
pwsh -File RunTests.ps1
Recording new tests
To Optionally record a new test based on your input and Dataverse and Connector calls you can
- Launch the application in
pwsh -File Record.ps1
-
When in record model wait until the Playwright Inspector appears
-
Interact with the application
-
Select continue in the Playwright Inspector to complete the session
-
The test results will indicate where to look at the recorded test results