feat(app): run detail tabs are Summary, Timeline, Artifacts and Changes; the graph is a Summary preview that opens full screen
This commit is contained in:
@@ -2,7 +2,6 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_gallery_action.dart';
|
||||
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_view.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/runs_controller.dart';
|
||||
@@ -104,8 +103,15 @@ void main() {
|
||||
addTearDown(controller.dispose);
|
||||
await _pumpDetail(tester, platform, controller, gateway);
|
||||
|
||||
expect(find.byKey(runArtifactsButtonKey), findsOneWidget);
|
||||
await tester.tap(find.byKey(runArtifactsButtonKey));
|
||||
expect(
|
||||
find.byKey(const ValueKey('run-detail-tab-artifacts')),
|
||||
findsOneWidget,
|
||||
);
|
||||
await tester.ensureVisible(
|
||||
find.byKey(const ValueKey('run-detail-tab-artifacts')),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const ValueKey('run-detail-tab-artifacts')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Artifacts · 2 recorded'), findsOneWidget);
|
||||
@@ -123,7 +129,10 @@ void main() {
|
||||
final controller = await _loaded(gateway);
|
||||
addTearDown(controller.dispose);
|
||||
await _pumpDetail(tester, _Platform.material, controller, gateway);
|
||||
expect(find.byKey(runArtifactsButtonKey), findsNothing);
|
||||
expect(
|
||||
find.byKey(const ValueKey('run-detail-tab-artifacts')),
|
||||
findsNothing,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('a recorded empty capture keeps its explicit wording', (
|
||||
@@ -138,7 +147,13 @@ void main() {
|
||||
addTearDown(controller.dispose);
|
||||
await _pumpDetail(tester, _Platform.material, controller, gateway);
|
||||
|
||||
await tester.tap(find.byKey(runArtifactsButtonKey));
|
||||
await tester.ensureVisible(
|
||||
find.byKey(const ValueKey('run-detail-tab-artifacts')),
|
||||
);
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('run-detail-tab-artifacts')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('No artifacts recorded for this run.'), findsOneWidget);
|
||||
});
|
||||
@@ -153,7 +168,13 @@ void main() {
|
||||
addTearDown(controller.dispose);
|
||||
await _pumpDetail(tester, _Platform.material, controller, gateway);
|
||||
|
||||
await tester.tap(find.byKey(runArtifactsButtonKey));
|
||||
await tester.ensureVisible(
|
||||
find.byKey(const ValueKey('run-detail-tab-artifacts')),
|
||||
);
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('run-detail-tab-artifacts')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Artifacts · capture unavailable'), findsOneWidget);
|
||||
expect(find.text('No artifacts recorded for this run.'), findsNothing);
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/changes/changes.dart';
|
||||
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_changes_action.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_view.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/runs_controller.dart';
|
||||
|
||||
@@ -103,7 +102,13 @@ void main() {
|
||||
await controller.select(9);
|
||||
await _pumpDetail(tester, platform, controller, gateway);
|
||||
|
||||
await tester.tap(find.byKey(runChangesButtonKey));
|
||||
await tester.ensureVisible(
|
||||
find.byKey(const ValueKey('run-detail-tab-changes')),
|
||||
);
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('run-detail-tab-changes')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Changes'), findsOneWidget);
|
||||
@@ -145,14 +150,17 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('lib/feature.dart'), findsOneWidget);
|
||||
|
||||
if (platform == _Platform.material) {
|
||||
await tester.tap(find.byTooltip('Back'));
|
||||
} else {
|
||||
await tester.tap(find.byType(CupertinoNavigationBarBackButton));
|
||||
}
|
||||
// Changes is a tab: Summary is one tap away and the run stays open.
|
||||
final summaryTab = find.byKey(const ValueKey('run-detail-tab-summary'));
|
||||
await tester.ensureVisible(summaryTab);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(summaryTab);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Wiring run'), findsOneWidget);
|
||||
expect(find.byKey(runChangesButtonKey), findsOneWidget);
|
||||
expect(
|
||||
find.byKey(const ValueKey('run-detail-tab-changes')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('lib/feature.dart'), findsNothing);
|
||||
},
|
||||
);
|
||||
@@ -175,7 +183,13 @@ void main() {
|
||||
await controller.select(9);
|
||||
await _pumpDetail(tester, platform, controller, gateway);
|
||||
|
||||
await tester.tap(find.byKey(runChangesButtonKey));
|
||||
await tester.ensureVisible(
|
||||
find.byKey(const ValueKey('run-detail-tab-changes')),
|
||||
);
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('run-detail-tab-changes')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Changes · capture unavailable'), findsOneWidget);
|
||||
expect(find.text(diagnostic), findsWidgets);
|
||||
|
||||
@@ -94,7 +94,11 @@ Future<void> _openChanges(
|
||||
Brightness brightness = Brightness.light,
|
||||
}) async {
|
||||
await _pumpDetail(tester, platform, run, brightness: brightness);
|
||||
await tester.tap(find.byKey(runChangesButtonKey));
|
||||
await tester.ensureVisible(
|
||||
find.byKey(const ValueKey('run-detail-tab-changes')),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const ValueKey('run-detail-tab-changes')));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
@@ -163,7 +167,10 @@ void main() {
|
||||
|
||||
// The opened page would not follow live captures, so an executing run
|
||||
// has no action until the live visit pane can show them.
|
||||
expect(find.byKey(runChangesButtonKey), findsNothing);
|
||||
expect(
|
||||
find.byKey(const ValueKey('run-detail-tab-changes')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.text('Changes'), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:async';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_graph_preview.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/graph/widgets/run_graph_view.dart';
|
||||
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
|
||||
@@ -212,9 +213,12 @@ void main() {
|
||||
await pumpDeepLink(tester, RunDetailTestPlatform.material, stage: 'audit');
|
||||
|
||||
expect(find.byKey(const Key('run-visit-pane')), findsNothing);
|
||||
expect(find.byKey(const Key('run-detail-graph')), findsOneWidget);
|
||||
// Summary's graph preview shows the stage selected.
|
||||
final graph = tester.widget<RunGraphView>(
|
||||
find.byKey(const Key('run-detail-graph')),
|
||||
find.descendant(
|
||||
of: find.byKey(runGraphPreviewKey),
|
||||
matching: find.byType(RunGraphView),
|
||||
),
|
||||
);
|
||||
expect(graph.selectedStage, 'audit');
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_graph_preview.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/graph/widgets/graph_stage_node.dart';
|
||||
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
|
||||
@@ -126,6 +127,15 @@ Finder runDetailTab(RunDetailTab tab) =>
|
||||
find.byKey(ValueKey('run-detail-tab-${tab.name}'));
|
||||
|
||||
Future<void> openRunDetailTab(WidgetTester tester, RunDetailTab tab) async {
|
||||
// The graph has no tab: Summary shows it as a preview that opens full screen.
|
||||
if (tab == RunDetailTab.graph) {
|
||||
if (find.byKey(runGraphPreviewKey).evaluate().isEmpty) {
|
||||
await openRunDetailTab(tester, RunDetailTab.summary);
|
||||
}
|
||||
await tester.tap(find.byKey(runGraphPreviewKey));
|
||||
await tester.pumpAndSettle();
|
||||
return;
|
||||
}
|
||||
await tester.ensureVisible(runDetailTab(tab));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(runDetailTab(tab));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_graph_preview.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_more_menu.dart';
|
||||
import 'package:pipelines_app/features/graph/widgets/run_graph_view.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_tab.dart';
|
||||
@@ -14,16 +15,26 @@ void main() {
|
||||
) async {
|
||||
await pumpRunDetail(tester, platform);
|
||||
|
||||
// The graph is a preview on Summary; artifacts and changes are tabs.
|
||||
expect(renderedRunDetailTabs, [
|
||||
RunDetailTab.summary,
|
||||
RunDetailTab.graph,
|
||||
RunDetailTab.timeline,
|
||||
RunDetailTab.artifacts,
|
||||
RunDetailTab.changes,
|
||||
]);
|
||||
for (final label in ['Summary', 'Graph', 'Timeline']) {
|
||||
expect(find.text(label), findsOneWidget);
|
||||
}
|
||||
// Input and Output are Summary sections now, never separate tabs.
|
||||
final strip = find.byKey(const Key('run-detail-tabs'));
|
||||
for (final label in ['Summary', 'Timeline', 'Artifacts', 'Changes']) {
|
||||
expect(
|
||||
find.descendant(of: strip, matching: find.text(label)),
|
||||
findsOneWidget,
|
||||
);
|
||||
}
|
||||
expect(
|
||||
find.descendant(of: strip, matching: find.text('Graph')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.byKey(runGraphPreviewKey), findsOneWidget);
|
||||
// Input and Output are Summary sections now, never separate tabs.
|
||||
for (final label in ['Input', 'Output']) {
|
||||
expect(
|
||||
find.descendant(of: strip, matching: find.text(label)),
|
||||
@@ -40,11 +51,21 @@ void main() {
|
||||
// The strip lines up with the header's 16px inset on both hosts: the
|
||||
// first label sits within its segment's own padding of that inset, not
|
||||
// behind a second 16px control inset (which put it at 48 on Cupertino).
|
||||
expect(tester.getTopLeft(find.text('Summary')).dx, lessThan(40));
|
||||
expect(
|
||||
tester
|
||||
.getTopLeft(
|
||||
find.descendant(of: strip, matching: find.text('Summary')),
|
||||
)
|
||||
.dx,
|
||||
// Segments share the widest label's width, so a short first label
|
||||
// sits a little in from its edge; a doubled inset would be 48+.
|
||||
lessThan(46),
|
||||
);
|
||||
|
||||
for (final tab in [
|
||||
RunDetailTab.graph,
|
||||
RunDetailTab.timeline,
|
||||
RunDetailTab.artifacts,
|
||||
RunDetailTab.changes,
|
||||
RunDetailTab.summary,
|
||||
]) {
|
||||
await openRunDetailTab(tester, tab);
|
||||
|
||||
Reference in New Issue
Block a user