assert_
glossary ↓ downloads
track: java · selenium
suite 05 · suite test

Suite test: Test frameworks & structure

7 questionsevery test must pass to merge

This is the suite's regression gate. Answer every question, then run the suite. Wrong answers show an explanation — read it, then re-run. In this course, like on a real team, you don't merge on a red build.

01.@BeforeEach vs @BeforeAll:
Per-test setup (fresh browser) goes in @BeforeEach; expensive one-time setup (config, test data) in static @BeforeAll.
02.Why does driver.quit() belong in @AfterEach rather than at the end of each test?
A failing assertion aborts the test method — code after it never runs. Lifecycle hooks run regardless, so no leaked browsers.
03.assertEquals(actual, expected) — arguments swapped — causes…
It's (expected, actual). Swapped arguments still compile and still fail correctly — but the message misleads whoever debugs at 2 a.m.
04.In @CsvSource, the value '' represents…
Empty-string boundaries (blank username!) are exactly the rows your test-design instincts should feed the framework.
05.Each test gets a fresh browser because…
Independence costs a little speed and buys trustworthiness — and it's what makes parallel execution safe later.
06.Run only the tests tagged smoke:
-Dgroups filters by @Tag. That's how CI runs smoke on every push and the full suite nightly.
07.Automatic screenshots at the moment of failure are wired with…
TestWatcher.testFailed() fires on any failure; TakesScreenshot photographs the browser. Evidence turns “re-run it” into “diagnosed in seconds.”
passing marks this suite test complete on the roadmap · revision aid: the suite cheatsheet
← Reports & failure evidence API automation →