gpt4 book ai didi

arrays - 如何在我的 UI 测试中从 XCUIApplication 访问 NSApplicationDelegate

转载 作者:搜寻专家 更新时间:2023-11-01 06:04:52 26 4
gpt4 key购买 nike

我需要访问应用程序委托(delegate)中的一些值,以使用 Sparkle 修改(和测试)更新过程。所以问题是,如何在我的 UI 测试中从 XCUIApplication 访问 NSApplicationDelegate?

最佳答案

简答:
您无法从您的 UITest 项目访问您的 AppDelegate 文件。

长答案:
正如 Oletha 在 their answer here 中所述:

Xcode UI testing is designed such that the test code can only see what a user can see, so no objects from the application under test can be used or inspected in the test code. This is also why the views on the screen are represented as XCUIElement objects instead of UIView descendants.

The UI tests run in a separate executable from the application under test.

关于arrays - 如何在我的 UI 测试中从 XCUIApplication 访问 NSApplicationDelegate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40267536/

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