Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Preview features aren’t meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
Overview
Power Apps Test Engine features a robust extensibility framework that allows the core testing capabilities to be expanded through various extension points. This article explains:
- How Microsoft signs and validates first-party extensions
- How the extensibility model works using the Managed Extensibility Framework (MEF)
- Options for organizations to create their own extensions
Microsoft-signed components
Important
During the public preview phase, the pac test run command only loads Microsoft-signed extensions. This design ensures security, stability, and performance of the Test Engine platform.
Microsoft builds, signs, and validates first-party components to ensure they meet quality and security standards. These components include:
- Core authentication providers
- Canvas app and model-driven app providers
- Standard Power Fx functions and actions
Extensibility framework (MEF)
Test Engine uses the Managed Extensibility Framework (MEF) to enable a pluggable architecture. This framework allows three primary types of extensions:
Authentication extensions
Authentication extensions enable different ways to authenticate with Power Platform:
- Storage State Authentication - The default browser-based authentication method
- Certificate-based Authentication - For non-interactive test execution
- Custom Authentication Providers - For specialized authentication scenarios
For more information, see Authentication in Test Engine.
Provider extensions
Provider extensions enable testing different types of applications:
- Canvas App Provider - For testing Power Apps canvas applications
- Model-driven App Provider - For testing Dataverse model-driven apps
- Power Fx Provider - For executing Power Fx statements independently
- Portal Provider - For automating operations in Power Apps
For more information, see Canvas Applications, Model-driven Applications, and Dataverse Extensions.
Power Fx extensions
Power Fx extensions add new testing capabilities through custom functions:
- User-defined Functions - Low-code functions defined in the test plan
- C# ReflectionFunction Implementations - Custom functions implemented in C# modules
For more information, see Power Fx Functions and C# ReflectionFunction Implementations.
Extension development options
Organizations have multiple options for extending Test Engine:
Using the open source version
The Power Apps Test Engine is available as an open source project under the MIT license. First-party Microsoft, third-party teams, and organizations can:
- Create new providers for specialized testing scenarios
- Develop custom authentication mechanisms
- Build new C# ReflectionFunction implementations
- Create modules that extend the core functionality
- Submit contributions for consideration in the core product
Power Fx user-defined functions
For simpler scenarios, you can create user-defined functions directly in your test plans:
testSuite:
testCases:
- testCaseName: "Test with custom functions"
userDefineFunctions:
- name: "FormatDateString"
parameters: [date]
expression: "Text(date, 'yyyy-MM-dd')"
steps:
# Use the custom function in your test steps
- action: PowerFxTestStep
expression: FormatDateString(Now())
Custom C# Power Fx functions with ReflectionFunction
For more complex scenarios, organizations can develop custom C# functions by implementing the ReflectionFunction
class and registering them through a module:
// Define your function class
public class SampleFunction : ReflectionFunction
{
public SampleFunction() : base(DPath.Root.Append(new DName("Preview")), "Sample", FormulaType.Blank)
{
}
public BlankValue Execute()
{
Console.WriteLine("Sample function executed");
return BlankValue.NewBlank();
}
}
// Register your function in a module
[Export(typeof(ITestEngineModule))]
public class TestEngineSampleModule : ITestEngineModule
{
public void RegisterPowerFxFunction(PowerFxConfig config, ITestInfraFunctions testInfraFunctions,
ITestWebProvider testWebProvider, ISingleTestInstanceState singleTestInstanceState,
ITestState testState, IFileSystem fileSystem)
{
config.AddFunction(new SampleFunction());
}
// Implement other required interface methods...
}
Collaboration with the Test Engine team
Organizations that develop valuable extensions using the open source Test Engine can consider creating a pull request for their extensions to make them available in the official product. The process typically involves:
- Development - Create your extension using the open source Test Engine
- Validation - Test your extension thoroughly in your own environment
- Collaboration - Work with the Core Test Engine team to evaluate the extension
- Integration - If approved, Microsoft signs and integrates the extension into the product
This collaboration model enables innovation while maintaining the security and reliability of the official Test Engine product.
Technical integration points
The following sections describe how Test Engine extensibility integrates with core technologies such as Playwright and the feature lifecycle. Understanding these integration points help you develop and deploy custom extensions effectively.
Playwright integration
Power Apps Test Engine is built on top of Playwright, which provides the foundation for browser automation. Custom extensions can interact with Playwright's IBrowserContext to create sophisticated browser-based testing capabilities.
Feature Lifecycle
New extensions follow a Feature Lifecycle:
- Preview Namespace - New extensions are first available in the Preview namespace for early testing
- TestEngine Namespace - After validation, extensions move to the core TestEngine namespace
Benefits of the extensibility model
The extensibility model provides significant benefits:
- Standardization - Microsoft-signed components ensure consistent quality and security
- Innovation - The open source model allows for community-driven innovation
- Flexibility - Organizations can create specialized extensions for unique requirements
- Integration - Valuable extensions are considered for inclusion in the official product