Integrate Playwright with Perfecto Smart Reporting
To integrate Playwright with Perfecto Smart Reporting, choose the section that matches your testing scenario (desktop web, Android, or iOS) and then follow the steps for your preferred programming language.
For information on supported operating systems and browsers as well as prerequisites, see Playwright.
On this page:
Setup steps for desktop web
Perform the following steps to add Perfecto Smart Reporting to your Playwright tests for desktop web, placing the code snippets at appropriate points in your test flow. You can implement reporting in Java, JavaScript, or TypeScript. Follow the instructions for your preferred language.
Select a language to expand the steps.
-
Add the
testStartcode at the beginning of your test script, right after initializing the Playwright and browser context. This marks the start of the test.Copy//test start
Map<String, Object> paramsTestStart = new HashMap<>();
paramsTestStart.put("name", "name");
//tags
paramsTestStart.put("tags", List.of("tag1", "tag2"));
//job
paramsTestStart.put("jobName","My Job");
paramsTestStart.put("jobNumber",45);
//project
paramsTestStart.put("projectName","project name");
paramsTestStart.put("projectVersion","1.0");
page.evaluate("perfecto:report:testStart", new Gson().toJson(paramsTestStart)); -
Place the
stepStartandstepEndcode around the specific steps you want to report. This marks the beginning and end of each step within your test.Copy//step start
Map<String, Object> paramsStepStart = new HashMap<>();
paramsStepStart.put("name", "PWstep");
page.evaluate("perfecto:report:stepStart", new Gson().toJson(paramsStepStart));
//step end
Map<String, Object> paramsStepEnd = new HashMap<>();
paramsStepEnd.put("message", "PW step end");
page.evaluate("perfecto:report:stepEnd", new Gson().toJson(paramsStepEnd)); -
Add the
testEndcode at the end of your test script, after all test steps are completed. This marks the end of the test and also allows you to specify:-
Whether the test run was successful or failed.
In the following example, the
successparameter is set tofalse, indicating that the test failed. -
If the test run failed, a failure message to pass to the Perfecto report.
You can use the
failureDescriptionparameter to provide a detailed message explaining the reason for the failure. -
A failure/blocked reason to tag the failed test in the Perfecto report.
Use the
failureReasonparameter to pass a failure reason ID. To find an ID, see Use a failure reason in a test script.
Copy//test stop
Map<String, Object> paramsTestStop = new HashMap<>();
paramsTestStop.put("success", false);
paramsTestStop.put("failureDescription", "My failure message");
paramsTestStop.put("failureReason", "<failureReason>");
page.evaluate("perfecto:report:testEnd", new Gson().toJson(paramsTestStop)); -
-
Add the reporting helper functions to your Playwright support file:
-
testInfo.titlenames the test in the report automatically, so tests don't need to pass a name by hand. -
Call
reportTestStart/reportTestEndfromtest.beforeEach/test.afterEachand the report picks up whatever name thetest(...)block was given. -
Wrap notable actions in
reportStepStart/reportStepEndto break the test into named steps in the report.
Copy./support/perfectoReporting.tsimport { Page, TestInfo } from '@playwright/test';
export const JOB_NAME = 'MyApp-PlaywrightJob';
export const JOB_NUMBER = '1';
export const PROJECT_NAME = 'MyPlaywrightProject';
export const PROJECT_VERSION = '1.0';
export async function reportTestStart(page: Page, testInfo: TestInfo, tags: string[]): Promise<void> {
const paramsTestStart = {
tags,
name: testInfo.title,
jobName: JOB_NAME,
jobNumber: JOB_NUMBER,
projectName: PROJECT_NAME,
projectVersion: PROJECT_VERSION
};
await page.evaluate("perfecto:report:testStart", JSON.stringify(paramsTestStart));
}
export async function reportTestEnd(page: Page, testInfo: TestInfo): Promise<void> {
const success = testInfo.status === testInfo.expectedStatus;
const failureDescription = success
? 'Success'
: testInfo.errors && testInfo.errors.length > 0
? testInfo.errors.map((error) => error.message).join('\n')
: 'Failed';
const paramsTestEnd = {
success,
failureDescription
};
await page.evaluate("perfecto:report:testEnd", JSON.stringify(paramsTestEnd));
}
export async function reportStepStart(page: Page, name: string): Promise<void> {
await page.evaluate("perfecto:report:stepStart", JSON.stringify({ name }));
}
export async function reportStepEnd(page: Page, message: string): Promise<void> {
await page.evaluate("perfecto:report:stepEnd", JSON.stringify({ message }));
} -
-
Use the reporting helpers in your Playwright test:
Copyimport { test, expect } from './setup-ios';
import { reportTestStart, reportTestEnd, reportStepStart, reportStepEnd } from './support/perfectoReporting';
const TAGS = ['smoke', 'home-page'];
test.describe('Home page', () => {
test.beforeEach(async ({ page }, testInfo) => {
await reportTestStart(page, testInfo, TAGS);
});
test.afterEach(async ({ page }, testInfo) => {
await reportTestEnd(page, testInfo);
});
test('loads the home page', async ({ page }) => {
await reportStepStart(page, 'Navigate to home page');
await page.goto('https://example.com');
await expect(page).toHaveTitle(/Example Domain/);
await reportStepEnd(page, 'Home page loaded');
});
});
-
Add the
paramsTestStartcode at the beginning of your test script, right after initializing the Playwright and browser context. This marks the start of the test.Copyconst paramsTestStart = {
tags: ['Playwright', 'standalone'],
name: 'Perfecto Playwright Test',
jobName: 'My Job',
jobNumber: '1',
projectName: 'My Project',
projectVersion: '1.0'
};
await page.evaluate('perfecto:report:testStart', JSON.stringify(paramsTestStart)); -
Optionally, wrap specific steps with
paramsStepStartandparamsStepEndto mark them in the report.Copy// Step start
const paramsStepStart = { name: 'Navigate to Perfecto' };
await page.evaluate('perfecto:report:stepStart', JSON.stringify(paramsStepStart));
// ... your test step here ...
// Step end
const paramsStepEnd = { message: 'Navigation complete' };
await page.evaluate('perfecto:report:stepEnd', JSON.stringify(paramsStepEnd)); -
Add the
paramsTestEndcode at the end of your test script, after all test steps are completed. This marks the end of the test and allows you to specify whether it passed or failed.Copyconst paramsTestEnd = {
success: true // or false
};
await page.evaluate('perfecto:report:testEnd', JSON.stringify(paramsTestEnd));If the test fails, you can include a failure message:
Copyconst paramsTestEnd = {
success: false,
failureDescription: 'Expected link not found',
failureReason: '<failureReason>'
};
await page.evaluate('perfecto:report:testEnd', JSON.stringify(paramsTestEnd));
Setup steps for Android
Perform the following steps to add Perfecto Smart Reporting to your Playwright tests for Android, placing the code snippets at appropriate points in your test flow. You can implement reporting in JavaScript or TypeScript. Follow the instructions for your preferred language.
Select a language to expand the steps.
-
Add the reporting helper functions to your Playwright support file:
-
testInfo.titlenames the test in the report automatically, so tests don't need to pass a name by hand. -
Call
reportTestStart/reportTestEndfromtest.beforeEach/test.afterEachand the report picks up whatever name thetest(...)block was given. -
Wrap notable actions in
reportStepStart/reportStepEndto break the test into named steps in the report.
Copy./support/perfectoReporting.tsimport { Page, TestInfo } from '@playwright/test';
export const JOB_NAME = 'MyApp-PlaywrightJob';
export const JOB_NUMBER = '1';
export const PROJECT_NAME = 'MyPlaywrightProject';
export const PROJECT_VERSION = '1.0';
export async function reportTestStart(page: Page, testInfo: TestInfo, tags: string[]): Promise<void> {
const paramsTestStart = {
tags,
name: testInfo.title,
jobName: JOB_NAME,
jobNumber: JOB_NUMBER,
projectName: PROJECT_NAME,
projectVersion: PROJECT_VERSION
};
await page.evaluate("perfecto:report:testStart", JSON.stringify(paramsTestStart));
}
export async function reportTestEnd(page: Page, testInfo: TestInfo): Promise<void> {
const success = testInfo.status === testInfo.expectedStatus;
const failureDescription = success
? 'Success'
: testInfo.errors && testInfo.errors.length > 0
? testInfo.errors.map((error) => error.message).join('\n')
: 'Failed';
const paramsTestEnd = {
success,
failureDescription
};
await page.evaluate("perfecto:report:testEnd", JSON.stringify(paramsTestEnd));
}
export async function reportStepStart(page: Page, name: string): Promise<void> {
await page.evaluate("perfecto:report:stepStart", JSON.stringify({ name }));
}
export async function reportStepEnd(page: Page, message: string): Promise<void> {
await page.evaluate("perfecto:report:stepEnd", JSON.stringify({ message }));
} -
-
Use the reporting helpers in your Playwright test:
Copyimport { test, expect } from './setup-ios';
import { reportTestStart, reportTestEnd, reportStepStart, reportStepEnd } from './support/perfectoReporting';
const TAGS = ['smoke', 'home-page'];
test.describe('Home page', () => {
test.beforeEach(async ({ page }, testInfo) => {
await reportTestStart(page, testInfo, TAGS);
});
test.afterEach(async ({ page }, testInfo) => {
await reportTestEnd(page, testInfo);
});
test('loads the home page', async ({ page }) => {
await reportStepStart(page, 'Navigate to home page');
await page.goto('https://example.com');
await expect(page).toHaveTitle(/Example Domain/);
await reportStepEnd(page, 'Home page loaded');
});
});
-
Add the
paramsTestStartcode at the beginning of your test script, right after initializing the Playwright and browser context. This marks the start of the test.Copyconst paramsTestStart = {
tags: ['Android', 'Playwright'],
name: 'Perfecto Android Test',
jobName: 'My Job',
jobNumber: '1',
projectName: 'My Project',
projectVersion: '1.0'
};
await page.evaluate('perfecto:report:testStart', JSON.stringify(paramsTestStart)); -
Optionally, wrap specific steps with
paramsStepStartandparamsStepEndto mark them in the report.Copy// Step start
const paramsStepStart = { name: 'Launch Android app' };
await page.evaluate('perfecto:report:stepStart', JSON.stringify(paramsStepStart));
// ... your test step here (e.g., navigate or tap) ...
// Step end
const paramsStepEnd = { message: 'App launched successfully' };
await page.evaluate('perfecto:report:stepEnd', JSON.stringify(paramsStepEnd)); -
Add the
paramsTestEndcode at the end of your test script, after all test steps are completed. This marks the end of the test and allows you to specify whether it passed or failed.Copyconst paramsTestEnd = {
success: true // or false
};
await page.evaluate('perfecto:report:testEnd', JSON.stringify(paramsTestEnd));If the test fails, you can include a failure message:
Copyconst paramsTestEnd = {
success: false,
failureDescription: 'Expected element not found',
failureReason: '<failureReason>'
};
await page.evaluate('perfecto:report:testEnd', JSON.stringify(paramsTestEnd));
Setup steps for iOS
Perform the following steps to add Perfecto Smart Reporting to your iOS Playwright tests. For iOS connection setup and restrictions, see Set up Playwright with Perfecto – iOS.
Select a language to expand the steps.
-
Add the reporting helper functions to your Playwright support file:
-
testInfo.titlenames the test in the report automatically, so tests don't need to pass a name by hand. -
Call
reportTestStart/reportTestEndfromtest.beforeEach/test.afterEachand the report picks up whatever name thetest(...)block was given. -
Wrap notable actions in
reportStepStart/reportStepEndto break the test into named steps in the report.
Copy./support/perfectoReporting.tsimport { Page, TestInfo } from '@playwright/test';
export const JOB_NAME = 'MyApp-PlaywrightJob';
export const JOB_NUMBER = '1';
export const PROJECT_NAME = 'MyPlaywrightProject';
export const PROJECT_VERSION = '1.0';
export async function reportTestStart(page: Page, testInfo: TestInfo, tags: string[]): Promise<void> {
const paramsTestStart = {
tags,
name: testInfo.title,
jobName: JOB_NAME,
jobNumber: JOB_NUMBER,
projectName: PROJECT_NAME,
projectVersion: PROJECT_VERSION
};
await page.evaluate("perfecto:report:testStart", JSON.stringify(paramsTestStart));
}
export async function reportTestEnd(page: Page, testInfo: TestInfo): Promise<void> {
const success = testInfo.status === testInfo.expectedStatus;
const failureDescription = success
? 'Success'
: testInfo.errors && testInfo.errors.length > 0
? testInfo.errors.map((error) => error.message).join('\n')
: 'Failed';
const paramsTestEnd = {
success,
failureDescription
};
await page.evaluate("perfecto:report:testEnd", JSON.stringify(paramsTestEnd));
}
export async function reportStepStart(page: Page, name: string): Promise<void> {
await page.evaluate("perfecto:report:stepStart", JSON.stringify({ name }));
}
export async function reportStepEnd(page: Page, message: string): Promise<void> {
await page.evaluate("perfecto:report:stepEnd", JSON.stringify({ message }));
} -
-
Use the reporting helpers in your Playwright test:
Copyimport { test, expect } from './setup-ios';
import { reportTestStart, reportTestEnd, reportStepStart, reportStepEnd } from './support/perfectoReporting';
const TAGS = ['smoke', 'home-page'];
test.describe('Home page', () => {
test.beforeEach(async ({ page }, testInfo) => {
await reportTestStart(page, testInfo, TAGS);
});
test.afterEach(async ({ page }, testInfo) => {
await reportTestEnd(page, testInfo);
});
test('loads the home page', async ({ page }) => {
await reportStepStart(page, 'Navigate to home page');
await page.goto('https://example.com');
await expect(page).toHaveTitle(/Example Domain/);
await reportStepEnd(page, 'Home page loaded');
});
});
-
Call
testStartbefore the test and pass the test name and job details.Copyawait page.evaluate('perfecto:report:testStart', JSON.stringify({
tags: ['iOS', 'Playwright'],
name: 'iOS home page test',
jobName: 'My Job',
jobNumber: '1',
projectName: 'My Project',
projectVersion: '1.0'
})); -
Wrap notable actions with
stepStartandstepEnd.Copyawait page.evaluate('perfecto:report:stepStart', JSON.stringify({ name: 'Load home page' }));
await page.goto('https://example.com');
await page.evaluate('perfecto:report:stepEnd', JSON.stringify({ message: 'Home page loaded' })); -
Call
testEndafter the test completes.Copyawait page.evaluate('perfecto:report:testEnd', JSON.stringify({
success: true
}));
These steps build on the DeviceConnection.cs file from Set up Playwright with Perfecto – iOS. That page covers connecting to the device.
-
Create
PerfectoReporting.csin your test project, alongside your test file. It holds the job and project details as constants, plus four helpers:-
ReportTestStartAsyncstarts a test in the report. It sends the test name, the tags, and the job and project details. -
ReportTestEndAsyncends the test with its result. A passing test is reported asSuccess, and a failing one with its failure message. -
ReportStepStartAsyncandReportStepEndAsyncmark the start and end of a named step inside a test.
The helpers read the test name and result from NUnit's
TestContext, so they only need the page.CopyPerfectoReporting.csusing System.Text.Json;
using Microsoft.Playwright;
using NUnit.Framework;
using NUnit.Framework.Interfaces;
public static class PerfectoReporting
{
public const string JobName = "MyApp-PlaywrightJob";
public const string JobNumber = "1";
public const string ProjectName = "MyPlaywrightProject";
public const string ProjectVersion = "1.0";
public static async Task ReportTestStartAsync(IPage page, IReadOnlyList<string> tags)
{
var paramsTestStart = new
{
tags,
name = TestContext.CurrentContext.Test.Name,
jobName = JobName,
jobNumber = JobNumber,
projectName = ProjectName,
projectVersion = ProjectVersion,
};
await page.EvaluateAsync("perfecto:report:testStart", JsonSerializer.Serialize(paramsTestStart));
}
public static async Task ReportTestEndAsync(IPage page)
{
var result = TestContext.CurrentContext.Result;
var success = result.Outcome.Status == TestStatus.Passed;
var paramsTestEnd = new
{
success,
failureDescription = success ? "Success" : result.Message ?? "Failed",
};
await page.EvaluateAsync("perfecto:report:testEnd", JsonSerializer.Serialize(paramsTestEnd));
}
public static async Task ReportStepStartAsync(IPage page, string name)
{
await page.EvaluateAsync("perfecto:report:stepStart", JsonSerializer.Serialize(new { name }));
}
public static async Task ReportStepEndAsync(IPage page, string message)
{
await page.EvaluateAsync("perfecto:report:stepEnd", JsonSerializer.Serialize(new { message }));
}
}Replace the job and project values with your own.
-
-
Use the helpers in your tests:
-
In
[SetUp], callReportTestStartAsyncafter the page opens. -
In
[TearDown], callReportTestEndAsyncbefore the page closes. -
Inside each test, wrap notable actions with
ReportStepStartAsyncandReportStepEndAsync.
CopyExampleTests.csusing System.Text.RegularExpressions;
using Microsoft.Playwright;
using static Microsoft.Playwright.Assertions;
using static PerfectoReporting;
public class HomePageTests
{
private static readonly string[] Tags = ["smoke", "home-page"];
private IBrowserContext _context = null!;
private IPage _page = null!;
[SetUp]
public async Task OpenPageAsync()
{
_context = await DeviceConnection.Browser.NewContextAsync();
_page = await _context.NewPageAsync();
await ReportTestStartAsync(_page, Tags);
}
[TearDown]
public async Task ClosePageAsync()
{
try
{
await ReportTestEndAsync(_page);
}
finally
{
await _page.CloseAsync();
await _context.CloseAsync();
}
}
[Test]
public async Task LoadsTheHomePage()
{
await ReportStepStartAsync(_page, "Navigate to home page");
await _page.GotoAsync("https://playwright.dev/");
await Expect(_page).ToHaveTitleAsync(new Regex("Playwright"));
await ReportStepEndAsync(_page, "Home page loaded");
}
} -
These steps build on the conftest.py file from Set up Playwright with Perfecto – iOS. That page covers connecting to the device.
-
Create
perfecto_reporting.pyin the same folder as your test module. It holds the job and project details as constants, plus four helpers:-
report_test_startstarts a test in the report. It sends the test name, the tags, and the job and project details. -
report_test_endends the test with its result. A passing test is reported asSuccess, and a failing one with its failure message. -
report_step_startandreport_step_endmark the start and end of a named step inside a test.
Copyperfecto_reporting.pyimport json
from typing import Sequence
import pytest
from playwright.sync_api import Page
JOB_NAME = "MyApp-PlaywrightJob"
JOB_NUMBER = "1"
PROJECT_NAME = "MyPlaywrightProject"
PROJECT_VERSION = "1.0"
def report_test_start(page: Page, request: pytest.FixtureRequest, tags: Sequence<str>) -> None:
params_test_start = {
"tags": list(tags),
"name": request.node.name,
"jobName": JOB_NAME,
"jobNumber": JOB_NUMBER,
"projectName": PROJECT_NAME,
"projectVersion": PROJECT_VERSION,
}
page.evaluate("perfecto:report:testStart", json.dumps(params_test_start))
def report_test_end(page: Page, request: pytest.FixtureRequest) -> None:
# Set by the pytest_runtest_makereport hook in conftest.py
failure = getattr(request.node, "perfecto_failure", "Failed")
params_test_end = {
"success": failure is None,
"failureDescription": failure or "Success",
}
page.evaluate("perfecto:report:testEnd", json.dumps(params_test_end))
def report_step_start(page: Page, name: str) -> None:
page.evaluate("perfecto:report:stepStart", json.dumps({"name": name}))
def report_step_end(page: Page, message: str) -> None:
page.evaluate("perfecto:report:stepEnd", json.dumps({"message": message}))Replace the job and project values with your own.
-
-
Add this hook to the existing
conftest.pyfile. pytest only exposes a test's result through a hook. The hook stores the failure message, orNonewhen the test passed, forreport_test_endto read:Copyconftest.py@pytest.hookimpl(wrapper=True)
def pytest_runtest_makereport(item, call):
report = yield
if report.when == "call":
item.perfecto_failure = call.excinfo.exconly() if report.failed else None
return report -
Add an autouse fixture to the test module. It calls
report_test_startbefore each test andreport_test_endafter it. Inside the test, wrap each notable action inreport_step_startandreport_step_end:Copytest_example.pyimport re
import pytest
from playwright.sync_api import Page, expect
from perfecto_reporting import report_step_end, report_step_start, report_test_end, report_test_start
TAGS = ["smoke", "home-page"]
@pytest.fixture(autouse=True)
def perfecto_test(page: Page, request: pytest.FixtureRequest):
report_test_start(page, request, TAGS)
yield
report_test_end(page, request)
def test_loads_the_home_page(page: Page):
report_step_start(page, "Navigate to home page")
page.goto("https://playwright.dev/")
expect(page).to_have_title(re.compile("Playwright"))
report_step_end(page, "Home page loaded")
These steps build on the PerfectoIosTest base class from Set up Playwright with Perfecto – iOS. That page covers connecting to the device.
-
Create
PerfectoReporting.javain thesrc/test/javafolder, relative topom.xmland alongside your test classes. It holds the job and project details as constants, plus four helpers:-
reportTestStartstarts a test in the report. It sends the test name, the tags, and the job and project details. -
reportTestEndends the test with its result. A passing test is reported asSuccess, and a failing one with its failure message. -
reportStepStartandreportStepEndmark the start and end of a named step inside a test.
JUnit doesn't pass a test's result to
@AfterEach, so the nestedTestResultextension records it first.CopyPerfectoReporting.javaimport com.google.gson.Gson;
import com.microsoft.playwright.Page;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.extension.AfterTestExecutionCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
public final class PerfectoReporting {
public static final String JOB_NAME = "MyApp-PlaywrightJob";
public static final String JOB_NUMBER = "1";
public static final String PROJECT_NAME = "MyPlaywrightProject";
public static final String PROJECT_VERSION = "1.0";
private static final Gson GSON = new Gson();
// JUnit doesn't pass the test's outcome to @AfterEach, so this extension records it first
public static final class TestResult implements AfterTestExecutionCallback {
private Throwable failure;
@Override
public void afterTestExecution(ExtensionContext context) {
failure = context.getExecutionException().orElse(null);
}
}
public static void reportTestStart(Page page, TestInfo testInfo, List<String> tags) {
Map<String, Object> paramsTestStart = Map.of(
"tags", tags,
"name", testInfo.getDisplayName(),
"jobName", JOB_NAME,
"jobNumber", JOB_NUMBER,
"projectName", PROJECT_NAME,
"projectVersion", PROJECT_VERSION);
page.evaluate("perfecto:report:testStart", GSON.toJson(paramsTestStart));
}
public static void reportTestEnd(Page page, TestResult result) {
boolean success = result.failure == null;
Map<String, Object> paramsTestEnd = Map.of(
"success", success,
"failureDescription", success ? "Success" : String.valueOf(result.failure.getMessage()));
page.evaluate("perfecto:report:testEnd", GSON.toJson(paramsTestEnd));
}
public static void reportStepStart(Page page, String name) {
page.evaluate("perfecto:report:stepStart", GSON.toJson(Map.of("name", name)));
}
public static void reportStepEnd(Page page, String message) {
page.evaluate("perfecto:report:stepEnd", GSON.toJson(Map.of("message", message)));
}
}Replace the job and project values with your own.
-
-
Use the helpers in your tests:
-
Register
TestResulton the test class with@RegisterExtension. -
Call
reportTestStartin@BeforeEachandreportTestEndin@AfterEach. -
Inside each test, wrap notable actions with
reportStepStartandreportStepEnd.
CopyHomePageTest.javaimport static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
import java.util.List;
import java.util.regex.Pattern;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.extension.RegisterExtension;
@DisplayName("Home page")
class HomePageTest extends PerfectoIosTest {
private static final List<String> TAGS = List.of("smoke", "home-page");
@RegisterExtension
final PerfectoReporting.TestResult result = new PerfectoReporting.TestResult();
@BeforeEach
void startReport(TestInfo testInfo) {
PerfectoReporting.reportTestStart(page, testInfo, TAGS);
}
@AfterEach
void endReport() {
PerfectoReporting.reportTestEnd(page, result);
}
@Test
@DisplayName("loads the home page")
void loadsTheHomePage() {
PerfectoReporting.reportStepStart(page, "Navigate to home page");
page.navigate("https://playwright.dev/");
assertThat(page).hasTitle(Pattern.compile("Playwright"));
PerfectoReporting.reportStepEnd(page, "Home page loaded");
}
} -