Files
doormile_customer_app/integration_test/receipt_walkthrough_test.dart
Thiru-tenext 0d66627c3c Replace the customer app with Doormile CX
Book a pickup, track it to delivery — the rebuilt customer app.

- Design language from doormile-screens.html: brand #8F0F06, Manrope +
  Geist Mono (variable fonts), bordered cards instead of shadows, crimson
  brand headers, sliding tab indicator, mono for anything read digit by digit.
- lib/data (one live API implementation, plus a debug-only offline fake),
  lib/state, lib/ui (tokens, widgets, screens).
- 84 tests, plus a design snapshot harness that renders every screen with the
  real fonts: flutter test test/design_snapshot_test.dart --run-skipped
  --update-goldens

This replaces the previous app (pubspec 'doormile', app id
com.doormile.customer). That tree remains in history at 6c7d656; note its
android/app/google-services.json is not carried over, and the application id
here is in.doormile.customer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 16:07:33 +05:30

53 lines
1.8 KiB
Dart

import 'package:doormile_cx/data/location_service.dart';
import 'package:doormile_cx/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
/// Walks the app the way a customer does — sign in, Orders, Completed, open an
/// order — then holds on the receipt so it can be captured from the simulator.
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('Orders ▸ Completed ▸ order details', (tester) async {
// Deterministic pin: the walkthrough must never stop on an OS permission
// dialog, and the receipt it captures should look the same every run.
LocationService.instance = FixedLocationService();
await tester.pumpWidget(const DoormileApp());
await tester.pumpAndSettle(const Duration(milliseconds: 400));
Future<void> hold([int ms = 900]) async {
await tester.pump();
await tester.pump(Duration(milliseconds: ms));
await tester.pump(const Duration(milliseconds: 400));
}
await tester.enterText(find.byType(TextField).first, '9876543210');
await hold(300);
await tester.tap(find.text('Continue'));
await hold();
final boxes = find.byType(TextField);
for (var i = 0; i < 4; i++) {
await tester.enterText(boxes.at(i), '1');
await tester.pump();
}
await hold(1200);
await tester.tap(find.text('Orders'));
await hold();
await tester.tap(find.text('Completed'));
await hold();
await tester.tap(find.text('Salem, Tamil Nadu'));
await hold(1200);
expect(find.text('Collected at your door'), findsOneWidget);
// Hold the screen so it can be photographed from outside the test.
for (var i = 0; i < 40; i++) {
await tester.pump(const Duration(milliseconds: 500));
}
});
}