Making Playwright Available for Makers
8 Key Steps Over 40 Minutes
PowerPlatformClinic.github.io
Demo: Forking the starter template repository
Live Demo: Using Playwright CodeGen to create a Model-Driven App test
TODO: Placeholder for video: CodeGen creating test demo
Live Demo: Using Playwright CodeGen to create a Model-Driven App test
Placeholder for video: CodeGen creating test demo
Client ID:
Tenant ID:
Secret:
Demo: Installing the FREE Playwright for Power Platform extension from Azure DevOps Marketplace
The Complete Recipe: Commit → Test → Deploy
PlaywrightForMakersProject/
├── tests/
│ ├── model-driven-app/
│ │ └── basic-navigation.spec.js
│ ├── power-pages/
│ │ └── form-submission.spec.js
├── (leave everything else aline - for)
└── .env
What a Model-Driven App test looks like:
// Navigate to app, create record, verify result
await page.goto(process.env.MODEL_DRIVEN_APP_URL);
await page.click('[data-testid="create-button"]');
await page.fill('#name-field', 'Test Record');
await page.click('[data-testid="save-button"]');
await expect(page.locator('.success-message')).toBeVisible();
Generated by CodeGen - no manual coding required!
name: $(TeamProject)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
trigger:
- none
pool:
vmImage: windows-latest
steps:
- checkout: self
- task: mightoria-playwrightForPowerPlatformAdvanced@1
inputs:
testLocation: '$(System.DefaultWorkingDirectory)/tests'
browser: 'chromium'
trace: 'on'
outputLocation: '$(System.DefaultWorkingDirectory)'
appUrl: 'https://techtweedie.crm11.dynamics.com/main.aspx?appid=6653f9fc-b74b-f011-877a-6045bd0e2fc6'
appName: 'MDA Playwright Testing'
o365Username: 'playwright-test@Tweed.technology'
o365Password: '$(o365Password)'
tenantId: '63759d9f-bfca-4f52-ae98-8f2f1d7bc173'
dynamicsUrl: 'techtweedie.crm11.dynamics.com'
clientId: '6f3163d1-bd41-4f0e-8725-980f05d2a82f'
clientSecret: '$(ClientSecret)'
userRole: 'System Administrator'
team: 'orgbfc42920'
businessUnit: 'orgbfc42920'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/playwright-report'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(System.DefaultWorkingDirectory)/playwright-report/playwright-report.zip'
replaceExistingArchive: true
- publish: $(System.DefaultWorkingDirectory)/playwright-report/
artifact: playwright-report
# always create the artifact, this is useful for debugging failed tests
condition: always()
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-*.xml'
Created & Cleaned Up Automatically
Playwright for Power Platform (P4PP) vs Traditional Testing
Answer:
Answer:
Answer:
You Now Have the Complete Recipe
Commit → Automatic UI Tests → Deploy