Repository navigation
[java] manage state in tests not in global hooks - #18142
Conversation
PR Summary by QodoMove Java browser-state cleanup out of JupiterTestBase
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
6e50092 to
0739977
Compare
|
Code review by qodo was updated up to the latest commit 0739977 |
0739977 to
a476b8f
Compare
|
Code review by qodo was updated up to the latest commit a476b8f |
a476b8f to
dca64f8
Compare
|
Code review by qodo was updated up to the latest commit dca64f8 |
…terTestBase, restore blank.html
…ndowsAfterTest marker
…ir teardown in finally, and cover the window cleanup with tests
… cleanup fails, and fix import order
dca64f8 to
4ddf059
Compare
|
Code review by qodo was updated up to the latest commit 4ddf059 |
Came across this when I was trying to solve the Chrome bug in Java the same way I did Ruby (c1f500a) and JS (81ef99c)
🔗 Related Issues
element_spec.rb#16709, Avoid sleep in tests #16713, [java] Automatically save screenshots & page sources for failed tests #16904 & [java] Fix "secure vs non-secure" error in tests #17046💥 What does this PR do?
blank.htmlto a blank page (title and empty body)🔧 Implementation Notes
CookieImplementationTestandStorageCommandsTestalready wipe cookies in@BeforeEach,WindowSwitchingTestalready closes extra windows in@AfterEach, and the two BiDi tests that closed the focused window now switch back; the tests that open extra windows now close them through a@CloseExtraWindowsAfterTestmarker handled bySeleniumExtensionbeside@SwitchToTopAfterTest(class-level on the six BiDi classes that open tabs in most tests, method-level on the individual tests that switch into a context they close), the Java shape of the Rubytarget_locator_spechook, so a single-JVM IDE run no longer needs the base class to do any of itCloseExtraWindowsTestcovers the cleanup both directly and through the annotation; the BiDi tests that ran their teardown inline now do it infinally, and the geolocation null-coordinates test no longer closes the session's only window; cleanup errors other than a dead session log at warning levelDefaultMouseTest(classic and BiDi) resets the pointer withmoveToLocation(0, 0); the old offset from the body's center only stayed inside the viewport because every test used to start on the blank pagecontextCreatedtests now wait for the event of the window they open instead of taking the first event: the spec replayscontextCreatedfor existing navigables on subscription, and the Java client registers its handler only after the subscribe response, so that replayed event sometimes lands firstblank.htmlever did anything; the Python wait tests need itsblanktitle and the Firefox extension tests need a body, both kept🤖 AI assistance
🔄 Types of changes