android / android/nowinandroid

[Bug]: Splash screen shows when running composable tests

Open
#1,396 11 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
21.8k
Forks
4.6k
Avg merge
19h 20m
Merged PRs (30d)
2

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is there a StackOverflow question about this issue?

- [X] I have searched StackOverflow

### What happened?

A bug happened!

When running UI Composable tests, the Splash Screen is displayed. To see this happen, run any test in NavigationUiTest.kt.

Screen shot for when running NavigationUiTest.compactWidth_compactHeight_showsNavigationBar() test:
![image](https://github.com/android/nowinandroid/assets/8438825/4dab3b08-7482-48f9-8f42-ab428b1e4ec1)

Expected results:
Splash screen theme should not be shown when running compose UI tests. Instead, only the composable within composeTestRule.setContent should be displayed.

### Relevant logcat output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start with NavigationUiTest.kt and run a test such as NavigationUiTest.compactWidth_compactHeight_showsNavigationBar() to reproduce the splash screen. Inspect how composeTestRule.setContent is used and determine why the splash screen theme is shown during the UI test. Done means only the composable supplied to setContent is displayed.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.