LifeMate — Personal, Family & Learning Companion
test: scope Persian date options to the open dropdown menu
Quinn White committed
Oct 23, 2026 at 06:51 UTC
bdc97c8d95992385e91b40853d1c7a6c40c4c494
2 files changed
+119
-12
apps/lifemate/test/standalone_ui_test.dart
+16
-12
@@ -87,6 +87,15 @@ void main() {
87
await tap(tester, find.text(label).last);
88
}
89
90
+ Future<void> chooseDateOption(WidgetTester tester, String label) async {
91
+ // The selected label also exists in the dialog behind the open menu.
92
+ final menu = find.byType(Scrollable).last;
93
+ final option = find.descendant(of: menu, matching: find.text(label));
94
+ await tester.scrollUntilVisible(option, -150, scrollable: menu);
95
+ expect(option, findsOneWidget);
96
+ await tap(tester, option);
97
+ }
98
+
99
Future<void> profile() => store.createProfile(
100
displayName: 'کاربر ساختگی',
101
category: StandaloneProfileCategory.girlMinor);
@@ -214,13 +223,12 @@ void main() {
223
await tap(tester, find.byKey(const Key('personal-date-year')));
224
await tap(tester, find.text('۱۴۰۶').last);
225
await tap(tester, find.byKey(const Key('personal-date-month')));
217
- await tester.scrollUntilVisible(find.text('فروردین'), -150,
218
- scrollable: find.byType(Scrollable).last);
219
- await tap(tester, find.text('فروردین').last);
226
+ await chooseDateOption(tester, 'فروردین');
227
+ await tap(tester, find.byKey(const Key('personal-date-day')));
228
+ await chooseDateOption(tester, '۱');
229
+ // Reopening day1 exercises duplicate labels regardless of today's date.
230
await tap(tester, find.byKey(const Key('personal-date-day')));
221
- await tester.scrollUntilVisible(find.text('۱'), -150,
222
- scrollable: find.byType(Scrollable).last);
223
- await tap(tester, find.text('۱').last);
231
+ await chooseDateOption(tester, '۱');
232
final evidence = Platform.environment['LIFEGUIDE_UI_EVIDENCE_DIR'];
233
if (evidence != null) {
234
final boundary = tester.renderObject<RenderRepaintBoundary>(
@@ -271,13 +279,9 @@ void main() {
279
await tap(tester, find.byKey(const Key('personal-date-year')));
280
await tap(tester, find.text('۱۴۰۶').last);
281
await tap(tester, find.byKey(const Key('personal-date-month')));
274
- await tester.scrollUntilVisible(find.text('فروردین'), -150,
275
- scrollable: find.byType(Scrollable).last);
276
- await tap(tester, find.text('فروردین').last);
282
+ await chooseDateOption(tester, 'فروردین');
283
await tap(tester, find.byKey(const Key('personal-date-day')));
278
- await tester.scrollUntilVisible(find.text('۱'), -150,
279
- scrollable: find.byType(Scrollable).last);
280
- await tap(tester, find.text('۱').last);
284
+ await chooseDateOption(tester, '۱');
285
await tap(tester, find.text('انتخاب تاریخ'));
286
expect(find.text('تاریخ: ۱ فروردین ۱۴۰۶ شمسی'), findsOneWidget);
287
final originalLabel =
docs/audits/evidence/personal-recovery-picker-tests-failed-2026-10-23.json
new
+103
@@ -0,0 +1,103 @@
1
+{
2
+ "schemaVersion": 1,
3
+ "status": "FAILED_BEFORE_ANDROID",
4
+ "sourceCommit": "89a81432ebaa95f1d118595f87b90ef287f33693",
5
+ "runId": 39912812283,
6
+ "generalRunId": 39912812206,
7
+ "commands": [
8
+ {
9
+ "command": "gh run view 39912812283 --log-failed",
10
+ "exitCode": 0,
11
+ "selectedOutput": [
12
+ "StateError: Bad state: Too many elements",
13
+ "WidgetController.element -> dragUntilVisible -> scrollUntilVisible",
14
+ "330 tests passed, 2 failed."
15
+ ]
16
+ },
17
+ {
18
+ "command": "gh run view 39912812283 --json status,conclusion,jobs",
19
+ "exitCode": 0,
20
+ "selectedOutput": {
21
+ "status": "completed",
22
+ "conclusion": "failure",
23
+ "failedStep": "Host safety and ordinary planner checks"
24
+ }
25
+ }
26
+ ],
27
+ "failedTests": [
28
+ {
29
+ "file": "apps/lifemate/test/standalone_ui_test.dart",
30
+ "line": 221,
31
+ "name": "Persian picker saves next-year date and keeps ISO SQLite after reopen"
32
+ },
33
+ {
34
+ "file": "apps/lifemate/test/standalone_ui_test.dart",
35
+ "line": 278,
36
+ "name": "Persian picker confirms and cancels at320px and200percent text"
37
+ }
38
+ ],
39
+ "passedBeforeFailure": [
40
+ "format:1file/0changed",
41
+ "flutter analyze:No issues found",
42
+ "330 Flutter tests"
43
+ ],
44
+ "notRun": [
45
+ "Python host checks in this job",
46
+ "original retrieval",
47
+ "QA APK builds",
48
+ "Gradle negative gates",
49
+ "API35 emulator recovery"
50
+ ],
51
+ "artifactCount": 0,
52
+ "rootCause": "Day1 exists as both closed selected field and open menu item; unscoped target finder has multiple elements. Scrollable selector already uses.last. Current-date local focused test reproduces both CI failures.",
53
+ "fixBoundary": "test helper only; scope target to actual open dropdown Scrollable, keep ISO independent-SQL/reopen/cancel/accessibility assertions; do not change application clock/calendar/storage.",
54
+ "redGreenLocal": {
55
+ "baseCommit": "89a81432ebaa95f1d118595f87b90ef287f33693",
56
+ "changedFile": "apps/lifemate/test/standalone_ui_test.dart",
57
+ "changedFileSha256": "7d551e2d80c42ca4f13dd4f43626998c54b14df6f50fc0ad7bdea1711dc8d5d7",
58
+ "workingDirectory": "apps/lifemate",
59
+ "environment": "PUB_CACHE=/tmp/date-picker-pub-cache; Flutter executable /tmp/date-picker-flutter/bin/flutter (3.47.6)",
60
+ "commands": [
61
+ {
62
+ "command": "flutter test --no-pub test/standalone_ui_test.dart --plain-name 'Persian picker' --reporter expanded",
63
+ "stage": "RED_BEFORE_FIX",
64
+ "exitCode": 1,
65
+ "output": "Both original Persian picker cases fail with Too many elements"
66
+ },
67
+ {
68
+ "command": "flutter test --no-pub test/standalone_ui_test.dart --plain-name 'Persian picker' --reporter expanded",
69
+ "stage": "GREEN_AFTER_FIX",
70
+ "exitCode": 0,
71
+ "output": "00:04 +2: All tests passed!"
72
+ },
73
+ {
74
+ "command": "flutter test --no-pub --reporter expanded",
75
+ "stage": "FULL_SUITE",
76
+ "exitCode": 0,
77
+ "output": "01:28 +332: All tests passed!"
78
+ },
79
+ {
80
+ "command": "flutter analyze --no-pub",
81
+ "exitCode": 0,
82
+ "output": "Analyzing lifemate... \nNo issues found! (ran in 14.9s)"
83
+ },
84
+ {
85
+ "command": "dart format --output=none --set-exit-if-changed test/standalone_ui_test.dart",
86
+ "exitCode": 0,
87
+ "output": "Formatted1 file(0changed)"
88
+ },
89
+ {
90
+ "command": "PUB_CACHE=/tmp/date-picker-pub-cache /tmp/date-picker-flutter/bin/flutter test --no-pub test/standalone_ui_test.dart --plain-name 'Persian picker' --reporter expanded",
91
+ "stage": "ROOT_INDEPENDENT_REPEAT",
92
+ "exitCode": 0,
93
+ "output": "00:04 +2: All tests passed!"
94
+ }
95
+ ],
96
+ "setupNotes": [
97
+ "Offline package resolution failed from incomplete cache; locked online resolution succeeded, tracked lockfile unchanged",
98
+ "Minimal writable SDK initially lacked dev/examples; copying existing SDK directories resolved local analyzer setup without repository change",
99
+ "Root first repeated focused command from repo root and got No pubspec.yaml(exit1); corrected cwd to apps/lifemate, then focused2 passed"
100
+ ],
101
+ "scope": "Test-only finder scoping plus deterministic duplicate-day-label regression; no production file changed"
102
+ }
103
+}