widget_test_kit 0.3.0
widget_test_kit: ^0.3.0 copied to clipboard
Declarative, readable widget-testing helpers for Flutter.
0.3.0 #
π New Features #
- Accessibility extensions β
expectMeetsTapTargetGuideline,expectMeetsTextContrastGuideline,expectMeetsLabeledTapTargetGuideline, and the aggregateexpectMeetsAccessibilityGuidelineswrap Flutter's built-in accessibility guideline checks into single-call assertions. - Network image mocking β
mockNetworkImages()interceptsImage.network/NetworkImagerequests with an in-memory placeholder so widget and golden tests no longer fail or hang without real network access. TestApp.wrapperβ injectProviderScope,BlocProvider, or any other ancestor widget around theMaterialAppwithout this package depending on a state-management library.- Multi-locale goldens β
expectGoldenForLocales()pumps a widget once per locale and captures a golden per locale, for catching RTL/overflow/truncation regressions. - More style matchers β
toHaveElevation,toHaveBoxShadow,toHaveGradient,toHaveTextAlign,toHaveFontWeight,toHaveMaxLines.
π§ Improvements #
- Added a runnable
example/app with widget tests demonstrating forms, gestures, the robot pattern, accessibility, and network image mocking. - Added a GitHub Actions CI workflow running formatting, analysis, and tests for both the package and the example app.
- Enabled
public_member_api_docsand additional lints inanalysis_options.yaml. - Fixed
.gitignorebuild/coverage patterns so nested packages (likeexample/) don't leak build artifacts into the published package.
0.2.0 #
π New Features #
- Golden path overrides β
expectGoldenandexpectWidgetGoldennow support customgoldenPathvalues while keepinggoldens/[name].pngas the default.
π§ Improvements #
- Hardened finder helpers so documented dropdown, hint, and label lookups behave consistently.
- Improved dialog dismissal, scroll helpers, golden surface cleanup, list matcher failure messages, and direct hidden-widget visibility checks.
- Added focused test coverage for navigation, gestures, goldens, list matchers, style matchers, finder helpers, visibility edge cases, and the
not()matcher. - Cleaned package metadata by removing generated template comments from
pubspec.yaml.
0.1.0 #
π New Features #
- Navigation extensions β
navigateTo,goBack,expectRoute,expectDialog,expectNoDialog,expectBottomSheet,dismissDialog,expectSnackBar. - Gesture extensions β
swipeLeft,swipeRight,swipeUp,swipeDown,longPressOn,doubleTapOn,dragSliderTo,scrollUntilFound,pullToRefresh. - List/Scrollable matchers β
toHaveItemCount,toContainWidget,toBeScrollable,toBeEmptyList. - Style/Visual matchers β
toHaveOpacity,toHaveColor,toHaveFontSize,toHavePadding,toHaveDecoration,toHaveBorderRadius,toHaveAlignment. - ScreenRobot β abstract base class for the page-object/robot pattern.
- Golden test extensions β
expectGolden,expectWidgetGolden,setScreenSize,resetScreenSize. not()matcher combinator β negate any matcher for expressive assertions.- Expanded finders β
find.iconWidget,find.imageAsset,find.listTile,find.tabWithLabel,find.dropdown,find.chip,find.byHintText,find.byLabelText.
π§ Improvements #
- Bumped package to
0.1.0to signal feature-complete v1 preview.
0.0.2 #
- Initial release.
- TestApp β minimal
MaterialApp+Scaffoldwrapper for widget tests. - Expectation extensions β
expectThat,expectThatSingle,shouldBe,expectThatEventually. - Form extensions β
completeForm,updateField,updateForm,submitForm,clearForm,updateFieldWithRetry. - Finder extensions β
find.button()for anyButtonStyleButton/IconButton. - FieldFinders utility β
byKey,byLabel,byHint,bySemantics. - Matchers
- Visibility:
toBeVisible,toBeHidden,toNotExist. - State:
toBeEnabled,toBeDisabled,toBeChecked,toBeUnchecked,toHaveValue. - Content:
toHaveText,toContainText,toHaveSemantics. - Layout:
toHaveSize,toBePositioned,toBeWithin.
- Visibility: