Enterprise Test Automation Framework for Microsoft Power Platform
A production-ready, comprehensive testing framework library for Power Platform applications built on Playwright. Supports Canvas Apps, Model-Driven Apps, and Power Platform services with robust authentication, API testing, accessibility testing, and intelligent reporting capabilities.
This monorepo contains the Enterprise Test Automation Framework library and example Consumer Test Infrastructure demonstrating best practices.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Consumer Test Infrastructure β
β (e2e-tests/ - Your Test Projects) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββββββββββββββββββββββββ β
β β Utils β β Test Infrastructure β β
β ββββββββββββββββ€ ββββββββββββββββββββββββββββββββββββββ€ β
β β β’ Fixtures β β β’ Test Setup β’ Test Scripts β β
β β β’ Functions β β β’ Test Utils β’ Shared Steps β β
β β β’ Annotationsβ β β’ Test Teardown β β
β ββββββββββββββββ β β’ Globals (setup & teardown) β β
β ββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Configurations β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β
β β β’ Environments β’ Accounts/Teams β β
β β β’ playwright.config.ts (with globalSetup/Teardown) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β imports
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Enterprise Test Automation Framework (This Library) β
β playwright-power-platform-toolkit/ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββββββ ββββββββββββββββββββββββ βββββββββββββββββββ
β β Page Object Model β β Accessibility β β API Testing ββ
β ββββββββββββββββββββββββ€ ββββββββββββββββββββββββ€ ββββββββββββββββββ€β
β β β’ Page Classes β β β’ WCAG Rules β β β’ Endpoints ββ
β β β’ Locators Repo β β β’ Axe-Core β β β’ Assertions ββ
β β β’ Utils β β β’ Assertions β β β’ API Recorder ββ
β β β’ Auth Helper β β β’ Violations Report β β β’ Dataverse ββ
β ββββββββββββββββββββββββ ββββββββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β uses
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Authentication (playwright-ms-auth) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Cert-based Auth β’ Password Auth β’ Token Refresh β
β β’ Storage State Management β’ KeyVault Management β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β built on
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Playwright Core Libraries and Test Runner β
β (@playwright/test package) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β outputs to
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Reporting Layer (playwright-ai-reporter) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Trace Logs β’ Screenshots & Videos β’ AI-powered Analysis β
β β’ Test Suite Logs β’ Email Notifications β’ Bug Tracking Integration β
β β’ Test Failure Suggestions & Fix β’ Reporting & Dashboard β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This monorepo contains:
- packages/playwright-power-platform-toolkit/ - The core library
- packages/e2e-tests/ - Example test infrastructure
- packages/docs/ - Documentation site
- PowerAppsPage: Full POM for Power Apps Maker Portal
- CanvasAppPage: Canvas app-specific page interactions
- ModelDrivenAppPage: Model-Driven app-specific page interactions
- Locators Repository: Maintainable selector management
- Utilities: Common helper functions for page interactions
- Auth Helper: Microsoft authentication integration
- REST API Testing: Full HTTP methods support (GET, POST, PATCH, DELETE)
- Endpoints: Pre-defined Power Platform API endpoints
- Assertions: Validation helpers for API responses
- API Recorder: Record and replay browser API calls
- Dataverse: Dataverse-specific API utilities
- WCAG Rules: Complete WCAG 2.0/2.1 compliance testing
- Axe-Core Integration: Industry-standard accessibility engine
- Assertions: Accessibility-specific validation
- Violations Reporting: Detailed accessibility reports
Powered by playwright-ms-auth:
- Certificate-based authentication
- Password-based authentication
- Automatic token refresh
- Storage state management
- Azure KeyVault integration
- β Page Object Model: Pre-built POMs for Power Apps Portal
- β Microsoft Authentication: Certificate & password auth via playwright-ms-auth
- β API Testing: Comprehensive REST API testing utilities
- β Accessibility Testing: WCAG 2.0/2.1 compliance validation
- β API Recorder: Capture and analyze browser API calls
- β Test Logger: Colored console output for better debugging
- β AI-Powered Reporting: Intelligent test failure analysis
- β TypeScript Support: Full type definitions
- β Path Aliases: Clean imports (@pages, @locators, @utils, @auth)
- β Best Practices: Follows Playwright recommended patterns
- β Monorepo Structure: Rush-based package management
npm install playwright-power-platform-toolkit --save-devnpm install @playwright/test playwright-ms-auth @axe-core/playwright dotenv --save-dev# Clone the repository
git clone https://github.com/deepakkamboj/playwright-power-platform.git
cd playwright-power-platform
# Install Node.js version
nvm install
nvm use
# Install Rush
npm install -g @microsoft/rush
# Install dependencies
rush install
# Build all packages
rush buildimport {
PowerAppsPage,
CanvasAppPage,
ModelDrivenAppPage,
ApiTestHelper,
AccessibilityTestHelper,
ConfigHelper,
TestLogger,
} from 'playwright-power-platform-toolkit';import { test } from '@playwright/test';
import { PowerAppsPage } from 'playwright-power-platform-toolkit';
test('Navigate to Apps', async ({ page }) => {
const powerAppsPage = new PowerAppsPage(page);
await powerAppsPage.navigateToApps();
});import { test } from '@playwright/test';
import { ApiTestHelper, ConfigHelper } from 'playwright-power-platform-toolkit';
test('Test Power Apps API', async ({ request }) => {
const config = ConfigHelper.getInstance();
const apiHelper = new ApiTestHelper(request, config);
const response = await apiHelper.get('/providers/Microsoft.PowerApps/apps');
await apiHelper.validateStatusCode(response, 200);
});import { test, expect } from '@playwright/test';
import { AccessibilityTestHelper } from 'playwright-power-platform-toolkit';
test('Check WCAG compliance', async ({ page }) => {
await page.goto('https://make.powerapps.com');
const a11yHelper = new AccessibilityTestHelper(page);
const results = await a11yHelper.scanPage();
expect(results.violations).toHaveLength(0);
});For comprehensive documentation, see:
- packages/playwright-power-platform-toolkit/README.md - Library documentation
- packages/playwright-power-platform-toolkit/docs/ - Detailed guides
- packages/e2e-tests/README.md - Example test infrastructure
- CLAUDE.md - Complete project overview for AI assistants
- PIPELINE-SETUP.md - CI/CD pipeline setup guide
Visit the documentation site at: https://deepakkamboj.github.io/playwright-power-platform-toolkit/ (deployed from packages/docs/)
The packages/e2e-tests/ directory contains a complete example of how to use this library in your test project. The example includes:
- Test fixtures with auto-injection of library utilities
- Global setup/teardown hooks for test lifecycle management
- Environment-based test filtering (local, dev, test, staging, prod)
- Pre-configured test types (smoke, nightly, API, accessibility, E2E)
- Complete playwright.config.ts with all optimizations
cd packages/e2e-tests
npm install
npm run auth:headful
npm testThe example project demonstrates best practices for organizing tests, using fixtures, and structuring a consumer test infrastructure that leverages this library.
This project uses Rush for monorepo management:
playwright-power-platform/
βββ packages/
β βββ playwright-power-platform-toolkit/ # Main library package
β β βββ src/ # Library source code
β β βββ dist/ # Compiled output
β β βββ docs/ # Documentation
β βββ e2e-tests/ # Example tests
β β βββ tests/ # Test files
β β βββ scripts/ # Helper scripts
β βββ docs/ # Documentation site
βββ common/ # Rush configuration
βββ .github/workflows/ # CI/CD pipelines
βββ rush.json # Rush configuration
# Install all dependencies
rush install
# Build all packages
rush build
# Rebuild all packages
rush rebuild
# Update dependencies
rush update
# Lint all packages
rush lint
# Format code
npm run format
# Check formatting
npm run format:checkThis library uses playwright-ms-auth for Microsoft authentication.
MS_AUTH_EMAIL=user@domain.com
MS_AUTH_CREDENTIAL_TYPE=certificate
MS_CERTIFICATE_PATH=./cert.pfx
MS_CERTIFICATE_PASSWORD=YourPasswordMS_AUTH_EMAIL=user@domain.com
MS_AUTH_CREDENTIAL_TYPE=password
MS_USER_PASSWORD=passwordSee PIPELINE-SETUP.md for complete authentication setup instructions.
This repository includes GitHub Actions workflows:
- ci.yml - Continuous Integration (runs on every push)
- pr.yml - Pull Request validation
- playwright-tests.yml - E2E tests (nightly/manual)
- publish-npm.yml - NPM publishing
- deploy-docs.yml - Documentation deployment
See .github/workflows/README.md for detailed pipeline documentation.
-
Clone the repository
git clone https://github.com/deepakkamboj/playwright-power-platform.git cd playwright-power-platform -
Install dependencies
nvm use npm install -g @microsoft/rush rush install
-
Make changes to library source
- Edit files in
packages/playwright-power-platform-toolkit/src/directory - Update exports in
src/index.tsif adding new features
- Edit files in
-
Build the library
rush build
-
Test your changes
cd packages/e2e-tests npm run auth:headful # Authenticate (first time only) npm test # Run all tests
-
Format and lint
npm run format # Format all code rush lint # Lint all packages
-
Submit pull request
- Create a feature branch
- Make your changes
- Push and create a PR
- Library code:
packages/playwright-power-platform-toolkit/src/ - Test code:
packages/e2e-tests/tests/ - Documentation:
packages/docs/andpackages/playwright-power-platform-toolkit/docs/ - Build output:
packages/playwright-power-platform-toolkit/dist/
MIT
- Playwright - Browser automation framework
- playwright-ms-auth - Microsoft authentication
- playwright-ai-reporter - AI-powered reporting
- Rush - Monorepo management tool
- Use the library as a dependency: Install via npm in your test projects
- Create custom fixtures: Extend the library with your own fixtures in your test project
- Organize tests: Separate library code from test code
- Handle auth properly: Run authentication once, reuse storage state
- Leverage API testing: Use ApiTestHelper for backend validation
- Check accessibility: Run AccessibilityTestHelper early and often
- Record APIs: Use ApiRecorder to understand application behavior
- Use colored logging: TestLogger helps debug issues faster
- Follow the example: See
packages/e2e-tests/for best practices - Use Rush commands: Leverage Rush for efficient monorepo management
# Clean and rebuild
rush rebuild
# Update dependencies
rush update
# Check Rush version
rush --versionMake sure the library is properly built:
cd packages/playwright-power-platform-toolkit
npm run build- Verify credentials in
.env - Check certificate/password is correct
- Ensure MFA is handled if required
- See PIPELINE-SETUP.md for detailed setup
- Ensure
@playwright/testpeer dependency is installed - Check TypeScript version compatibility
- Run
rush buildto ensure all packages are built
For issues and questions:
- Open an issue on GitHub
- Check the documentation
- Review example tests
- Read CLAUDE.md for complete project overview
- Packages: 3 (toolkit, e2e-tests, docs)
- Build System: Rush
- CI/CD: GitHub Actions
- Test Runner: Playwright
- Language: TypeScript
- Node Version: 20.16.0
- Add support for Power Automate testing
- Expand Dataverse API utilities
- Add visual regression testing
- Create VSCode extension
- Add performance testing utilities
- Expand documentation with more examples
Deepak Kamboj
- Email: deepakkamboj@gmail.com
- GitHub: @deepakkamboj
β Star this repository if you find it helpful!