91 lines
3.3 KiB
Dart
91 lines
3.3 KiB
Dart
// F4 퀘스트 10화면 캡처. 방법은 `capture_common.dart` 참고.
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:fancake/features/planet/moderation.dart';
|
|
import 'package:fancake/features/quest/place_picker_screen.dart';
|
|
import 'package:fancake/features/quest/quest_create_screen.dart';
|
|
import 'package:fancake/features/quest/quest_data.dart';
|
|
import 'package:fancake/features/quest/quest_detail_screen.dart';
|
|
import 'package:fancake/features/quest/quest_list_screen.dart';
|
|
import 'package:fancake/features/quest/quest_reward_screen.dart';
|
|
|
|
import 'capture_common.dart';
|
|
|
|
/// 캡처는 표본 저장소로 찍는다 — 확인물은 화면 배치·문구를 보이는 것이 목적이다.
|
|
const _sample = SampleQuestRepository();
|
|
|
|
void main() {
|
|
final cap = Capture();
|
|
|
|
setUpAll(cap.prepare);
|
|
|
|
testWidgets('F4 퀘스트', (tester) async {
|
|
await cap.capture(tester, 'F4_01_퀘스트_목록', const QuestListScreen(repository: _sample));
|
|
|
|
// 명세 518:88377 — 전체/진행중/완료/내 퀘스트 탭 전환.
|
|
// 카드의 버튼 라벨에도 「진행중」이 있어 탭 띠 안으로 범위를 좁힌다.
|
|
await tester.tap(
|
|
find.descendant(
|
|
of: find.byType(QuestTabStrip),
|
|
matching: find.text('진행중'),
|
|
),
|
|
);
|
|
await cap.settle(tester);
|
|
await cap.shot('F4_02_퀘스트_목록_진행중');
|
|
|
|
await cap.capture(
|
|
tester,
|
|
'F4_03_퀘스트_상세_진행중',
|
|
const QuestDetailScreen(questId: 'q1', repository: _sample),
|
|
);
|
|
await cap.capture(
|
|
tester,
|
|
'F4_04_퀘스트_상세_시작전',
|
|
const QuestDetailScreen(questId: 'q4', repository: _sample),
|
|
);
|
|
|
|
// 광고 시청 전 — 관리자 퀘스트(q2 · 진행 완료)에서 「보상받기」를 누르면 뜬다.
|
|
await cap.open(tester, 'q2', const QuestDetailScreen(questId: 'q2', repository: _sample));
|
|
await tester.tap(find.text('보상받기'));
|
|
await cap.settle(tester);
|
|
await cap.shot('F4_05_퀘스트_상세_광고시청전');
|
|
|
|
// 광고 시청 후 — 「광고 보고 더 받기」 → 보상 화면(추가 보상 ×3).
|
|
await tester.tap(find.text('광고 보고 더 받기'));
|
|
await cap.settle(tester);
|
|
await cap.shot('F4_06_퀘스트_상세_광고시청후');
|
|
|
|
// 보상 화면은 루트 내비게이터에 얹힌다. 걷어내지 않으면 다음 화면을
|
|
// 아무리 띄워도 이 화면이 그 위에 남아 같은 그림이 계속 찍힌다.
|
|
await tester.tap(find.text('완료'));
|
|
await cap.settle(tester);
|
|
|
|
// 광고를 보지 않았을 때의 보상 — 기본 보상만 들어간다.
|
|
final detail = await const SampleQuestRepository().detail('q2');
|
|
await cap.capture(
|
|
tester,
|
|
'F4_07_퀘스트_완료_보상',
|
|
QuestRewardScreen(detail: detail),
|
|
);
|
|
|
|
await cap.capture(
|
|
tester,
|
|
'F4_08_퀘스트_상세_신고하기',
|
|
const ReportScreen(
|
|
target: ModerationTarget(
|
|
authorName: '신곡 3분 완청',
|
|
title: '신곡 3분 완청 퀘스트',
|
|
),
|
|
),
|
|
);
|
|
|
|
await cap.capture(tester, 'F4_09_퀘스트_생성', const QuestCreateScreen(repository: _sample));
|
|
await cap.capture(
|
|
tester,
|
|
'F4_10_퀘스트_생성_위치선택',
|
|
const PlacePickerScreen(),
|
|
);
|
|
});
|
|
}
|