Skip to content

Use library's BaseScreenshotTestRunner directly, drop redundant deps#54

Open
EmilioBejasa wants to merge 5 commits intomainfrom
tidy/library-provides-test-activity
Open

Use library's BaseScreenshotTestRunner directly, drop redundant deps#54
EmilioBejasa wants to merge 5 commits intomainfrom
tidy/library-provides-test-activity

Conversation

@EmilioBejasa
Copy link
Copy Markdown
Collaborator

Summary

  • Replace the app's one-line ScreenshotTestRunner subclass with a direct reference to com.rnstorybookautoscreenshots.BaseScreenshotTestRunner as the testInstrumentationRunner
  • Remove explicit androidTestImplementation lines for androidx.test.* and screenshot-tests-for-android — these are already transitive via the library's api deps

Why

This demonstrates the minimal setup a library consumer actually needs. The only test-infrastructure entry in build.gradle is now:

testInstrumentationRunner "com.rnstorybookautoscreenshots.BaseScreenshotTestRunner"
androidTestImplementation project(':rn-storybook-auto-screenshots')

Test plan

  • ./gradlew :app:assembleDebugAndroidTest — BUILD SUCCESSFUL
  • ./gradlew :app:connectedDebugAndroidTest — 6/6 tests passed on emulator

🤖 Generated with Claude Code

EmilioBejasa and others added 5 commits February 25, 2026 12:43
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Developers no longer need to create StoryRendererActivity or
StoryScreenshotTest — both are now provided by the library.

- Register BaseStoryRendererActivity in the library manifest so it
  is merged into the app manifest automatically via Gradle
- Add concrete StoryScreenshotTest to the library using
  BaseStoryRendererActivity directly
- Remove StoryRendererActivity.kt, StoryScreenshotTest.kt, and the
  activity entry from the app manifest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The library exposes its test infrastructure dependencies via `api`, so
consumers don't need to list them explicitly. Replace the one-line
ScreenshotTestRunner subclass with a direct reference to the library's
BaseScreenshotTestRunner as the testInstrumentationRunner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant