flutter_gherkin icon indicating copy to clipboard operation
flutter_gherkin copied to clipboard

Click on DropdownMenuItem

Open HeropolisDa2ny opened this issue 2 years ago • 0 comments
trafficstars

Hi viewers-developers, I am trying to test a DropdownButton, however the tapping test on an item fails even if the previous test has verified that the child (DropdownMenuItem) exists.

With my personal steps :

... previous steps to make appear the DropdownButton
Then I have an "EntityDropdownButton" # succeed
When I tap the "EntityDropdownButton" button # succeed 
Then I have a "entityN1DropdownMenuItem" # succeed
When I tap the "entityN1DropdownMenuItem" button # fail

I caught this error :

TimeoutException after 0:00:10.000000: Future not completed

My functionnalities are basic, based on these methods :

find.byValueKey
FlutterDriverUtils.isPresent
FlutterDriverUtils.tap

But even if I am using the pre-coded steps :

... previous steps to make appear the DropdownButton
Then I have an "EntityDropdownButton" # succeed
When I tap the "EntityDropdownButton" button # succeed
Then I expect the text "entityN1" to be present # succeed
Then I tap the element that contains the text "entityN1" # fail

I caught this error :

Exception: DriverError: Error in Flutter application: Uncaught extension error while executing scrollIntoView: Bad state: Too many elements
#0      Iterable.single (dart:core/iterable.dart:656:24)
#1      CommandHandlerFactory._scrollIntoView (package:flutter_driver/src/common/handler_factory.dart:402:54)
<asynchronous suspension>
#2      FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:372:31)
<asynchronous suspension>
#3      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:856:18)
<asynchronous suspension>


#0      VMServiceFlutterDriver.sendCommand (package:flutter_driver/src/driver/vmservice_driver.dart:341:7)
<asynchronous suspension>
#1      FlutterDriver.scrollIntoView (package:flutter_driver/src/driver/driver.dart:402:5)
<asynchronous suspension>
#2      TapWidgetWithTextStep.<anonymous closure> (package:flutter_gherkin/src/flutter/steps/tap_widget_with_text_step.dart:18:7)
<asynchronous suspension>
#3      Future.timeout.<anonymous closure> (dart:async/future_impl.dart:871:15)
<asynchronous suspension>
#4      StepDefinitionGeneric.run.<anonymous closure> (package:gherkin/src/gherkin/steps/step_definition.dart:42:26)
<asynchronous suspension>
#5      Perf.measure (package:gherkin/src/utils/perf.dart:11:14)
<asynchronous suspension>
#6      StepDefinitionGeneric.run (package:gherkin/src/gherkin/steps/step_definition.dart:37:7)
<asynchronous suspension>
#7      FeatureFileRunner._runWithinTest (package:gherkin/src/feature_file_runner.dart:365:22)
<asynchronous suspension>
#8      FeatureFileRunner._runStep (package:gherkin/src/feature_file_runner.dart:334:16)
<asynchronous suspension>
#9      FeatureFileRunner._runScenario (package:gherkin/src/feature_file_runner.dart:256:24)
<asynchronous suspension>
#10     FeatureFileRunner._runScenarioInZone.<anonymous closure> (package:gherkin/src/feature_file_runner.dart:149:24)
<asynchronous suspension>

My question is how being able to test a dropdown with its children ?

HeropolisDa2ny avatar Apr 06 '23 11:04 HeropolisDa2ny