microsoft / microsoft/playwright-java

[Feature]: provide test fixtures for TestNG similar to JUnits @UsePlaywright functionality

Open
#1,782 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P3-collecting-feedback
Dominant language
Java
Stars
1.6k
Forks
298
Avg merge
3d 2h
Merged PRs (30d)
14

Description

🚀 Feature Request

Please provide test fixtures for TestNG testing framework which would work similarly as in JUnit framework.
This could work similarly to @UsePlaywright, reducing boilerplate code.

In other words a similar funcitonality to Junit one provided here:
https://playwright.dev/java/docs/junit

Example

Example is to use annotation like suggested in : https://playwright.dev/java/docs/junit

@UsePlaywright
public class TestExample {
@Test
void shouldClickButton(Page page) {
page.navigate("data:text/html,<script>var result;</script>Go");
page.locator("button").click();
assertEquals("Clicked", page.evaluate("result"));
}

Motivation

Motivation is a fact that TestNG is also broadly used

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing JUnit @UsePlaywright functionality and the linked Playwright Java JUnit documentation, then identify the corresponding TestNG integration points. Done means TestNG users can apply an equivalent fixture to the provided TestExample pattern with Playwright objects supplied and boilerplate reduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.