feat(ui): 校正首页发现详情播放器预览
This commit is contained in:
1 parent
87db548591
commit
21d457fd98
13 files changed
+1218
-1684
No files matched your search
@@ -29,11 +29,15 @@ void main() {
|
||||
await _pumpApp(tester);
|
||||
await tester.tap(find.byKey(const Key('tab-discover')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('City Lights & Velvet Nights'));
|
||||
await tester.tap(find.byKey(const Key('home-drama-card-city-lights-demo')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
_expectFullscreenOverlay();
|
||||
expect(find.byType(PageView), findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('player-more')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('player-more-download')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-more-pip')), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
@@ -57,24 +61,29 @@ void main() {
|
||||
await tester.tap(find.byKey(const Key('detail-episode-chip-2')));
|
||||
await tester.pumpAndSettle();
|
||||
_expectFullscreenOverlay();
|
||||
expect(find.text('Episode 2 · Playing now'), findsOneWidget);
|
||||
expect(
|
||||
tester.widget<Text>(find.byKey(const Key('player-title'))).data,
|
||||
contains('Episode 2'),
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
void _expectFullscreenOverlay() {
|
||||
expect(find.byKey(const Key('rail-like')), findsOneWidget);
|
||||
expect(find.byKey(const Key('rail-save')), findsOneWidget);
|
||||
expect(find.byKey(const Key('rail-comments')), findsOneWidget);
|
||||
expect(find.byKey(const Key('rail-share')), findsOneWidget);
|
||||
expect(find.byTooltip('Picture in picture'), findsOneWidget);
|
||||
expect(find.byTooltip('Clear screen'), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-back')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-title')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-more')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-play-toggle')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-episodes')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-comments')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-next')), findsOneWidget);
|
||||
expect(find.byType(Slider), findsOneWidget);
|
||||
|
||||
expect(find.byKey(const Key('rail-like')), findsNothing);
|
||||
expect(find.byKey(const Key('rail-save')), findsNothing);
|
||||
expect(find.byKey(const Key('card-player-video-frame')), findsNothing);
|
||||
expect(find.byKey(const Key('card-player-progress')), findsNothing);
|
||||
expect(find.byKey(const Key('card-player-next')), findsNothing);
|
||||
expect(find.byKey(const Key('player-title')), findsNothing);
|
||||
}
|
||||
|
||||
Future<void> _pumpApp(WidgetTester tester) async {
|
||||
|
||||
Reference in new issue
Block a user