小编Han*_*l T的帖子

FlutterDriver 问题,无法通过 Key 找到 Widget

我在 SerializableFinder 中按键查找小部件时遇到问题,我该怎么做才能解决这个问题?

我尝试使用常量制作密钥,并确保通过提供常量来检查密钥是否与 finder 中的密钥相同。此外,我指的是这个链接:Flutter Driver: Test BottomNavigationBarItem

这是代码:集成测试文件(示例部分,不是完整代码):

// todo: bottom navigation pressed
    test('bottom navigation bar test item', () async{

      // todo: intended = pressed favorite dessert, but we want to test
      await flutterDriver.waitFor(bottomNavigationBar);

      // todo: bottom navigation bar item text research
      await flutterDriver.tap(dessert); // intended : tap at bottom navigation view item

      print('This is Dessert section');

      // todo: expect title is keyword

      await flutterDriver.tap(seafood);

      print('This is Seafood section');

      await flutterDriver.tap(favoriteDessert);

      print('This is Favorite Dessert section');

      await …
Run Code Online (Sandbox Code Playgroud)

integration-testing flutter

11
推荐指数
1
解决办法
3256
查看次数

标签 统计

flutter ×1

integration-testing ×1