Malarg commented on code in PR #25033:
URL: https://github.com/apache/beam/pull/25033#discussion_r1090558848


##########
playground/frontend/integration_test/standalone_cancel_running_example_test.dart:
##########
@@ -49,15 +43,8 @@ void main() {
 
 Future<void> _runAndCancelExample(WidgetTester wt, Duration duration) async {
   await wt.tap(find.runOrCancelButton());
-  try {
-    await wt.pumpAndSettle(
-      const Duration(milliseconds: 100),
-      EnginePhase.sendSemanticsUpdate,
-      duration,
-    );
-  } catch (e) {
-    //ignore
-  }
+
+  await wt.wait(duration);

Review Comment:
   done



##########
playground/frontend/integration_test/common/finder.dart:
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import 'package:flutter/painting.dart';
+import 'package:flutter_test/flutter_test.dart';
+
+extension FinderExtension on Finder {
+  Finder getChildrenByType(Type childType) {
+    final finders = evaluate();
+    final childElements = finders
+        .map((e) => collectAllElementsFrom(e, skipOffstage: true))
+        .expand((e) => e)
+        .where((e) => e.widget.runtimeType == childType);
+
+    return find.byElementPredicate(
+      (element) => childElements.contains(element),
+    );
+  }
+
+  Finder horizontallyAt(int index, WidgetTester wt) =>
+      _alignedIndexAt(index, Axis.horizontal, wt);
+
+  Finder verticallyAt(int index, WidgetTester wt) =>
+      _alignedIndexAt(index, Axis.vertical, wt);
+
+  Finder _alignedIndexAt(int index, Axis axis, WidgetTester wt) {
+    final finders = evaluate();
+
+    if (index > finders.length - 1) {
+      throw IndexError(index, finders);
+    }
+
+    final offsets = <_IndexAndOffset>[];
+
+    for (int i = 0; i < finders.length; i++) {
+      offsets.add(_IndexAndOffset(i, wt.getCenter(at(i))));
+    }
+
+    offsets.sort(
+      (a, b) => axis == Axis.vertical
+          ? _compareDoubles(a.offset.dy, b.offset.dy)
+          : _compareDoubles(a.offset.dx, b.offset.dx),
+    );
+
+    return at(offsets[index].index);
+  }
+
+  int _compareDoubles(double a, double b) {
+    if (a == b) {
+      return 0;
+    } else if (a > b) {
+      return 1;
+    } else {
+      return -1;
+    }

Review Comment:
   done



##########
playground/frontend/integration_test/common/finder.dart:
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import 'package:flutter/painting.dart';
+import 'package:flutter_test/flutter_test.dart';
+
+extension FinderExtension on Finder {
+  Finder getChildrenByType(Type childType) {
+    final finders = evaluate();
+    final childElements = finders
+        .map((e) => collectAllElementsFrom(e, skipOffstage: true))
+        .expand((e) => e)
+        .where((e) => e.widget.runtimeType == childType);
+
+    return find.byElementPredicate(
+      (element) => childElements.contains(element),
+    );
+  }
+
+  Finder horizontallyAt(int index, WidgetTester wt) =>
+      _alignedIndexAt(index, Axis.horizontal, wt);
+
+  Finder verticallyAt(int index, WidgetTester wt) =>
+      _alignedIndexAt(index, Axis.vertical, wt);
+
+  Finder _alignedIndexAt(int index, Axis axis, WidgetTester wt) {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to