Skip to content

Commit

Permalink
fix more conflicts that were not detected by git
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Nov 20, 2023
1 parent 3ec8e33 commit d802767
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 450 deletions.
5 changes: 5 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ scripts:
run: melos run analyze && melos run format-check
description: Run all static analysis checks.

get:all:
run: melos exec -- \
flutter pub get
description: Run `flutter pub get` for all packages.

analyze:
run: |
melos exec -- \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ void main() {
_print('ran patrolSetUpAll (2) before "$currentTest"');
});

patrolTest('testA', nativeAutomation: true, _body);
patrolTest('testB', nativeAutomation: true, _body);
patrolTest('testC', nativeAutomation: true, _body);
patrolTest('testA', _body);
patrolTest('testB', _body);
patrolTest('testC', _body);
});
}

Future<void> _body(PatrolTester $) async {
Future<void> _body(PatrolIntegrationTester $) async {
final testName = Invoker.current!.fullCurrentTestName();
_print('ran body of test "$testName"');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main() {
_print('ran patrolTearDown (1) after "$currentTest"');
});

patrolTest('testFirst', nativeAutomation: true, _body);
patrolTest('testFirst', _body);

group('groupA', () {
patrolSetUp(() async {
Expand All @@ -35,15 +35,15 @@ void main() {
_print('ran patrolTearDown (2) after "$currentTest"');
});

patrolTest('testA', nativeAutomation: true, _body);
patrolTest('testB', nativeAutomation: true, _body);
patrolTest('testC', nativeAutomation: true, _body);
patrolTest('testA', _body);
patrolTest('testB', _body);
patrolTest('testC', _body);
});

patrolTest('testLast', nativeAutomation: true, _body);
patrolTest('testLast', _body);
}

Future<void> _body(PatrolTester $) async {
Future<void> _body(PatrolIntegrationTester $) async {
final testName = Invoker.current!.fullCurrentTestName();
_print('ran body of test "$testName"');

Expand Down
42 changes: 0 additions & 42 deletions packages/patrol_finders/lib/src/custom_finders/patrol_finder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,48 +250,6 @@ class PatrolFinder implements MatchFinder {
);
}

/// Waits until this finder finds at least 1 visible widget and then makes
/// long press gesture on it.
///
/// Example:
/// ```dart
/// // long presses on the first widget having Key('createAccount')
/// await $(#createAccount).longPress();
/// ```
///
/// If the finder finds more than 1 widget, you can choose which one to make
/// long press on:
///
/// ```dart
/// // long presses on the third TextButton widget
/// await $(TextButton).at(2).longPress();
/// ```
///
/// After long press gesture this method automatically calls
/// [WidgetTester.pumpAndSettle]. If you want to disable this behavior,
/// set [settlePolicy] to [SettlePolicy.noSettle].
///
/// See also:
/// - [PatrolFinder.waitUntilVisible], which is used to wait for the widget
/// to appear
/// - [WidgetController.longPress]
Future<void> longPress({
@Deprecated('Use settlePolicy argument instead') bool? andSettle,
SettlePolicy? settlePolicy,
Duration? visibleTimeout,
Duration? settleTimeout,
}) async {
await tester.longPress(
this,
settlePolicy: chooseSettlePolicy(
andSettle: andSettle,
settlePolicy: settlePolicy,
),
visibleTimeout: visibleTimeout,
settleTimeout: settleTimeout,
);
}

/// Waits until this finder finds at least 1 visible widget and then enters
/// text into it.
///
Expand Down
49 changes: 0 additions & 49 deletions packages/patrol_finders/lib/src/custom_finders/patrol_tester.dart
Original file line number Diff line number Diff line change
Expand Up @@ -302,55 +302,6 @@ class PatrolTester {
});
}

/// Waits until this finder finds at least 1 visible widget and then makes
/// long press gesture on it.
///
/// Example:
/// ```dart
/// // long presses on the first widget having Key('createAccount')
/// await $(#createAccount).longPress();
/// ```
///
/// If the finder finds more than 1 widget, you can choose which one to make
/// long press on:
///
/// ```dart
/// // long presses on the third TextButton widget
/// await $(TextButton).at(2).longPress();
/// ```
///
/// After long press gesture this method automatically calls
/// [WidgetTester.pumpAndSettle]. If you want to disable this behavior,
/// set [settlePolicy] to [SettlePolicy.noSettle].
///
/// See also:
/// - [PatrolFinder.waitUntilVisible], which is used to wait for the widget
/// to appear
/// - [WidgetController.longPress]
Future<void> longPress(
Finder finder, {
@Deprecated('Use settlePolicy argument instead') bool? andSettle,
SettlePolicy? settlePolicy,
Duration? visibleTimeout,
Duration? settleTimeout,
}) {
return TestAsyncUtils.guard(() async {
final resolvedFinder = await waitUntilVisible(
finder,
timeout: visibleTimeout,
);
await tester.longPress(resolvedFinder.first);
final settle = chooseSettlePolicy(
andSettle: andSettle,
settlePolicy: settlePolicy,
);
await _performPump(
settlePolicy: settle,
settleTimeout: settleTimeout,
);
});
}

/// Waits until [finder] finds at least 1 visible widget and then enters text
/// into it.
///
Expand Down
3 changes: 3 additions & 0 deletions packages/patrol_gen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Omit committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
Loading

0 comments on commit d802767

Please sign in to comment.