gpt4 book ai didi

swift - FaSTLane 快照 – 空白屏幕截图

转载 作者:行者123 更新时间:2023-11-30 11:45:32 24 4
gpt4 key购买 nike

我目前正在尝试自动化捕获应用程序屏幕截图的过程。我面临的问题是,快照只是创建一些空白的 2x2px 图像,如下所示: iPhone 6 Screenshot

是的,我已经在setUp方法中配置了快照:

override func setUp() {
super.setUp()
app = XCUIApplication()
setupSnapshot(app)
app.launch()
}

我的 UITest 方法::

    func testExample() {
//Screenshot
snapshot("01Screen")

let tablesQuery = app.tables
tablesQuery.cells.element(boundBy: 0).tap()
//Screenshot
snapshot("02Screen")

tablesQuery.cells.element(boundBy: 1).tap()
//Screenshot
snapshot("03Screen")
app.navigationBars.buttons.element(boundBy: 0).tap()
app.navigationBars.buttons.element(boundBy: 0).tap()


tablesQuery.cells.element(boundBy: 2).tap()
tablesQuery.cells.element(boundBy: 0).tap()
//Screenshot
snapshot("04Screen")
app.navigationBars.buttons.element(boundBy: 0).tap()
app.navigationBars.buttons.element(boundBy: 0).tap()
app.navigationBars.buttons.element(boundBy: 0).tap()
}

你们中有人遇到过同样的问题吗? UITest在模拟器和实体设备上均能成功完成。

最诚挚的问候 schuetzii

编辑:

我发现这个问题可能与我包含了一些 Pod 相关。我不知道如何解决这个问题。

我做到了

fastlane init

还有

snapshot init

并将 SnapshotHelper.swift 复制到 UITest 类。我错过了什么吗?网页新截图,自行生成faSTLane:Web page

最佳答案

好吧,我自己解决了这个荒谬的问题。目前无法同时使用 Cocoapods 和 Snapshot。如果我同时使用两者,我会得到 2x2px 图像。现在我已经手动添加了 SDK(Firebase 和 GoogleSignIn),一切运行顺利。没有关于如何将 Snapshot 与 Pod 一起使用的提示,希望一次能发挥作用。

关于swift - FaSTLane 快照 – 空白屏幕截图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48870357/

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