All docs
V21.2
21.2 (EAP/Beta)
21.1
The page you are viewing does not exist in version 21.1. This link will take you to the root page.
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
You are viewing help content for pre-release software. This document and the features it describes are subject to change.

Test XAF Blazor UI Applications

  • 3 minutes to read

Overview

XAF can run functional tests for Blazor UI applications based on the Selenium driver to interact with browser.

Easy Test for Blazor supports the following browsers:

  • Google Chrome
  • Microsoft Edge

Prerequisites

Configure your working machine as described below:

  1. Install browser drivers.

    Selenium requires a path to the downloaded driver. You can specify a path to the driver in any of the following ways:

    • Add a folder with the driver to the system’s PATH variable.
    • Specify a path to the driver in EasyTest’s configuration file.

      <Application ... WebDriverPath="C:\WebDriverPath" />
      
  2. Install the DevExpress.ExpressApp.EasyTest.BlazorAdapter package to your YourApplicationName.Blazor.Server project.

Tip

The Solution Wizard installs the DevExpress.ExpressApp.EasyTest.BlazorAdapter package when you create a new application. The wizard also adds the FunctionalTests folder with a configuration file (config.xml), sample test (sample.ets), and a script to run the TestExecutor utility (Run.sp1) into the platform-independent YourApplicationName.Module module.

Configuration

The code below demonstrates a sample configuration file. You can edit it according to your project environment.

<?xml version="1.0" encoding="utf-8" ?> 
<Options xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <Applications> 
        <!-- Blazor --> 
        <Application 
            Name="DXApplication1Blazor" 
            Url="http://localhost:4030" 
            PhysicalPath="[BlazorAppPath]" 
            AdapterFileName="[BlazorAdapterAssemblyPath]" 
            Configuration="EasyTest" 
            IgnoreCase="true"/> 
    </Applications> 

    <TestDatabases> 
            <Database xsi:type="TestMSSQLDatabase" Server="(localdb)\mssqllocaldb" DBName="DXApplication1EasyTest"/> 
    </TestDatabases> 

    <Aliases> 
        <Alias Name="BlazorAppPath" Value="[ConfigPath]\..\..\DXApplication1.Blazor.Server" /> 
        <Alias Name="BlazorAdapterAssemblyPath" Value="[BlazorAppPath]\bin\EasyTest\net5.0\DevExpress.ExpressApp.EasyTest.BlazorAdapter.v21.2.dll" /> 
    </Aliases> 
</Options> 

Configuration Options

Attribute Description
Name Specifies the name of the Application element. This name is used to differentiate between different applications. The Application command takes this name as the parameter.
Url The application’s web address.
PhysicalPath A path to the folder that contains the application. You can use the built-in [ConfigPath] alias to specify a path to the Config.xml file.
AdapterFileName Specifies the name of the Blazor EasyTest adapter. This is an EasyTest assembly that contains platform-specific functionality. The attribute contains the adapter’s assembly filename, assembly version, culture, and public key.
IgnoreCase Specifies whether the test ignores a letter case when referring to UI element names, captions, or tags.
Configuration Specifies the configuration to use when running tests.
WebDriverPath Specifies a path to a web driver.
Browser Specifies a web browser to use for running tests. Available values: Chrome, Edge (the default value).

Aliases

Alias Description
BlazorAppPath A path to a Blazor application.
BlazorAdapterAssemblyPath A path to the Blazor EasyTest adapter. This path is typically points to a project’s build results. Reference the DevExpress.ExpressApp.EasyTest.BlazorAdapter adapter and it becomes available in the project’s build results. When you create a new application, the adapter is already referenced in the project and this option is set to a folder with the build results.

Run Tests

Use the TestExecutor Utility to run tests for .NET 5 projects.

cd %ProgramFiles(x86)%\DevExpress 21.2\Components\Tools\eXpressAppFrameworkNetCore\EasyTest

TestExecutor.v21.2.exe C:\PathToTest\sample.ets

Note

EasyTest commands (Run, Run Next Step, and so on) integrated into Visual Studio do not work for .NET 5 projects.

Next Steps