gpt4 book ai didi

javascript - UI自动化 iPhone : Is it possible to segment the script into several files

转载 作者:数据小太阳 更新时间:2023-10-29 05:56:09 25 4
gpt4 key购买 nike

我想为相当复杂的 iPhone 应用程序编写 UIAutomation(基于 JavaScript)测试。我不想使用一个大文件,而是通过使用多个文件来分离测试函数和助手。这可能吗?您如何构建 UIAutomation 测试?

最佳答案

嘿。
是的。虽然 import 关键字在浏览器中没有为 JS 实现,但在 Instruments 中实现了。您只需在使用 Instruments 运行的“主”JS 文件中编写 #import "somefile.js"。我没有尝试包含您提供给乐器的原始文件以外的其他位置的文件,但该位置的子文件夹有效。
看下面一个基于 this post 的例子:

#import "fileInTheSameDirectory.js"
#import "SubDirectory/fileInSubDirectory.js"

关于javascript - UI自动化 iPhone : Is it possible to segment the script into several files,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5381449/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com