545291e04a
- Run rows show a failed run's reason (else its diagnostic's first line, full text in a tooltip) or a short result preview; the Summary leads with "Why it failed". - Run again for succeeded/canceled/interrupted runs opens the New run form pre-filled (prompt, workspace, report format) at the latest version with the original offered. - Run detail and stage tabs show their names; touch shows captions on the Runs header and artifact viewer actions (desktop keeps tooltips). - ErrorNotice maps not connected / server too old / permission / timeout to what to do, raw detail behind Details (Schedules, create chat, Runs, Pipelines banners). - Settings has no Back arrow; Schedules keeps the rail on wide windows; phone Settings leads with Connection and Notifications and has a Jump to topic menu. - Walkthrough: Open Connection (skipped when connected), labelled Copy. - Pluralised counts; no duplicate status/rail names for screen readers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
73 lines
2.5 KiB
Dart
73 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/features/walkthrough/first_run_walkthrough.dart';
|
|
import 'package:pipelines_app/features/walkthrough/walkthrough_steps.dart';
|
|
|
|
const _openConnectionKey = ValueKey<String>('walkthrough.open-connection');
|
|
|
|
/// The walkthrough acts as well as directs: Open Connection on the connect
|
|
/// page (skipped once connected) and a labelled Copy command.
|
|
void main() {
|
|
Future<void> launch(
|
|
WidgetTester tester, {
|
|
required bool connected,
|
|
required VoidCallback onOpenConnection,
|
|
}) async {
|
|
tester.view.physicalSize = const Size(390, 844);
|
|
tester.view.devicePixelRatio = 1;
|
|
addTearDown(tester.view.reset);
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
home: Scaffold(
|
|
body: Builder(
|
|
builder: (context) => TextButton(
|
|
onPressed: () => showFirstRunWalkthrough(
|
|
context,
|
|
connected: connected,
|
|
onOpenConnection: onOpenConnection,
|
|
),
|
|
child: const Text('Open'),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
await tester.tap(find.text('Open'));
|
|
await tester.pumpAndSettle();
|
|
}
|
|
|
|
testWidgets('Open Connection closes the walkthrough and opens it', (
|
|
tester,
|
|
) async {
|
|
var opened = 0;
|
|
await launch(tester, connected: false, onOpenConnection: () => opened++);
|
|
expect(find.textContaining('enter the Server URL'), findsOneWidget);
|
|
await tester.tap(find.byKey(_openConnectionKey));
|
|
await tester.pumpAndSettle();
|
|
expect(opened, 1);
|
|
expect(find.text('Step 1 of 4'), findsNothing);
|
|
});
|
|
|
|
testWidgets('a connected app skips the connect directions', (tester) async {
|
|
await launch(tester, connected: true, onOpenConnection: () {});
|
|
expect(find.text('Step 1 of 4'), findsOneWidget);
|
|
expect(find.textContaining('this app is connected'), findsOneWidget);
|
|
expect(find.textContaining('enter the Server URL'), findsNothing);
|
|
expect(find.byKey(_openConnectionKey), findsNothing);
|
|
expect(walkthroughStepsFor(connected: true), hasLength(4));
|
|
});
|
|
|
|
testWidgets('the harness page labels its copy action', (tester) async {
|
|
await launch(tester, connected: true, onOpenConnection: () {});
|
|
await tester.tap(find.byKey(const ValueKey<String>('walkthrough.next')));
|
|
await tester.pumpAndSettle();
|
|
expect(
|
|
find.descendant(
|
|
of: find.byKey(const ValueKey<String>('walkthrough.copy')),
|
|
matching: find.text('Copy command'),
|
|
),
|
|
findsOneWidget,
|
|
);
|
|
});
|
|
}
|