Unify test(Class, Y) tester-resolution semantics across DSL implementations

Open
#124 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start with shared/.../BrowserlessDsl.java, then compare test(Class, Y) in BaseBrowserlessTest.java and BrowserlessUIContext.java. Read junit6/.../TesterResolutionTest.java and add regression coverage for the chosen resolution behavior. Done means one documented behavior, a default method on BrowserlessDsl, and no per-class copies.

Written by the indexing model from the issue text.

Description

Part of #120. Blocked by #121.

test(Class<T> tester, Y component) behaves differently per entry point:

  • BaseBrowserlessTest (:465) → TesterRegistry.instantiate(tester, component) — no resolution, instantiates exactly the requested tester.
  • BrowserlessUIContext (:415) → internalWrap(tester, component) — prefers a more specific registered tester (@Tests resolution).

So test(SomeTester.class, component) can return different types depending on the entry point.

Proposal

Decide the intended contract (likely the resolving internalWrap behavior, consistent with single-arg test(Y)), unify both, then move the method into BrowserlessDsl as a default.

Note: behavior decision + likely bug fix; needs a regression test. TesterResolutionTest already exists, and its wrapDialogSubclass_explicitTesterClass_returnsCustomTester exercises test(CustomDialogTester.class, dialog) — but it only asserts non-null, so it passes under either semantics and pins nothing. The new test has to assert the returned type.

Acceptance criteria
  • test(Class, Y) has one documented behavior across all implementations.
  • It is a default on BrowserlessDsl; per-class copies removed.
  • Resolution behavior covered by a test that asserts the returned tester type.
Affected files

shared/.../BrowserlessDsl.java, shared/.../BaseBrowserlessTest.java, shared/.../BrowserlessUIContext.java, junit6/.../TesterResolutionTest.java.

Dominant language
Java
Stars
1
Forks
3
Avg merge
1d 19h
Merged PRs (30d)
15

Getting set up

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.

More from vaadin/browserless-test

All issues in vaadin/browserless-test

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.