diff --git a/blazor/common/testing/blazor-with-playwright.md b/blazor/common/testing/blazor-with-playwright.md index 3a4debb7a..947d8ecd4 100644 --- a/blazor/common/testing/blazor-with-playwright.md +++ b/blazor/common/testing/blazor-with-playwright.md @@ -1,33 +1,29 @@ --- layout: post title: Testing Blazor Applications with Playwright | Syncfusion® -description: Learn how to perform end-to-end UI testing for Syncfusion® Blazor applications using Microsoft Playwright, including testing complete workflows. +description: Learn how to automate end‑to‑end (E2E) UI testing for Syncfusion® Blazor applications using Microsoft Playwright platform: Blazor component: Common documentation: ug --- -# Testing Syncfusion® Blazor applications with Playwright +# Testing Syncfusion® Blazor components with Playwright -This guide demonstrates how to integrate [Syncfusion® Blazor UI components](https://www.syncfusion.com/blazor-components) into a Blazor WebAssembly application and validate them through end‑to‑end tests using [Microsoft Playwright](https://azure.microsoft.com/en-us/products/playwright-testing). It provides a clear, step‑by‑step approach for building reliable and maintainable UI automation for Syncfusion® components in Blazor applications. +This guide explains how to integrate [Syncfusion® Blazor UI components](https://www.syncfusion.com/blazor-components) into a **Blazor WebAssembly Standalone App** and validate them through end‑to‑end tests using [Playwright](https://playwright.dev/dotnet). -## Why Playwright with Syncfusion® Blazor applications? - -- [Syncfusion® Blazor applications](https://www.syncfusion.com/blazor-components) provides rich UI components such as Buttons, Grids, and Charts for building modern web applications. -- [Playwright](https://azure.microsoft.com/en-us/products/playwright-testing) enables reliable cross‑browser UI testing across Chromium, Firefox, and WebKit. -- Using **Syncfusion® Blazor applications with Playwright**, you can validate real user interactions, test complete end‑to‑end user flows, and catch UI regressions early. +Playwright enables automated end‑to‑end (E2E) testing by simulating real user interactions such as clicking, typing, and navigation across the application. These tests can be executed repeatedly to verify complete UI workflows and ensure that Syncfusion® Blazor components behave as expected. ## Create a Blazor project -If you already have a Blazor project configured, you can skip this section and proceed to **Install required packages**. +If you already have a Blazor project configured, you can skip this section and proceed to [Install required packages](./blazor-with-playwright#install-required-packages). -Otherwise, create a new Blazor application by following the [Syncfusion® getting started guides](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app) for **Blazor WebAssembly Standalone App**. +Otherwise, create a new Blazor application by following the [Syncfusion® getting started guide](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app) for a **Blazor WebAssembly Standalone App**. ## Install required packages -Install the following NuGet packages to use the [Syncfusion® Blazor DataGrid](https://www.syncfusion.com/blazor-components/blazor-datagrid). +Install the following NuGet packages to use the **Syncfusion® Blazor components**. -- [Syncfusion.Blazor](https://www.nuget.org/packages/Syncfusion.Blazor/) +- [Syncfusion.Blazor.Grid](https://www.nuget.org/packages/Syncfusion.Blazor.Grid) - [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) You can install the required packages by using the following .NET CLI commands. @@ -49,7 +45,7 @@ Open the `_Imports.razor` file at the root of your project and import the Syncfu {% highlight razor tabtitle="_Imports.razor" %} @using Syncfusion.Blazor -@using Syncfusion.Blazor.Buttons +@using Syncfusion.Blazor.Grids {% endhighlight %} {% endtabs %} @@ -83,9 +79,9 @@ Include the theme stylesheet and script references in the `wwwroot/index.html` f
.... - + - + @@ -96,29 +92,47 @@ Include the theme stylesheet and script references in the `wwwroot/index.html` f Create a Razor page to demonstrate a simple Syncfusion® UI interaction that can be validated using Playwright tests. -This page contains a [Syncfusion® Blazor Button](https://www.syncfusion.com/blazor-components/blazor-button), allowing you to verify user interaction and UI behavior during end‑to‑end testing. +This page contains a [Syncfusion® Blazor Grid](https://www.syncfusion.com/blazor-components/blazor-datagrid) component with paging, allowing you to verify user interaction and UI behavior during end‑to‑end testing. {% tabs %} {% highlight razor %} @page "/" - -@using Syncfusion.Blazor.Buttons - -@result
+@using Syncfusion.Blazor.Grids + +