Files
hash-wallet/integration_test/demo/scenarios/onboarding_create.dart
T
jwinterm c396e94b77 Add store capture harness: record real wallet flows into screenshots + video
Drives the real app through real flows on a device while recording the screen,
then cuts ONE recording into both deliverables — store screenshots and
marketing video — so a listing can't drift out of sync with its own trailer.

integration_test/demo/
  DemoSession adds what a passing test lacks: pacing (beat/hold/typeSlowly, so
  footage is watchable rather than a strobe), timing marks reported through
  binding.reportData, and seed guards. Scenarios reuse the existing 25 page
  robots rather than reimplementing navigation:
    core_store_set     dashboard, receive, send (composed, NEVER broadcast),
                       wallets, security — the store screenshot set
    onboarding_create  welcome -> PIN -> seed -> dashboard
    restore_from_seed  restore -> syncing
    swap_and_buy       Trocador quote, stopping BEFORE creating a trade; Buy
                       skipped when no provider key, matching what reviewers see

tools/demo/
  capture.sh   orchestrates boot/record/cut/shots/reel
  marks.py     maps timing marks onto the recording; cuts, extracts frames,
               builds manifests
  reel.py      branded master; reuses such_graphics video_transitions/video_qa
               when ~/src/such-graphics is present, degrades cleanly when not
               (this repo is public and must build without it)
  build-apk.sh local APK via the CI container image

Seed safety — the demo wallet is a real wallet with real funds:
  - seed comes from Vaultwarden at capture time, never the repo
  - guardNoSeedOnScreen() fails the run on a visible mnemonic, catching both
    the known seed and the generic shape of one (so freshly generated seeds
    are caught too)
  - unavoidable seed screens are wrapped in blindfold(); those spans are
    excised from the video with 0.6s padding, and screenshots honour the same
    padding
  - marks.py refuses to build a publishable master if any clip was cut without
    marks, since blindfold spans could not have been excised

Apple App Preview gets no touch indicators, captions, cards or music, and
reel.py enforces the 15-30s window rather than emitting an out-of-spec file.
Everything else keeps taps on, drawn by SurfaceFlinger via show_touches rather
than composited, so they look real.

Play sizing: the harness builds its own 1080x1920 AVD. The stock Medium Phone
AVD is 1080x2400 = 2.22:1 and Play rejects phone screenshots above 2:1.

Also gitignores android/app/upload-keystore.jks (and *.jks/*.keystore): the
Android workflow decodes ANDROID_KEYSTORE_BASE64 to exactly that path, so the
Play upload signing key was one `git add -A` away from being committed.
2026-07-31 15:25:29 -04:00

68 lines
2.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../../components/common_test_flows.dart';
import '../../robots/dashboard_page_robot.dart';
import '../demo_config.dart';
import '../demo_session.dart';
/// ONBOARDING — first launch through to a live wallet.
///
/// The strongest marketing story the app has: no email, no KYC, no account,
/// wallet in under a minute.
///
/// SEED SAFETY: this flow generates a brand-new wallet, so a real mnemonic
/// WILL be rendered on the seed + verification screens. Those beats run inside
/// `blindfold`, which records the span into the driver output. `capture.sh`
/// refuses to promote a master to the publishable directory while any
/// blindfold span is uncut, so the frames cannot reach a store listing by
/// accident.
///
/// The wallet created here is throwaway. Never fund it.
void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('demo: onboarding + create wallet', (tester) async {
FlutterError.onError = (FlutterErrorDetails details) {
debugPrint('FlutterError caught: ${details.exception}');
};
final demo = DemoSession(tester, binding, 'onboarding_create');
final flows = CommonTestFlows(tester);
final dashboard = DashboardPageRobot(tester);
demo.begin();
await flows.startAppFlow(const ValueKey('demo_onboarding_create'));
await demo.beat(3.0);
await demo.hold(
'welcome',
caption: 'No email. No KYC. No account.',
seconds: 3.5,
);
// The create flow walks PIN setup, seed display and seed verification in
// one call. Everything from here until the dashboard is unsafe to publish.
await demo.blindfold('new wallet seed is displayed and verified', () async {
await flows.welcomePageToCreateNewWalletFlow(
DemoConfig.walletType,
DemoConfig.pin,
);
});
await demo.beat(2.5);
// Back on safe ground — verify it and shoot the payoff.
await dashboard.isDashboardPage();
demo.guardNoSeedOnScreen(because: 'post-create dashboard');
await demo.hold(
'wallet_ready',
caption: 'A ${DemoConfig.walletLabel} wallet in under a minute',
seconds: 4.0,
);
demo.finish();
});
}