Skip to content

Commit ee39baa

Browse files
committed
componentと画面でスクショテスト分割
1 parent c931228 commit ee39baa

23 files changed

Lines changed: 531 additions & 425 deletions

AndroidApp/.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AndroidApp/ui/build/reports/screenshotTest/preview/debug/index.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1>Test Summary</h1>
4343
</td>
4444
<td>
4545
<div class="infoBox" id="duration">
46-
<div class="counter">3.573s</div>
46+
<div class="counter">3.154s</div>
4747
<p>duration</p>
4848
</div>
4949
</td>
@@ -92,7 +92,7 @@ <h2>Packages</h2>
9292
<td>0</td>
9393
<td>0</td>
9494
<td>0</td>
95-
<td>3.573s</td>
95+
<td>3.154s</td>
9696
<td class="success">100%</td>
9797
</tr>
9898
</tbody>
@@ -115,12 +115,22 @@ <h2>Classes</h2>
115115
<tbody>
116116
<tr>
117117
<td class="success"/>
118-
<a href="me.nya_n.notificationnotifier.ScreenshotTest.html">me.nya_n.notificationnotifier.ScreenshotTest</a>
119-
<td>16</td>
118+
<a href="me.nya_n.notificationnotifier.ComponentScreenshotTest.html">me.nya_n.notificationnotifier.ComponentScreenshotTest</a>
119+
<td>11</td>
120+
<td>0</td>
121+
<td>0</td>
122+
<td>0</td>
123+
<td>1.615s</td>
124+
<td class="success">100%</td>
125+
</tr>
126+
<tr>
127+
<td class="success"/>
128+
<a href="me.nya_n.notificationnotifier.ContentScreenshotTest.html">me.nya_n.notificationnotifier.ContentScreenshotTest</a>
129+
<td>5</td>
120130
<td>0</td>
121131
<td>0</td>
122132
<td>0</td>
123-
<td>3.573s</td>
133+
<td>1.539s</td>
124134
<td class="success">100%</td>
125135
</tr>
126136
</tbody>
@@ -129,7 +139,7 @@ <h2>Classes</h2>
129139
</div>
130140
<div id="footer">
131141
<p>Generated by
132-
<a href="http://www.gradle.org">Gradle 8.14.3</a> at Jan 19, 2026, 6:41:25 AM</p>
142+
<a href="http://www.gradle.org">Gradle 8.14.3</a> at Jan 19, 2026, 11:38:47 PM</p>
133143
</div>
134144
</div>
135145
</body>

AndroidApp/ui/build/reports/screenshotTest/preview/debug/me.nya_n.notificationnotifier.ComponentScreenshotTest.html

Lines changed: 367 additions & 0 deletions
Large diffs are not rendered by default.

AndroidApp/ui/build/reports/screenshotTest/preview/debug/me.nya_n.notificationnotifier.ScreenshotTest.html renamed to AndroidApp/ui/build/reports/screenshotTest/preview/debug/me.nya_n.notificationnotifier.ContentScreenshotTest.html

Lines changed: 16 additions & 302 deletions
Large diffs are not rendered by default.

AndroidApp/ui/build/reports/screenshotTest/preview/debug/me.nya_n.notificationnotifier.html

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h1>Package me.nya_n.notificationnotifier</h1>
4545
</td>
4646
<td>
4747
<div class="infoBox" id="duration">
48-
<div class="counter">3.573s</div>
48+
<div class="counter">3.154s</div>
4949
<p>duration</p>
5050
</div>
5151
</td>
@@ -84,21 +84,32 @@ <h2>Classes</h2>
8484
</thread>
8585
<tr>
8686
<td class="success">
87-
<a href="me.nya_n.notificationnotifier.ScreenshotTest.html">ScreenshotTest</a>
87+
<a href="me.nya_n.notificationnotifier.ComponentScreenshotTest.html">ComponentScreenshotTest</a>
8888
</td>
89-
<td>16</td>
89+
<td>11</td>
9090
<td>0</td>
9191
<td>0</td>
9292
<td>0</td>
93-
<td>3.573s</td>
93+
<td>1.615s</td>
94+
<td class="success">100%</td>
95+
</tr>
96+
<tr>
97+
<td class="success">
98+
<a href="me.nya_n.notificationnotifier.ContentScreenshotTest.html">ContentScreenshotTest</a>
99+
</td>
100+
<td>5</td>
101+
<td>0</td>
102+
<td>0</td>
103+
<td>0</td>
104+
<td>1.539s</td>
94105
<td class="success">100%</td>
95106
</tr>
96107
</table>
97108
</div>
98109
</div>
99110
<div id="footer">
100111
<p>Generated by
101-
<a href="http://www.gradle.org">Gradle 8.14.3</a> at Jan 19, 2026, 6:41:25 AM</p>
112+
<a href="http://www.gradle.org">Gradle 8.14.3</a> at Jan 19, 2026, 11:38:47 PM</p>
102113
</div>
103114
</div>
104115
</body>

AndroidApp/ui/src/screenshotTest/kotlin/me/nya_n/notificationnotifier/ScreenshotTest.kt renamed to AndroidApp/ui/src/screenshotTest/kotlin/me/nya_n/notificationnotifier/ComponentScreenshotTest.kt

Lines changed: 1 addition & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package me.nya_n.notificationnotifier
22

3-
import androidx.compose.foundation.pager.rememberPagerState
4-
import androidx.compose.material.icons.Icons
5-
import androidx.compose.material.icons.automirrored.rounded.List
6-
import androidx.compose.material.icons.outlined.NotificationsActive
7-
import androidx.compose.material.icons.outlined.Settings
83
import androidx.compose.material3.SnackbarHostState
94
import androidx.compose.runtime.Composable
105
import androidx.compose.runtime.remember
@@ -20,112 +15,9 @@ import me.nya_n.notificationnotifier.ui.common.EmptyView
2015
import me.nya_n.notificationnotifier.ui.common.RequireNotificationPermissionDialog
2116
import me.nya_n.notificationnotifier.ui.common.RequirePackageVisibilityDialog
2217
import me.nya_n.notificationnotifier.ui.common.TopBar
23-
import me.nya_n.notificationnotifier.ui.screen.detail.DetailContent
24-
import me.nya_n.notificationnotifier.ui.screen.main.MainContent
25-
import me.nya_n.notificationnotifier.ui.screen.main.TabItem
26-
import me.nya_n.notificationnotifier.ui.screen.selection.SelectionContent
27-
import me.nya_n.notificationnotifier.ui.screen.settings.SettingsContent
28-
import me.nya_n.notificationnotifier.ui.screen.target.TargetContent
2918
import me.nya_n.notificationnotifier.ui.theme.AppTheme
30-
import me.nya_n.notificationnotifier.ui.util.Sample
3119

32-
class ScreenshotTest {
33-
34-
// region: 画面レベル
35-
36-
@PreviewTest
37-
@Preview
38-
@Composable
39-
fun MainContentScreenshotTest() {
40-
val snackbarHostState = remember { SnackbarHostState() }
41-
val tabItems = listOf(
42-
TabItem("タブ1", Icons.Outlined.NotificationsActive),
43-
TabItem("タブ2", Icons.AutoMirrored.Rounded.List),
44-
TabItem("タブ3", Icons.Outlined.Settings),
45-
)
46-
val pagerState = rememberPagerState(pageCount = { tabItems.size })
47-
AppTheme {
48-
MainContent(
49-
snackbarHostState = snackbarHostState,
50-
tabItems = tabItems,
51-
pagerState = pagerState
52-
) { }
53-
}
54-
}
55-
56-
@PreviewTest
57-
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
58-
@Composable
59-
fun TargetContentScreenshotTest() {
60-
val items = listOf(
61-
InstalledApp("Sample App", "me.nya_n.notificationnotifier"),
62-
InstalledApp("Sample App", "me.nya_n.notificationnotifier"),
63-
InstalledApp("Sample App", "me.nya_n.notificationnotifier"),
64-
)
65-
AppTheme {
66-
TargetContent(
67-
items = items,
68-
isLoading = false,
69-
onAppSelected = { }
70-
)
71-
}
72-
}
73-
74-
@PreviewTest
75-
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
76-
@Composable
77-
fun DetailContentScreenshotTest() {
78-
AppTheme {
79-
DetailContent(
80-
app = InstalledApp("Sample App Name", "example.sample.test"),
81-
onDeleteApp = { },
82-
isIgnoreSummary = false,
83-
onIgnoreSummaryChanged = { },
84-
condition = "^.*$",
85-
onConditionChanged = { }
86-
)
87-
}
88-
}
89-
90-
@PreviewTest
91-
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
92-
@Composable
93-
fun SelectionContentScreenshotTest() {
94-
AppTheme {
95-
SelectionContent(
96-
items = Sample.items,
97-
isLoading = false,
98-
onAppSelected = { },
99-
initQuery = "",
100-
onQueryInputted = { }
101-
)
102-
}
103-
}
104-
105-
@PreviewTest
106-
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
107-
@Composable
108-
fun SettingsContentScreenshotTest() {
109-
AppTheme {
110-
SettingsContent(
111-
address = "192.168.11.2:5555",
112-
versionCode = 1,
113-
versionName = "1.0",
114-
onValueChange = { },
115-
onNotifyTest = { },
116-
isWifiOnlyNotificationEnabled = false,
117-
onWifiOnlySettingChanged = { },
118-
onExportData = { },
119-
onImportData = { },
120-
onLicense = { },
121-
onAboutDeveloper = { }
122-
)
123-
}
124-
}
125-
126-
// endregion
127-
128-
// region: コンポーネントレベル
20+
class ComponentScreenshotTest {
12921

13022
@PreviewTest
13123
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
@@ -251,6 +143,4 @@ class ScreenshotTest {
251143
)
252144
}
253145
}
254-
255-
// endregion
256146
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
package me.nya_n.notificationnotifier
2+
3+
import androidx.compose.foundation.pager.rememberPagerState
4+
import androidx.compose.material.icons.Icons
5+
import androidx.compose.material.icons.automirrored.rounded.List
6+
import androidx.compose.material.icons.outlined.NotificationsActive
7+
import androidx.compose.material.icons.outlined.Settings
8+
import androidx.compose.material3.SnackbarHostState
9+
import androidx.compose.runtime.Composable
10+
import androidx.compose.runtime.remember
11+
import androidx.compose.ui.tooling.preview.Preview
12+
import com.android.tools.screenshot.PreviewTest
13+
import me.nya_n.notificationnotifier.model.InstalledApp
14+
import me.nya_n.notificationnotifier.ui.screen.detail.DetailContent
15+
import me.nya_n.notificationnotifier.ui.screen.main.MainContent
16+
import me.nya_n.notificationnotifier.ui.screen.main.TabItem
17+
import me.nya_n.notificationnotifier.ui.screen.selection.SelectionContent
18+
import me.nya_n.notificationnotifier.ui.screen.settings.SettingsContent
19+
import me.nya_n.notificationnotifier.ui.screen.target.TargetContent
20+
import me.nya_n.notificationnotifier.ui.theme.AppTheme
21+
import me.nya_n.notificationnotifier.ui.util.Sample
22+
23+
class ContentScreenshotTest {
24+
25+
@PreviewTest
26+
@Preview
27+
@Composable
28+
fun MainContentScreenshotTest() {
29+
val snackbarHostState = remember { SnackbarHostState() }
30+
val tabItems = listOf(
31+
TabItem("タブ1", Icons.Outlined.NotificationsActive),
32+
TabItem("タブ2", Icons.AutoMirrored.Rounded.List),
33+
TabItem("タブ3", Icons.Outlined.Settings),
34+
)
35+
val pagerState = rememberPagerState(pageCount = { tabItems.size })
36+
AppTheme {
37+
MainContent(
38+
snackbarHostState = snackbarHostState,
39+
tabItems = tabItems,
40+
pagerState = pagerState
41+
) { }
42+
}
43+
}
44+
45+
@PreviewTest
46+
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
47+
@Composable
48+
fun TargetContentScreenshotTest() {
49+
val items = listOf(
50+
InstalledApp("Sample App", "me.nya_n.notificationnotifier"),
51+
InstalledApp("Sample App", "me.nya_n.notificationnotifier"),
52+
InstalledApp("Sample App", "me.nya_n.notificationnotifier"),
53+
)
54+
AppTheme {
55+
TargetContent(
56+
items = items,
57+
isLoading = false,
58+
onAppSelected = { }
59+
)
60+
}
61+
}
62+
63+
@PreviewTest
64+
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
65+
@Composable
66+
fun DetailContentScreenshotTest() {
67+
AppTheme {
68+
DetailContent(
69+
app = InstalledApp("Sample App Name", "example.sample.test"),
70+
onDeleteApp = { },
71+
isIgnoreSummary = false,
72+
onIgnoreSummaryChanged = { },
73+
condition = "^.*$",
74+
onConditionChanged = { }
75+
)
76+
}
77+
}
78+
79+
@PreviewTest
80+
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
81+
@Composable
82+
fun SelectionContentScreenshotTest() {
83+
AppTheme {
84+
SelectionContent(
85+
items = Sample.items,
86+
isLoading = false,
87+
onAppSelected = { },
88+
initQuery = "",
89+
onQueryInputted = { }
90+
)
91+
}
92+
}
93+
94+
@PreviewTest
95+
@Preview(backgroundColor = 0xFFC7B5A8, showBackground = true)
96+
@Composable
97+
fun SettingsContentScreenshotTest() {
98+
AppTheme {
99+
SettingsContent(
100+
address = "192.168.11.2:5555",
101+
versionCode = 1,
102+
versionName = "1.0",
103+
onValueChange = { },
104+
onNotifyTest = { },
105+
isWifiOnlyNotificationEnabled = false,
106+
onWifiOnlySettingChanged = { },
107+
onExportData = { },
108+
onImportData = { },
109+
onLicense = { },
110+
onAboutDeveloper = { }
111+
)
112+
}
113+
}
114+
}

AndroidApp/ui/src/screenshotTestDebug/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppListComponentScreenshotTest_a51312a5_0.png renamed to AndroidApp/ui/src/screenshotTestDebug/reference/me/nya_n/notificationnotifier/ComponentScreenshotTest/AppListComponentScreenshotTest_a51312a5_0.png

File renamed without changes.

AndroidApp/ui/src/screenshotTestDebug/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppOutlinedButtonComponentScreenshotTest_0.png renamed to AndroidApp/ui/src/screenshotTestDebug/reference/me/nya_n/notificationnotifier/ComponentScreenshotTest/AppOutlinedButtonComponentScreenshotTest_0.png

File renamed without changes.

AndroidApp/ui/src/screenshotTestDebug/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppScaffoldComponentScreenshotTest_0.png renamed to AndroidApp/ui/src/screenshotTestDebug/reference/me/nya_n/notificationnotifier/ComponentScreenshotTest/AppScaffoldComponentScreenshotTest_0.png

File renamed without changes.

0 commit comments

Comments
 (0)