在应用程序安装期间由于超时而无法运行排毒测试

问题描述

当尝试在云(AWS)中配置的计算机上运行测试时,在安装应用程序期间出现超时错误

带有val VoteState = remember { mutableStateOf(false)} if(VoteState.value){ Button(onClick = { onVotePollClick(poll) },modifier = Modifier.width(200.dp).align(Alignment.CenterHorizontally).clip( CircleShape )) { Text(text = "Vote") } }else{ Button(onClick = { onVotePollClick(poll) },modifier = Modifier.width(200.dp).align(Alignment.CenterHorizontally).clip( CircleShape ).background(Color.Gray)) { Text(text = "Vote") } } 输出显示以下内容

--loglevel trace

但是,当我手动运行安装命令时,它会成功。 detox[7183] DEBUG: [exec.js/EXEC_CMD,#16] "/opt/android-sdk/platform-tools/adb" -s emulator-5554 shell "pm install -r -g -t /data/local/tmp/detox/Application.apk" detox[7183] WARN: at e2e/utils/testRail.js:49:25 Creating a new Run in TestRail has Failed with the following error {} detox[7183] ERROR: [DetoxExportWrapper.js/DetoX_INIT_ERROR] { DetoxRuntimeError: Aborted detox.init() execution,and Now running detox.cleanup() HINT: Most likely,your test runner is tearing down the suite due to the timeout error at Detox.[_assertnopendingInit] (/home/fundBox/mobileNative/node_modules/detox/src/Detox.js:204:9) at Detox.beforeEach (/home/fundBox/mobileNative/node_modules/detox/src/Detox.js:111:37) at DetoxExportWrapper.(anonymous function).args [as beforeEach] (/home/fundBox/mobileNative/node_modules/detox/src/DetoxExportWrapper.js:87:32) at DetoxAdapterImpl.beforeEach (/home/fundBox/mobileNative/node_modules/detox/runners/jest/DetoxAdapterImpl.js:28:22) at process._tickCallback (internal/process/next_tick.js:68:7) name: 'DetoxRuntimeError' } 命令显示安装需要1m51s来安装:

time

是否可以配置或增加此步骤或全局超时?

解决方法

看来我找到了这个地方。显然,有一个文件可以配置超时常量e2e/consts.js

以下位置看起来很重要:

exports.wait = 2000;
exports.timeout = 30000;
exports.jestTimeout = 120000;

我将exports.jestTimeout的值更新为更高的值,并且测试能够通过有问题的步骤。