Skip to content

Releases: passsy/spot

v0.16.0

26 Nov 02:16
Compare
Choose a tag to compare
  • Add snapshotState<S>()
    final state = spot<MyContainer>().snapshotState<MyContainerState>()
  • Add snapshotRenderBox()
  • Export WidgetPresence
  • Add @useResult to .atMost(N), .atLeast(N), .amount(N) and .existsAtMostNTimes(N) to prevent missing assertions
  • Fix existsAtLeastNTimes dumping the widget tree to console
  • Fix image rendering with TimelineMode.always
  • Add Timeline to /README.md
  • Add act to /README.md

v0.15.0

21 Nov 16:39
Compare
Choose a tag to compare
  • Add loadAppFonts() to display your app fonts on screenshots #66
  • Add loadFont() to load a fonts from a file. Useful when your app depends on preinstalled system fonts (loadFont('Comic Sans', [r'C:\Windows\Fonts\comic.ttf'])) #66
  • New direct access to properties from WidgetSelector #71
    • spot<MyWidget>().getWidgetProp(widgetProp('color', (widget) => widget.color));
    • spot<_MyContainer>().getStateProp(stateProp<String, _MyContainerState>('innerValue', (s) => s.innerValue));
    • spot<_MyContainer>().getRenderObjectProp(renderObjectProp<Size, RenderBox>('size', (r) => r.size));
  • New getStateProp and stateProp to access state properties #71
    spot<_MyContainer>().existsOnce().getStateProp(stateProp('innerValue', (_MyContainerState s) => s.innerValue));
  • New timeline mode TimelineMode.always to always print a timeline after each test #68
  • Deprecate TimelineMode.record in favor of TimelineMode.reportOnError (which is the default) #68
  • Timeline now shows partial tap warnings #69
  • Never show big widget tree dumps in console, only in Timeline HTML report #70
  • act.tap() now shows a Crosshair on the screenshot
  • Fix code samples of whereWidgetProp(), whereElementProp() and whereRenderObjectProp() #67

v0.14.0

07 Nov 02:00
Compare
Choose a tag to compare
  • New: Timeline! Failing tests now print a timeline with screenshots of all interactions (actions and assertions) as HTML report #57
  • act.tap now checks for multiple tappable position when the center is not tappable for some reason #60
  • act.tap now reports a useful error when the widget is 0px/0px or invisible #61
  • Become Compatible with Flutter 3.27 and add nightly tests against master

v0.13.0

07 Nov 02:00
Compare
Choose a tag to compare
  • Add act.dragUntilVisible() #59

v0.12.1

16 May 11:26
Compare
Choose a tag to compare
  • Support for Flutter 3.22
  • Remove unused dependencies #55

v0.4.3

16 May 11:13
Compare
Choose a tag to compare
  • Remove unused dependencies. Fixes incompatibility with latest test_api versions #55

v0.3.3

16 May 11:12
Compare
Choose a tag to compare
  • Widen test_api range to support Flutter 3.22

v0.12.0

22 Mar 10:50
Compare
Choose a tag to compare
  • Breaking Offstage support. By default Offstage widgets are not found by spot<W>(). Use spotOffstage().spot<W>() to find them. spotAllWidgets() returns onstage and offstage widgets. Use .overrideWidgetPresence(WidgetPresence.offstage) to modify a WidgetSelector to search for offstage, onstage or combined #45
  • New: act.enterText(spot<TextField>(), 'Hello World!') allows to enter text into a EditableText #51
  • Negating parents is not yet supported (spot<ListView>().withParent(spot<Scaffold>().atMost(0))). It now throws to prevent unexpected behavior. #50
  • act.tap(spot<ElevatedButton>()) now pumps automatically after the tap #52

v0.11.0

19 Feb 01:43
Compare
Choose a tag to compare
  • Add support for Flutter 3.20
  • Update checks to 0.3.0 #48
  • Remove deprecated property selector from withProp() and hasProp(). Use elementSelector instead
  • Widen test_api version range to include 0.7.X

v0.10.0

05 Feb 22:00
Compare
Choose a tag to compare

High-level API changes

  • Breaking spotText('dash') can now return multiple widgets
  • New: .atLeast(n) and .atMost(n) and .amount(n) to force the number of expected widgets.
    .atMost(0) can be used to test that a widget does not exist!
  • Deprecated: spotSingle<W>() is now deprecated. Use spot<W>() instead, or spot<W>().atMost(1) to indicate that only a single widget is expected.
  • Fix: .first() and .last()
  • New: .atIndex(n) allows to get the widget at a specific index (when multiple are found)
  • Deprecate: allWidgets in favor of spotAllWidgets() to avoid conflicts with local variables
  • New: getDiagnosticProp<T>('name') for easy access to the values of a diagnostic property #40
  • New: hasEffectiveTextStyle, withEffectiveTextStyleMatching(), withEffectiveTextStyle() #36, #38
  • Improve: WidgetSelector.toString() has been improved, has now separators for stages and adds braces.
    Example: Center with child SizedBox ❯ with parent (Scaffold ᗕ Row)
  • Added tons of documentation and examples

Advanced API changes

Those changes can be breaking for packages that depend on spot or advanced usages, but should not affect most users.

  • Breaking WidgetSelector now has List<ElementFilter> stages, replacing the previous props, parents, children and elementFilters.
  • Breaking WidgetSelector constructor and copyWith signature changed, reflecting the new properties.
    createElementFilters(), createCandidateGenerator() and toStringWithoutParents() have been removed.
  • WidgetSelector now has a quantityConstraint property (deprecates expectedQuantity) that allows setting the min and max number of expected widgets.
  • WidgetSelector replaces SingleWidgetSelector and MultiWidgetSelector
  • Breaking Quantity assertions like .doesNotExist() or .existsOnce() now return WidgetMatcher/MultiWidgetMatcher instead of WidgetSnapshot.
    To get the WidgetSnapshot use snapshot() instead.
  • Breaking Remove WidgetSelector.cast because it lost information and was untested
  • Breaking PropFilter has been renamed to PredicateFilter
  • Breaking PredicateWithDescription has been removed
  • Breaking CandidateGenerator has been removed
  • Explicitly export all classes/extensions/functions to prevent accidental leaks of internal APIs