findsOne top-level constant

Matcher const findsOne

Asserts that the FinderBase finds exactly one matching candidate.

Sample code

expect(find.text('Save'), findsOne);

See also:

  • findsNothing, when you want the finder to not find anything.
  • findsAny, when you want the finder to find one or more candidates.
  • findsExactly, when you want the finder to find a specific number candidates.
  • findsAtLeast, when you want the finder to find at least a specific number of candidates.

Implementation

const Matcher findsOne = _FindsCountMatcher(1, 1);