Skip to content

Commit 521fe65

Browse files
authored
Merge pull request #307 from ptkNktq/fix/screenshot_test
ScreenshotTest修正
2 parents 97ac229 + ee39baa commit 521fe65

32 files changed

Lines changed: 1467 additions & 251 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/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
- 結果
1616
- https://github.com/ptkNktq/AndroidNotificationNotifier/tree/develop/AndroidApp/ui/build/reports/screenshotTest/preview/debug/.html
1717

18+
###### 注意事項
19+
20+
- ⚠ Windows環境だと、`CreateProcess error=206, ファイル名または拡張子が長すぎます。`というエラーが出る可能性がある
21+
22+
- 諦めてwsl2等使おう
23+
1824
### 注意事項
1925

2026
- AGPの更新をするときはAndroid Studioとの互換性を確認すること

AndroidApp/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,3 @@ plugins {
66
alias(libs.plugins.com.google.devtools.ksp) apply false
77
alias(libs.plugins.com.jaredsburrows.license) apply false
88
}
9-
10-
// https://github.com/facebook/react-native/issues/44501#issuecomment-2112926438
11-
gradle.startParameter.excludedTaskNames.addAll(
12-
gradle.startParameter.taskNames.filter { it.contains("testClasses") }
13-
)

AndroidApp/gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "a
7171
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-test-espresso" }
7272
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
7373
mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockk" }
74+
screenshot-validation-api = { group = "com.android.tools.screenshot", name = "screenshot-validation-api", version.ref = "androidx-compose-screenshot" }
7475

7576
# for build-logic
7677
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "agp" }

AndroidApp/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

AndroidApp/ui/build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ dependencies {
2929
androidTestImplementation(composeBom)
3030
debugImplementation(libs.androidx.compose.ui.tooling)
3131
screenshotTestImplementation(libs.androidx.compose.ui.tooling)
32+
screenshotTestImplementation(libs.screenshot.validation.api)
3233
implementation(libs.bundles.androidx.compose)
3334

3435
// その他
3536
implementation(libs.io.insert.koin)
3637
implementation(libs.io.insert.koin.compose)
3738
}
38-
39-
tasks.withType<Test>().configureEach {
40-
// FIXME: ScreenshotTestを全部コメントアウトしてるので一時的にfalseにしておく
41-
failOnNoDiscoveredTests = false
42-
}
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
2+
body {
3+
margin: 0;
4+
padding: 0;
5+
font-family: sans-serif;
6+
font-size: 12pt;
7+
}
8+
9+
body, a, a:visited {
10+
color: #303030;
11+
}
12+
13+
#content {
14+
padding-left: 50px;
15+
padding-right: 50px;
16+
padding-top: 30px;
17+
padding-bottom: 30px;
18+
}
19+
20+
#content h1 {
21+
font-size: 160%;
22+
margin-bottom: 10px;
23+
}
24+
25+
#footer {
26+
margin-top: 100px;
27+
font-size: 80%;
28+
white-space: nowrap;
29+
}
30+
31+
#footer, #footer a {
32+
color: #a0a0a0;
33+
}
34+
35+
ul {
36+
margin-left: 0;
37+
}
38+
39+
h1, h2, h3 {
40+
white-space: nowrap;
41+
}
42+
43+
h2 {
44+
font-size: 120%;
45+
}
46+
47+
ul.tabLinks {
48+
padding-left: 0;
49+
padding-top: 10px;
50+
padding-bottom: 10px;
51+
overflow: auto;
52+
min-width: 800px;
53+
width: auto !important;
54+
width: 800px;
55+
}
56+
57+
ul.tabLinks li {
58+
float: left;
59+
height: 100%;
60+
list-style: none;
61+
padding-left: 10px;
62+
padding-right: 10px;
63+
padding-top: 5px;
64+
padding-bottom: 5px;
65+
margin-bottom: 0;
66+
-moz-border-radius: 7px;
67+
border-radius: 7px;
68+
margin-right: 25px;
69+
border: solid 1px #d4d4d4;
70+
background-color: #f0f0f0;
71+
behavior: url(css3-pie-1.0beta3.htc);
72+
}
73+
74+
ul.tabLinks li:hover {
75+
background-color: #fafafa;
76+
}
77+
78+
ul.tabLinks li.selected {
79+
background-color: #c5f0f5;
80+
border-color: #c5f0f5;
81+
}
82+
83+
ul.tabLinks a {
84+
font-size: 120%;
85+
display: block;
86+
outline: none;
87+
text-decoration: none;
88+
margin: 0;
89+
padding: 0;
90+
}
91+
92+
ul.tabLinks li h2 {
93+
margin: 0;
94+
padding: 0;
95+
}
96+
97+
div.tab {
98+
}
99+
100+
div.selected {
101+
display: block;
102+
}
103+
104+
div.deselected {
105+
display: none;
106+
}
107+
108+
div.tab table {
109+
min-width: 350px;
110+
width: auto !important;
111+
width: 350px;
112+
border-collapse: collapse;
113+
}
114+
115+
div.tab th, div.tab table {
116+
border-bottom: solid #d0d0d0 1px;
117+
}
118+
119+
div.tab th {
120+
text-align: left;
121+
white-space: nowrap;
122+
padding-left: 6em;
123+
}
124+
125+
div.tab th:first-child {
126+
padding-left: 0;
127+
}
128+
129+
div.tab td {
130+
white-space: nowrap;
131+
padding-left: 6em;
132+
padding-top: 5px;
133+
padding-bottom: 5px;
134+
}
135+
136+
div.tab td:first-child {
137+
padding-left: 0;
138+
}
139+
140+
div.tab td.numeric, div.tab th.numeric {
141+
text-align: right;
142+
}
143+
144+
span.code {
145+
display: inline-block;
146+
margin-top: 0em;
147+
margin-bottom: 1em;
148+
}
149+
150+
span.code pre {
151+
font-size: 11pt;
152+
padding-top: 10px;
153+
padding-bottom: 10px;
154+
padding-left: 10px;
155+
padding-right: 10px;
156+
margin: 0;
157+
background-color: #f7f7f7;
158+
border: solid 1px #d0d0d0;
159+
min-width: 700px;
160+
width: auto !important;
161+
width: 700px;
162+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#summary {
2+
margin-top: 30px;
3+
margin-bottom: 40px;
4+
}
5+
6+
#summary table {
7+
border-collapse: collapse;
8+
}
9+
10+
#summary td {
11+
vertical-align: top;
12+
}
13+
14+
.breadcrumbs, .breadcrumbs a {
15+
color: #606060;
16+
}
17+
18+
.infoBox {
19+
width: 110px;
20+
padding-top: 15px;
21+
padding-bottom: 15px;
22+
text-align: center;
23+
}
24+
25+
.infoBox p {
26+
margin: 0;
27+
}
28+
29+
.grid {
30+
background: linear-gradient(-90deg, rgba(0, 0, 0, .05) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .05) 1px, transparent 1px), linear-gradient(-90deg, rgba(0, 0, 0, .04) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .04) 1px, transparent 1px), linear-gradient(transparent 3px, #f2f2f2 3px, #f2f2f2 98px, transparent 98px), linear-gradient(-90deg, #aaa 1px, transparent 1px), linear-gradient(-90deg, transparent 3px, #f2f2f2 3px, #f2f2f2 98px, transparent 98px), linear-gradient(#aaa 1px, transparent 1px), #f2f2f2;
31+
background-size: 10px 10px, 10px 10px, 100px 100px, 100px 100px, 100px 100px, 100px 100px, 100px 100px, 100px 100px;
32+
}
33+
34+
.counter, .percent {
35+
font-size: 120%;
36+
font-weight: bold;
37+
margin-bottom: 8px;
38+
}
39+
40+
#duration {
41+
width: 125px;
42+
}
43+
44+
#successRate, .summaryGroup {
45+
border: solid 2px #d0d0d0;
46+
-moz-border-radius: 10px;
47+
border-radius: 10px;
48+
behavior: url(css3-pie-1.0beta3.htc);
49+
}
50+
51+
#successRate {
52+
width: 140px;
53+
margin-left: 35px;
54+
}
55+
56+
#successRate .percent {
57+
font-size: 180%;
58+
}
59+
60+
.success, .success a {
61+
color: #008000;
62+
}
63+
64+
div.success, #successRate.success {
65+
background-color: #bbd9bb;
66+
border-color: #008000;
67+
}
68+
69+
.failures, .failures a {
70+
color: #b60808;
71+
}
72+
73+
div.failures, #successRate.failures {
74+
background-color: #ecdada;
75+
border-color: #b60808;
76+
}
77+
78+
ul.linkList {
79+
padding-left: 0;
80+
}
81+
82+
ul.linkList li {
83+
list-style: none;
84+
margin-bottom: 5px;
85+
}

0 commit comments

Comments
 (0)