【发布时间】:2020-04-29 16:26:50
【问题描述】:
在排毒方面需要一些帮助。 我遇到了与https://github.com/wix/detox/issues/272类似的问题
我们的应用中包含一个 Pubnub 发布-订阅 SDK。因此,在运行排毒测试时,它总是会超时,因为它会等待连接关闭。
我在启动时尝试了 setURLBlacklist 和 detoxURLBlacklistRegex,但都没有成功。日志仍然说:
[com.wix.Detox:EarlGreyStatistics] App State -> busy Waiting for network requests to finish: (
"https://ps15.pndsn.com/v2/subscribe/sub-c-xxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
我相当肯定我的正则表达式是正确的。上面提到的问题中提到的正则表达式不起作用。我通常不会就简单的正则表达式寻求帮助,但我对 EarlGrey 的了解很少,而且我已经为此苦苦挣扎了一段时间。
我需要忽略对 ps[0-9][0-9].pndsn 的所有请求。对于正则表达式或黑名单数组的一点帮助将不胜感激。
await device.launchApp({permissions: { notifications: 'YES' }, launchArgs: { 'detoxPrintBusyIdleResources': 'YES' , 'detoxURLBlacklistRegex' : '\\(".*pndsn.com.*"\\)'}});
await device.setURLBlacklist([".*ps1.pndsn.com.*",".*ps2.pndsn.com.*",".*ps3.pndsn.com.*",".*ps4.pndsn.com.*",".*ps5.pndsn.com.*",".*ps6.pndsn.com.*",".*ps7.pndsn.com.*",".*ps8.pndsn.com.*",".*ps9.pndsn.com.*",".*ps10.pndsn.com.*",".*ps11.pndsn.com.*",".*ps12.pndsn.com.*",".*ps13.pndsn.com.*",".*ps14.pndsn.com.*",".*ps15.pndsn.com.*",".*ps16.pndsn.com.*",".*ps17.pndsn.com.*",".*ps18.pndsn.com.*",".*ps19.pndsn.com.*.",".*ps20.pndsn.com.*"]);
注意:如果我禁用同步,应用程序会在初始化时挂起。这是针对 iOS 应用的。
【问题讨论】:
-
您好,我看到您在启动后设置了网址黑名单。这意味着您的应用程序可能已经卡住了。最好将其设置为启动参数
-
如果还是不行,关注this guide,在Earl Grey的匹配中放一个断点,看看你的正则表达式为什么会失败。
-
为什么使用
.*ps...而不是https://ps...作为模式? -
@leoNatan 与上述指南有关,不幸的是,我在 xcode 中没有看到嵌入式二进制文件。是不是因为。 . . “如果您在命令行项目而不是 cocoa 项目中并且您的目标是 Mac OS X,则嵌入式二进制文件选项卡不会显示在 Xcode 中”让我知道如何将嵌入式二进制文件带入我的项目设置。
-
尝试听从克雷格的建议。
标签: ios react-native synchronization pubnub detox