Skip to content

E2E tests with Azure Test Plan

Gulfaraz Rahman edited this page Feb 5, 2025 · 1 revision

This page is designed to explain and guide testers and developers on how to approach writing and maintaining E2E tests effectively.


Table of Contents

  1. What are End-to-end Tests?
  2. Gather Requirements
  3. Add Tests in Azure Test Plan
  4. Writing E2E Tests
  5. Test Maintenance

What are End-to-end Tests?

"End-to-end testing is a technique that tests the entire software product from beginning to end to ensure the application flow behaves as expected. It defines the product’s system dependencies and ensures all integrated pieces work together as expected.

The main purpose of End-to-end (E2E) testing is to test from the end user’s experience by simulating real user scenarios and validating the system under test and its components for integration and data integrity."

To make the process of writing and maintaining test scenarios and automation scripts hassle-free, we should follow a specific process to ensure tests are written in the correct language and format.


Gather Requirements

Each test suite should be based on a set of requirements that ensures the quality of the feature. These requirements can be:

  • Written by the product owner as acceptance criteria.
  • Based on designs (e.g., Figma).

Once the requirements are clear, decide on the number of tests for both positive and negative scenarios, and write down the test titles.

Actions:

  • Check with the product owner for acceptance criteria.
  • List the titles of test cases that will cover the feature.

Add Tests in Azure Test Plan

Before you start adding tests in Azure Test Plan, ensure that the relevant test suite is created within the test plan. You can create a test suite by:

  1. Clicking the three dots next to the relevant suite (if it already exists).
  2. Selecting “New Suite” > “Static Suite”.
  3. Giving it an appropriate name.
Add tests in az test plan

Modes of Adding Tests

There are two modes for adding tests in Azure Test Plan:

  1. “Grid” Mode: Best for adding multiple tests at once.
Grid View button
Grid view
  1. “New Test Case” Mode: Ideal for adding individual tests one at a time.
New test case

Rules for Adding New Test Cases

When adding test cases, ensure the following:

  • Titles: Keep the title relevant and self-explanatory.
  • Language: Write test scenarios in Gherkin language. This makes them more translatable to code and easier for testers to execute manually.
  • State: Mark the test case as “Draft” when work is in progress and “Ready” when finalized for execution or automation.
  • Tags: Always add relevant tags related to the feature or project.

Tag Examples

  • General Tags: to be automated, automated, api, k6, manual.
  • Example Project Tags: ethiopia, floods, uganda, etc.

If an E2E test is going to be automated and relates to Uganda, use tags like to be automated and ethiopia. Once automated, update the tag to automated.

Tag project

Formatting Tips

  • If adding test cases directly in Azure Test Plan, formatting issues are rare.
  • If copying from external sources, such as a document with a dark background:
    1. Paste the content into test case editor in Azure with key combination (mac: cmd + shift + v) to remove formatting

Linking Test Cases

When possible link test cases to relevant PBIs, Tasks, or Bugs.

You can do so in two different ways:

  1. From the test case: Attach the PBI under the “Tests” field.
Tests
  1. From the PBI: Attach the test case under “Tested by”.

Tested by

This helps testers understand which tests to work on during feature implementation.


Writing E2E Tests

Most readers of this guide are likely familiar with writing automated tests. You can find more information here. However, one crucial point to emphasize is adding relevant Test IDs to test titles.

Why Add Test IDs?

  • Makes it easier to locate and edit tests.
  • Simplifies validation of scenarios in case of test failures.
  • Facilitates generating test reports in Azure Test Plan.
test('[33020] Info icon should open popover on click', async ({ page }) => {
  const { dashboard } = pages;
  const { userState, map } = components;

  if (!dashboard || !userState || !map) {
      throw new Error('pages and components not found');
    }

    // Navigate to disaster type the data was mocked for
    await dashboard.navigateToDisasterType(disasterType);
    // Assertions
    await userState.headerComponentIsVisible({
      countryName: NoTriggerDataSet.CountryName,
    });
};

Test Maintenance

Keeping tests up-to-date is essential for a well-functioning testing process.

To Update a Test:

  1. Open the correct test suite.
  2. Open the test case.
  3. Edit the content as needed and save it.

To Remove a Test:

  • If a test case is no longer relevant:
    • Delete it from the test suite.
    • If automated, create a PR to remove the corresponding E2E test script.

To search for specific test cases or suites:

  1. Select queries
  2. Work item type "Test Case" or "Test suite"
  3. Add additional clauses
  4. "Run query"

Query