Repository navigation
test(steps): add unit coverage for StepLogger - #22
Merged
Merged
Conversation
Closes #8 The steps/ package had no unit tests. Adds StepLoggerTest covering the previously-untested branches: - no active test context -> step is ignored (nothing recorded, no capture) for both step() and stepWithScreenshot() - INFO status recorded without a screenshot - screenshot=true -> ScreenshotManager.captureAsBase64() captured & attached - explicit StepStatus preserved - offsetMs = 0 when the test start time is unknown - stepWithScreenshot stores the pre-captured base64 as-is (no live capture) Collaborators (SeleniumBootContext, ExecutionMetrics, ScreenshotManager) are all static, mocked with mockStatic — no real browser required. mvn clean verify: 480 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8
What
The
steps/package had no unit tests. AddsStepLoggerTesttargetingStepLogger's previously-untested branches:step()andstepWithScreenshot()screenshot=true→ScreenshotManager.captureAsBase64()is captured and attached to theStepRecordStepStatusis preservedoffsetMs == 0when the test start time is unknown (getTestStartTimereturns 0)stepWithScreenshotstores the pre-captured base64 as-is (and never triggers a live capture)Approach
StepLogger's collaborators —SeleniumBootContext,ExecutionMetrics,ScreenshotManager— are all static, so they're mocked withmockStatic, and the recordedStepRecordis asserted via anArgumentCaptor. No real browser / Selenium interaction.Acceptance criteria
mvn clean verifypasses — 480 tests, 0 failures (+7)🤖 Generated with Claude Code