首页 > 编程语言 >微信小程序测试框架minium 报错MiniCommandError: timeout问题排查和解决

微信小程序测试框架minium 报错MiniCommandError: timeout问题排查和解决

时间:2023-12-26 17:01:02浏览次数:64  
标签:10 minium 微信 45 2023 报错 18 packages

  • 系统: win10
  • python版本:3.11.7
  • minium版本:1.4.6
  • 微信开发工具版本:1.06.2310080

运行minitest官网的一个简单例子,内容如下

#!/usr/bin/env python3
import minium
class FirstTest(minium.MiniTest):
    def test_get_system_info(self):
        sys_info = self.mini.get_system_info()
        self.assertIn("SDKVersion", sys_info)
minitest -m test.first_test -c config.json -g

一个简单例子 (qq.com)


运行结果报以下错误:

====================case num:1, failed num:0, error num:1====================
FirstTest:test_get_system_info has error:
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\framework\libs\unittest\case.py", line 42, in testPartExecutor
    yield
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\framework\libs\unittest\case.py", line 117, in run
    self._miniSetUp()
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\framework\minitest.py", line 416, in _miniSetUp  
    self.app.go_home()
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\miniprogram\base_driver\minium_log.py", line 172, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\miniprogram\base_driver\app.py", line 837, in go_home
    page = self.switch_tab(
           ^^^^^^^^^^^^^^^^
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\miniprogram\base_driver\minium_log.py", line 172, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\utils\utils.py", line 82, in wrapper
    ret = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\miniprogram\base_driver\app.py", line 767, in switch_tab
    page = self._change_route_async(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\miniprogram\base_driver\app.py", line 933, in _change_route_async
    cmd.get_open_result(wait_timeout)
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\miniprogram\base_driver\app.py", line 128, in get_open_result
    return self._open_callback.get_result()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\minium\miniprogram\base_driver\callback.py", line 152, in get_result
    return self._waiter.result()
           ^^^^^^^^^^^^^^^^^^^^^
minium.framework.exception.MiniCommandError: timeout

最后提取重点错误为

minium.framework.exception.MiniCommandError: timeout

将此错误去网上查一下查,我这里用的bing,看有没有收获

查到一个minium.framework.exception.MiniCommandError? | 微信开放社区 (qq.com) 给出的方案是降低微信版本

还查到一个小程序云测 minium 开发工具调试总是报错呢? | 微信开放社区 (qq.com) 云测官网也说1.06.2310080版本有问题,需要回退
img

所以这里尝试回退版本到1.06.2308300,方法为去官网下载然后安装

官网地址:微信开发者工具1.06.2308300 Stable 更新说明 | 微信开放社区 (qq.com)

下载链接:https://dldir1.qq.com/WechatWebDev/release/be1ec64cf6184b0fa64091919793f068/wechat_devtools_1.06.2308300_win32_x64.exe

安装完成后打开开发工具,并在命令行重新运行代码

minitest -m test.first_test -c config.json -g

此时运行结果正常,测试代码运行成功,显示如下:

[I 2023-12-18 10:15:45 minium minitest#424 _miniSetUp] =========case: test_get_system_info start=========
[D 2023-12-18 10:15:45 minium.Conn4128 connection#417 _safely_send] SEND > {"id":"33e7dcb5-87c0-4c7c-bf3e-9caa432aaa15","method":"App.callWxMethod","params":{"method":"getSystemInfoSync","args":[]}}     
[D 2023-12-18 10:15:45 minium.Conn4128 connection#651 __on_message] RECV < {"id":"33e7dcb5-87c0-4c7c-bf3e-9caa432aaa15","result":{"result":{"model":"iPhone X","pixelRatio":3,"windowWidth":375,"windowHeight":812,"system":"iOS 10.0.1","language":"zh_CN","version":"8.0.5","deviceOrientation":"portrait","screenWidth":375,"screenHeight":812,"SDKVersion":"3.1.5","brand":"devtools","fontSizeSetting":16,"benchmarkLevel":1,"batteryLevel":100,"statusBarHeight":44,"bluetoothEnabled":true,"locationEnabled":true,"wifiEnabled":true,"cameraAuthorized":true,"locationAuthorized":true,"microphon...
[I 2023-12-18 10:15:45 minium minitest#717 capture] capture assertIn-success.png
[I 2023-12-18 10:15:45 minium basenative#25 wrapper] call IdeNative.screen_shot
[D 2023-12-18 10:15:45 minium.Conn4128 connection#417 _safely_send] SEND > {"id":"2aa2b00e-1815-4a6b-a527-8cd122049c62","method":"App.captureScreenshot","params":{}}
[D 2023-12-18 10:15:45 minium.Conn4128 connection#651 __on_message] RECV < {"id":"2aa2b00e-1815-4a6b-a527-8cd122049c62","result":{"data":"iVBORw0KGgoAAAANSUhEUgAAAXcAAAMsCAIAAAAgdHW0AAAAAXNSR0IArs4c6QAAIABJREFUeJzsvWmsZdeV3/dfa+99zrnTm+pVFVmcJFIlUoO7291sDx0SjbRj54MgBOigiWYMGDBgQ4KDeAhlBQkCNSQgg5mm3QjiQAIMG+jAkcEECRKjHSB2DAiSE3c3u9WaKVIlihRZc9Wb7nCGvdfKh33ufffNQ71b71Xp/EAU77v3nnPPPffs/1l7rbXXIv27j6KhoaFhZvBpH0BDQ8NDTqMyDQ0Ns6VRmYaGhtnSqExDQ8NsaVSmoaFhtjQq09DQMFsalWloaJgtjco0NDTMlkZlGhoaZkujMg0NDbOlUZmGhobZ0qhMQ0PDbGlUpqGhYbY0KtPQ0DBbGpVpaGiYLY3KNDQ0zJZGZRoaGmZLozINDQ2zpVGZhoaG2d...
[I 2023-12-18 10:15:45 minium basenative#29 wrapper] call IdeNative.screen_shot end
[D 2023-12-18 10:15:45 minium minitest#620 _miniTearDown] =========Current case Down: test_get_system_info=========
[I 2023-12-18 10:15:45 minium minitest#717 capture] capture teardown.png
[I 2023-12-18 10:15:45 minium basenative#25 wrapper] call IdeNative.screen_shot
[D 2023-12-18 10:15:45 minium.Conn4128 connection#417 _safely_send] SEND > {"id":"bc81e85c-6f26-43ea-91fa-7d11abb436e7","method":"App.captureScreenshot","params":{}}
[D 2023-12-18 10:15:45 minium.Conn4128 connection#651 __on_message] RECV < {"id":"bc81e85c-6f26-43ea-91fa-7d11abb436e7","result":{"data":"iVBORw0KGgoAAAANSUhEUgAAAXcAAAMsCAIAAAAgdHW0AAAAAXNSR0IArs4c6QAAIABJREFUeJzsvWmsZdeV3/dfa+99zrnTm+pVFVmcJFIlUoO7291sDx0SjbRj54MgBOigiWYMGDBgQ4KDeAhlBQkCNSQgg5mm3QjiQAIMG+jAkcEECRKjHSB2DAiSE3c3u9WaKVIlihRZc9Wb7nCGvdfKh33ufffNQ71b71Xp/EAU77v3nnPPPffs/1l7rbXXIv27j6KhoaFhZvBpH0BDQ8NDTqMyDQ0Ns6VRmYaGhtnSqExDQ8NsaVSmoaFhtjQq09DQMFsalWloaJgtjco0NDTMlkZlGhoaZkujMg0NDbOlUZmGhobZ0qhMQ0PDbGlUpqGhYbY0KtPQ0DBbGpVpaGiYLY3KNDQ0zJZGZRoaGmZLozINDQ2zpVGZhoaG2d...
[I 2023-12-18 10:15:45 minium basenative#29 wrapper] call IdeNative.screen_shot end
[I 2023-12-18 10:15:45 minium basenative#25 wrapper] call BaseNative.get_start_up
[I 2023-12-18 10:15:45 minium basenative#29 wrapper] call BaseNative.get_start_up end
====================case num:1, failed num:0, error num:0====================

此时运行以下命令,也可以看到运行结果:

python3 -m http.server 12345 -d outputs

打开 localhost:12345,显示如下:
img

测试用例最后成功运行。

总结:开发工具1.06.2310080版有问题,将开发工具回退到上一版本即可解决。

标签:10,minium,微信,45,2023,报错,18,packages
From: https://www.cnblogs.com/zhaoguowei12/p/17928477.html

相关文章

  • Camstar service:Database Unavailable报错
     原因说明:我们用的半导体8.5版本的。然后开发desginer用的2.0。问题就是出在2.0上,我们几个同事都是用2.0designer开发的,2.0导出差异一直报错,用的1.0导出差异不报错,后续再导入差异合并。(2个人的差异合并,更新直接系统挂了)。解决方案:拿原始档mdb,用designer1.0打开,导入A同事的差异,......
  • 微信小程序自定义ui库开发记录
    首先去翻官网,看有没有提供,发现微信官方提供了命令行工具,用于快速初始化一个项目npminstall-g@wechat-miniprogram/miniprogram-cli自定义组件/开发第三方自定义组件(qq.com)使用体验打包后的组件,每个js顶部都会带上一大段代码,增大了文件体积。没有相关的组件文档生......
  • Win10远程桌面连接报错:出现身份验证错误,要求的函数不受支持(CredSSP)
    问题: 解决方法:1、Win+R,打开运行窗口,输入regedit,打开注册表2、找到路径:计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System3、在System文件夹内创建文件夹项:\CredSSP\Parameters4、在Parameters文件夹内,新建DWORD(32)值(D),文件名为Al......
  • PyQt报错:Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framew
    PyQt报错:Cannotloadbackend'Qt5Agg'whichrequiresthe'qt5'interactiveframework,as'headless'iscurrentlyrunning问题描述在远程链接ubuntu虚拟机进行开发时,报错。解决方案原因是pyqt需要绘制UI,而使用远程链接的终端(如windowspowershell、xshell、vscodetermi......
  • 【Python微信机器人】第六七篇: 封装32位和64位Python hook框架实战打印微信日志
    目录修整目前的系列目录(后面会根据实际情况变动):在windows11上编译python将python注入到其他进程并运行注入Python并使用ctypes主动调用进程内的函数和读取内存结构体调用汇编引擎实战发送文本和图片消息(支持32位和64位微信)允许Python加载运行py脚本且支持热加载利用......
  • 微信小程序自动化测试踩坑记录
    微信开发工具版本:1.06.2310080win32-x64手动录制录制回放时使用真实接口会存在接口响应时间不一致,或者数据变化导致回放失败问题,以及有些业务流程可能只能走一遍,比如买同一时间的机票,所以建议使用mockrequest请求录制时不建议开启touch事件合并,会导致scroll-view滚动记录......
  • pnpm切换源后报错ERR_PNPM_REGISTRIES_MISMATCH
    工具都是有利有弊,使用pnpm过程中经常会出现一个错误:Thismodulesdirectorywascreatedusingthefollowingregistriesconfiguration:{"default":"https://registry.npmjs.org/"}.Thecurrentconfigurationis{"default":"https://registry.npm.taob......
  • go服务get请求中携带分号(;)时报错,获取不到参数的问题
    前言我们在写get方式的api请求时,有时候会用这样的一种方式携带参数:http://ip:port/a/b?query=key:1;value:2&other=xxx,这里我们注意到query一个字段其实是携带了等子字段的,一个是key,一个是value;这在go1.17版本之前是没有问题的。但是在1.17之后打印警告,在1.20之后,go服务会......
  • 苹果微信换图标方法!教你微信快速改任意图标教程(附图标)
    微信作为如今的社交大哥,使用人数早已突破了十亿人次,可见其用户体量之多堪称第一!用户量越多大家的需求也就越多,就像苹果微信想要实现安卓微信的各种功能,因为iOS系统的限制很多都是实现不了的。就比如更换微信图标这件事,安卓只需要更换一个喜欢的系统主题足以,但对于iPhone来说基本无......
  • jumpserver连接ecs实例报错:UNREACHABLE! => {"changed": false, "msg": "Failed to
     报错分析思路:1.是ssh密钥设置有没有对接2.防火墙拦截问题3.用户设置问题4.sshd配置问题 问题解决: 无法与221.229.216.39端口35846进行协商:找不到匹配的主机密钥类型。他们提供的是:ssh-rsa、ssh-dss[preauth]在sshd配置中加上ssh-rsa和ssh-dss是两种主机密钥算......