Skip to content

chore(test): move the Java-only tests to tests/javaonly and drop duplicates - #2082

Merged
Yury Semikhatsky (yury-s) merged 3 commits into
microsoft:mainfrom
yury-s:move-javaonly-tests
Dec 2, 2026
Merged

Yury Semikhatsky (yury-s) merged 3 commits into
microsoft:mainfrom
yury-s:move-javaonly-tests

Conversation

@yury-s

@yury-s Yury Semikhatsky (yury-s) commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Summary

  • move the Java-only Test* classes and the helpers only they use from com.microsoft.playwright to com.microsoft.playwright.tests.javaonly, next to the upstream ports in tests/page and tests/library
  • make the members of the shared Server, Utils and HttpsConfiguratorImpl helpers public
  • drop the com.microsoft.playwright.Test* check in StackTraceCollector, which the tests. one covers
  • remove about 1480 Java-only tests (78 classes) that a line-by-line upstream port now covers; the 273 left have no port, a @Fixme port, or test Java-only API

@yury-s Yury Semikhatsky (yury-s) changed the title chore(test): move the Java-only tests to tests/javaonly chore(test): move the Java-only tests to tests/javaonly and drop duplicates Dec 2, 2026
@yury-s

Copy link
Copy Markdown
Member Author

Review findings:

  1. Regression coverage for [Bug]: An exception thrown by an event listener while a binding call is being resolved is replaced by TargetClosedError #2009 is lost. The old TestBrowserContextExposeFunction.exposeBindingShouldWork ended with a block tagged // https://github.com/microsoft/playwright-java/issues/2009: a console listener throws while a binding call is in flight, and the exception must surface from page.evaluate. The port tests/library/TestBrowsercontextExposeFunction.exposeBindingShouldWork has no such assertions, and nothing else in the branch does. It is the only Java issue tag that disappears. Suggest keeping that block as a test in tests/javaonly/.

  2. AGENTS.md names a deleted class as a model. The "Good models" line still cites TestBrowserContextExposeFunction, shouldNotDispatchBindingOnAClosedPage. That class is gone; the method now lives only in the port tests/library/TestPopup, which is not a Java-only regression test with an issue tag. It should point at a test that survives in tests/javaonly/.

  3. Two deleted tests have a port that is @Fixme, which contradicts the rule in the description that those stay:

    • TestPageStrict.shouldFailPageTextContentInStrictMode (textContent with setStrict(true)): its port SM-001 in tests/page/TestPageStrict is @Fixme("java: ... double quotes"). SM-012 covers only context-level strict.
    • TestLocatorConvenience.shouldHaveANicePreview: its port LO-057 is @Fixme. The old test asserted the Java toString() form for chained locators and the JSHandle@#text=... preview. The surviving toStringShouldReturnFormattedLocator covers only a single locator("div").

Otherwise looks good: the moves, the visibility changes and the StackTraceCollector change check out, the kept tests and the ports are unchanged, and the other deleted tests I matched to a port. I did not compare the bodies of the ~1,260 same-named pairs one by one, so an untagged Java-specific assertion could still hide there.

@yury-s
Yury Semikhatsky (yury-s) merged commit 0f7f625 into microsoft:main Dec 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants