Azure Test Plans
1 - Overview
Azure Test Plans provides tools for managing manual and automated tests.
2 - Test hierarchy
2.1 Structure
Test Plan (Release 1.0)
├── Test Suite: Login
│ ├── Test Case: Login with valid credentials
│ ├── Test Case: Login with invalid password
│ └── Test Case: Password reset
├── Test Suite: Dashboard
│ ├── Test Case: Display widgets
│ └── Test Case: Export data
└── Test Suite: Regression
└── (Inherited test cases)
2.2 Test Suite types
| Type | Description |
|---|---|
| Static | Tests added manually |
| Requirement-based | Linked to User Stories |
| Query-based | Based on a query |
3 - Test Cases
3.1 Create a Test Case
# Via CLI
az boards work-item create \
--type "Test Case" \
--title "Verify login with valid credentials" \
--description "Test that users can login with correct email/password"
3.2 Structure of a Test Case
| Field | Description |
|---|---|
| Title | Test name |
| Steps | Steps to execute |
| Expected Results | Expected results |
| Priority | Priority (1-4) |
| State | Design, Ready, Closed |
| Assigned To | Assigned tester |
3.3 Example steps
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to login page | Login form is displayed |
| 2 | Enter valid email | Email is accepted |
| 3 | Enter valid password | Password is masked |
| 4 | Click Login button | User is redirected to dashboard |
4 - Test Plans
4.1 Create a Test Plan
- Go to Test Plans
- Click "New Test Plan"
- Set the name and iteration
4.2 Configuration
| Parameter | Description |
|---|---|
| Area Path | Project area |
| Iteration | Target sprint |
| Build/Release | Associated pipeline |
| Configuration | Test configurations |
5 - Test execution
5.1 Test Runner
Azure DevOps provides a web Test Runner to:
- Run manual tests
- Capture screenshots
- Record videos
- Create bugs directly
5.2 Test states
| State | Description |
|---|---|
| Passed | Test succeeded |
| Failed | Test failed |
| Blocked | Test blocked (external issue) |
| Not Applicable | Test not applicable |
| Paused | Test paused |
5.3 Create a bug from a test
When a test fails:
- Click "Create bug"
- The bug automatically includes:
- Test steps
- Screenshots
- System info
- Link to the test case
6 - Automated tests
6.1 Associate automated tests
# azure-pipelines.yml
steps:
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
searchFolder: '$(System.DefaultWorkingDirectory)'
testPlan: 12345
testSuite: 67890
testConfiguration: 111
6.2 Publish the results
steps:
- script: npm test -- --reporter=junit
displayName: 'Run tests'
continueOnError: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-*.xml'
testRunTitle: 'Unit Tests'
failTaskOnFailedTests: true
6.3 Code coverage
steps:
- script: npm test -- --coverage
displayName: 'Run tests with coverage'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/coverage'
7 - Test configurations
7.1 Create configurations
Test on different configurations:
| Configuration | Browser | OS |
|---|---|---|
| Chrome-Windows | Chrome | Windows 10 |
| Firefox-Windows | Firefox | Windows 10 |
| Safari-macOS | Safari | macOS |
| Chrome-Mobile | Chrome | Android |
7.2 Assign configurations
Each test case can be assigned to multiple configurations to test the combinations.
8 - Reports and metrics
8.1 Progress Report
- Passed vs failed tests
- Progress per suite
- Trends
8.2 Test Results Trend
# Widget dashboard
- Test pass rate over time
- Test duration trends
- Flaky test detection
8.3 Traceability
Link tests to requirements to:
- See the coverage of requirements
- Identify untested requirements
- Trace bugs back to requirements
9 - Exploratory Testing
9.1 Test & Feedback extension
Install the browser extension to:
- Perform exploratory tests
- Capture bugs
- Take annotated screenshots
- Record the screen
9.2 Workflow
- Install the extension
- Connect to Azure DevOps
- Start an exploratory session
- Capture the issues found
- Create the work items
Summary
In this chapter, we learned:
- The hierarchy of tests (Plans, Suites, Cases)
- Creating Test Cases
- The execution of manual tests
- The integration of automated tests
- Test configurations
- Reports and traceability
- Exploratory tests
Next step
In the next chapter, we will look at Security and Permissions.
→ Next chapter: Security and Permissions