alexeyinkin commented on code in PR #24731:
URL: https://github.com/apache/beam/pull/24731#discussion_r1054499203


##########
playground/frontend/integration_test/standalone_change_example_test.dart:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+import 'package:playground_components_dev/playground_components_dev.dart';
+
+import 'common.dart';
+
+const _fiveSec = Duration(seconds: 5);
+
+void main() {
+  IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+
+  group('Integration.', () {
+    testWidgets('Change example', (WidgetTester wt) async {
+      await init(wt);
+
+      expect(
+        wt.findOneCodeController().lastTextSpan!.toPlainText(),
+        await Examples.getJavaVisibleText(ExamplePaths.javaMinimalWordCount),
+      );
+
+      await wt.tap(find.exampleSelector());
+      await wt.pumpAndSettle();
+
+      await wt.tap(find.exampleItemInDropdown(ExampleNames.aggregationMax));

Review Comment:
   For `exampleItemInDropdown`:
   It hides the lookup of `GestureDetector` which is an implementation detail. 
If we ever change to another target in this lookup, we will have hard time 
replacing `GestureDetector`.
   
   For both:
   1. When you type `find.`, you can see the suggestions instead of picking the 
widget class.
   2. We can find all tests using this method. That is a more narrow result 
than looking for all uses of `ExampleSelector`.
   3. Lines get shorter which is important with the Dart column limit.
   4. More consistent if we must have `exampleItemInDropdown` anyway.



-- 
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