我们正在开发一个react本地应用程序,并在CI上使用detox构建自动化测试。我想知道如何测试该应用程序的离线模式与排毒?有人试过这个吗?
发布于 2022-12-02 11:04:01
我找到了android仿真器的解决方案:
export function setNetworkConnection(boolean: boolean) {
child.exec(
"adb shell svc data " +
`${boolean ? "disable;" : "enable;"}` +
"adb shell svc wifi " +
`${boolean ? "disable;" : "enable;"}`,
function (error, stdout, stderr) {
if (error !== null) {
console.log(stdout, stderr);
console.log("child.exec error: " + error);
}
}
);
}https://stackoverflow.com/questions/74533337
复制相似问题