Commit 969ea9fd authored by yangwu.jia's avatar yangwu.jia

Add test case

parent 7d7ac629
......@@ -71,6 +71,7 @@ void main() {
MyApp(),
);
//open firt page
ContainerCoordinator.singleton
.nativeContainerDidShow("first", {}, "1000000");
......@@ -79,6 +80,7 @@ void main() {
expect(find.text('First'), findsOneWidget);
//open second page
ContainerCoordinator.singleton
.nativeContainerDidShow("second", {}, "2000000");
......@@ -89,6 +91,8 @@ void main() {
await tester.pump(const Duration(seconds: 1));
//close sencod page
FlutterBoost.containerManager?.remove("2000000");
......@@ -97,5 +101,39 @@ void main() {
expect(find.text('First'), findsOneWidget);
// second page ,but pageId is 2000001
ContainerCoordinator.singleton
.nativeContainerDidShow("second", {}, "2000001");
await tester.pump(const Duration(seconds: 1));
expect(find.text('Second'), findsOneWidget);
await tester.pump(const Duration(seconds: 1));
//reopen firt page
ContainerCoordinator.singleton
.nativeContainerDidShow("first", {}, "1000000");
await tester.pump(const Duration(seconds: 1));
expect(find.text('First'), findsOneWidget);
// close second page and pageId is 2000001
ContainerCoordinator.singleton
.nativeContainerDidShow("second", {}, "2000001");
await tester.pump(const Duration(seconds: 1));
expect(find.text('Second'), findsOneWidget);
await tester.pump(const Duration(seconds: 1));
});
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment