Automate end-to-end testing of your Power Platform applications with Playwright in Azure DevOps pipelines. This extension provides a comprehensive testing solution that sets up Playwright, executes tests against Power Apps, and generates detailed reports with failure analysis for CI/CD workflows.
The Playwright for Power Platform DevOps Extension is a specialized Azure DevOps task that enables automated UI testing of Power Platform applications using the Playwright testing framework. This extension eliminates the complexity of setting up testing environments by automatically installing dependencies, configuring authentication, and executing comprehensive test suites.
Built specifically for Power Platform applications, this extension handles the unique challenges of testing Power Apps, including Office 365 authentication flows, dynamic loading patterns, and Power Platform-specific UI controls.
- Automatically installs Node.js, Playwright, and all required dependencies
- Pre-configured testing framework optimized for Power Platform applications
- No manual environment preparation required
- Version Control: Specify exact versions, branches, tags, or commits for testing
- Version Pinning: Lock tests to specific framework versions for consistency
- Development Workflow: Test against feature branches before production deployment
- Controlled Repository: Uses curated Playwright framework for reliability
- Native Office 365 authentication handling
- Pre-built selectors and waits for Power Platform controls
- Support for both Canvas Apps and Model-Driven Apps
- Integration with Power Platform URL patterns and behaviors
- Automatic screenshot capture on test failures
- Optional video recording of test execution
- Detailed trace files for step-by-step debugging
- Network activity monitoring and logging
- Comprehensive error analysis and reporting
- Support for Chromium, Firefox, and WebKit browsers
- Option to run tests across all browsers simultaneously
- Browser-specific configuration and optimization
- Interactive HTML reports with execution timeline
- JSON results for automation and integration
- JUnit XML format for CI/CD pipeline compatibility
- Automatic artifact collection and organization
- Environment Setup: Automatically installs Node.js and Playwright testing framework
- Test Preparation: Copies your test files and configures environment variables
- Test Execution: Runs your Playwright tests with Power Platform optimizations
- Result Analysis: Generates comprehensive reports with failure diagnostics
- Azure DevOps pipeline with Windows or Linux agent
- Power Platform application URL
- Test user credentials with appropriate permissions
- Playwright test files (JavaScript or TypeScript)
Add the task to your Azure DevOps pipeline:
- task: mightoria-playwrightForPowerPlatform@1
displayName: 'Run Power Platform Tests'
inputs:
testLocation: '$(System.DefaultWorkingDirectory)/tests'
browser: 'chromium'
trace: 'retain-on-failure'
outputLocation: '$(Agent.TempDirectory)/test-results'
appUrl: 'https://apps.powerapps.com/play/$(AppId)'
appName: 'MyPowerApp'
o365Username: '$(TestUser.Email)'
o365Password: '$(TestUser.Password)'- task: mightoria-playwrightForPowerPlatform@1
displayName: 'Run Tests with Specific Version'
inputs:
testLocation: '$(System.DefaultWorkingDirectory)/tests'
playwrightVersion: 'v2.1.0'
browser: 'chromium'
trace: 'on-first-retry'
outputLocation: '$(Agent.TempDirectory)/test-results'
appUrl: 'https://apps.powerapps.com/play/$(AppId)'
appName: 'MyPowerApp'
o365Username: '$(TestUser.Email)'
o365Password: '$(TestUser.Password)'| Parameter | Description | Required | Default |
|---|---|---|---|
testLocation |
Path to Playwright test files | Yes | $(System.DefaultWorkingDirectory)/PlaywrightTests |
playwrightVersion |
Specific version, branch, tag, or commit to use | No | (latest default) |
browser |
Browser to run tests (chromium, firefox, webkit, all) | Yes | all |
trace |
Trace mode (off, on, retain-on-failure, on-first-retry) | Yes | off |
outputLocation |
Directory for test results and reports | Yes | $(System.DefaultWorkingDirectory) |
appUrl |
Power Platform application URL | No | - |
appName |
Power Platform application name | No | - |
o365Username |
Office 365 username for authentication | No | - |
o365Password |
Office 365 password for authentication | No | - |
The playwrightVersion parameter provides flexibility for teams who need to:
- Test against specific versions or feature branches
- Pin to stable releases for consistent testing
- Validate changes before they reach the main branch
Examples:
- Use feature branch:
playwrightVersion: "feature/new-selectors" - Pin to specific version:
playwrightVersion: "v2.1.0" - Test specific commit:
playwrightVersion: "abc123def456"
Note: The repository URL is fixed to ensure framework consistency and reliability.
test('Power Apps Login', async ({ page }) => {
await page.goto(process.env.APP_URL);
await page.fill('[name="loginfmt"]', process.env.O365_USERNAME);
await page.click('[type="submit"]');
await page.fill('[name="passwd"]', process.env.O365_PASSWORD);
await page.click('[type="submit"]');
await expect(page).toHaveTitle(new RegExp(process.env.APP_NAME));
});test('Form Submission', async ({ page }) => {
await page.goto(process.env.APP_URL);
await page.waitForSelector('[data-automation-id="Canvas"]');
// Fill form fields
await page.click('[aria-label="Name input"]');
await page.fill('[aria-label="Name input"]', 'Test User');
// Submit form
await page.click('[aria-label="Submit button"]');
// Verify success
await expect(page.locator('[aria-label="Success message"]')).toBeVisible();
});- Authentication failures: Verify credentials and user permissions
- Element not found errors: Check for Power Platform loading delays
- Timeout issues: Increase timeout values for slow environments
- "Unknown command: pm" errors: (Fixed in v1.0.15) - Update to the latest version for improved npm command reliability
- Review HTML reports for detailed execution flow
- Use trace files for step-by-step analysis
- Check screenshots for visual verification
- Monitor network logs for connectivity issues
- New: Enhanced error logging provides detailed command execution information
Major Improvements & Bug Fixes
- NEW: Added
playwrightVersioninput parameter to specify versions, branches, tags, or commits - ENHANCED: Full control over which version of Playwright framework gets executed
- CONTROLLED: Repository URL is fixed to ensure consistency and reliability across all users
- USE CASE: Teams can test against specific versions and pin to stable releases
- FIXED: Resolved "Unknown command: 'pm'" error that occurred with npm/npx commands in certain CI/CD environments
- IMPROVED: Replaced unreliable
&call operator with robustStart-Processapproach for npm/npx execution - ENHANCED: Better error handling with detailed logging of exact commands being executed
- RESULT: More reliable installation and execution across different Azure DevOps agents and environments
- OPTIMIZED: Faster npm dependency installation with improved error recovery
- ENHANCED: Better exit code handling and process management
- IMPROVED: More descriptive error messages for troubleshooting
- ADDED: Comprehensive logging for debugging installation issues
- UPDATED: Both Basic and Advanced task versions now support repository management
- CONSISTENT: Unified input parameter handling across both task variants
- BACKWARD COMPATIBLE: Existing pipelines continue to work without modification
- IMPROVED: Clear documentation of which branch/commit is being cloned
- ENHANCED: Better error messages with troubleshooting guidance
- ADDED: Validation and compatibility checks for repository cloning
Migration Notes:
- Existing pipelines will continue to work unchanged (default repository and branch behavior)
- To use specific branches: Add
playwrightVersionparameter with your desired branch/tag/commit - Repository URL is now fixed for consistency - custom repositories are no longer supported
Breaking Changes:
- None - this release is fully backward compatible
- Core Playwright testing functionality for Power Platform applications
- Office 365 authentication support
- Multi-browser testing capabilities
- Comprehensive reporting and debugging features
- Extension Documentation: Detailed guides available in the Azure DevOps Marketplace
- Community Support: GitHub issues and discussions
- Professional Support: Available through mightora.io
This project is licensed under the MIT License. See the LICENSE file for more details.
For more information or support, please visit https://mightora.io or open an issue in this repository.
Created by: Mightora.io | Powered by: Playwright