{"id":14971540,"url":"https://github.com/spkersten/flutter_test_ui","last_synced_at":"2025-10-26T16:30:45.719Z","repository":{"id":55381589,"uuid":"262568623","full_name":"spkersten/flutter_test_ui","owner":"spkersten","description":"Wrapper for flutter_test that adds a tester argument to setUp and tearDown functions","archived":false,"fork":false,"pushed_at":"2023-08-24T11:44:33.000Z","size":9,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T21:11:28.743Z","etag":null,"topics":["flutter","testing","ui"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_test_ui","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spkersten.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-09T12:43:19.000Z","updated_at":"2024-10-25T12:46:02.000Z","dependencies_parsed_at":"2024-09-03T13:52:21.677Z","dependency_job_id":"64647e63-2e07-4cd3-9f48-8b38dee457b8","html_url":"https://github.com/spkersten/flutter_test_ui","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spkersten%2Fflutter_test_ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spkersten%2Fflutter_test_ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spkersten%2Fflutter_test_ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spkersten%2Fflutter_test_ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spkersten","download_url":"https://codeload.github.com/spkersten/flutter_test_ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238366717,"owners_count":19460172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","testing","ui"],"created_at":"2024-09-24T13:45:21.152Z","updated_at":"2025-10-26T16:30:45.343Z","avatar_url":"https://github.com/spkersten.png","language":"Dart","readme":"# flutter_test_ui\n\nWrapper of `testWidgets`, `setUp`, and `tearDown` that provide the `WidgetTesterCallback` argument\nto the set-up and tear-down functions: `testUI`, `setUpUI`, and `tearDownUI`.\n\nThis allows a single set-up to be shared by several tests and the set-up to be continued in subgroups.\nIn particular, it allows test to be written in rspec style for better readability.\n\n```dart\ngroup(\"testUI and setUpUI example test\", () {\n  setUpUI((tester) async {\n    await tester.pumpWidget(MaterialApp(\n      home: Builder(\n        builder: (context) =\u003e GestureDetector(\n          onTap: () =\u003e Navigator.of(context).push(\n            MaterialPageRoute\u003cvoid\u003e(\n              builder: (context) =\u003e Container(\n                color: Colors.green,\n                child: const Text(\"page 2\"),\n              ),\n            ),\n          ),\n          child: Container(\n            color: Colors.red,\n            child: const Text(\"page 1\"),\n          ),\n        ),\n      ),\n    ));\n  });\n\n  testUI(\"first page is shown\", (tester) async {\n    expect(find.text(\"page 1\"), findsOneWidget);\n  });\n\n  group(\"tapping the text\", () {\n    setUpUI((tester) async {\n      await tester.tap(find.text(\"page 1\"));\n      await tester.pumpAndSettle();\n    });\n\n    testUI(\"second page is shown\", (tester) async {\n      expect(find.text(\"page 2\"), findsOneWidget);\n    });\n\n    group(\"pop the second page\", () {\n      setUpUI((tester) async {\n        final nav = tester.state\u003cNavigatorState\u003e(find.byType(Navigator));\n        nav.pop();\n        await tester.pumpAndSettle();\n      });\n\n      testUI(\"second page isn't visible anymore\", (tester) async {\n        expect(find.text(\"page 2\"), findsNothing);\n      });\n\n      testUI(\"first page is visible again\", (tester) async {\n        expect(find.text(\"page 1\"), findsOneWidget);\n      });\n    });\n  });\n});\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspkersten%2Fflutter_test_ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspkersten%2Fflutter_test_ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspkersten%2Fflutter_test_ui/lists"}