firebase testlab xctest成功,但没有屏幕截图

发布于 2025-01-31 16:22:32 字数 1403 浏览 4 评论 0原文

我通过firebase testlab运行了xctest(UI测试),它已经成功了,但

在情况下没有屏幕截图,我通过“ xctattachment”进行附件,

- (void)testHomeButton {
    XCUIApplication *app = [[XCUIApplication alloc] init];
    [app launch];
    
    // click button2
    XCUIElement *button2 = app.buttons[@"button2"];
    [button2 tap];
    
    // get button2 screenshoot
    XCTAttachment *attachment1 = [XCTAttachment attachmentWithScreenshot:XCUIScreen.mainScreen.screenshot];
    attachment1.name = @"button2 Screen";
    attachment1.lifetime = XCTAttachmentLifetimeKeepAlways;
    [self addAttachment:attachment1];
    
    // click button3
    XCUIElement *button3 = app.buttons[@"button3"];
    [button3 tap];
    
    // get button3 screenshoot
    XCTAttachment *attachment2 = [XCTAttachment attachmentWithScreenshot:XCUIScreen.mainScreen.screenshot];
    attachment2.name = @"button3 Screen";
    attachment2.lifetime = XCTAttachmentLifetimeKeepAlways;
    [self addAttachment:attachment2];
    
    // click testview
    XCUIElement *testview = [app.otherElements.element childrenMatchingType:XCUIElementTypeAny][@"testvc_view"];
    [testview tap];
}

我通过Xcode Test(命令 + U)成功地进行了屏幕检查。 xcode测试结果

但是,firebase的测试结果没有屏幕截图,只包含日志和视频

。我应该做屏幕截图吗?

非常感谢!

I run a XCTest (UI Test) via Firebase TestLab, it's succeed。But no screenshoot

In the case, I make a attachment via "XCTAttachment"

- (void)testHomeButton {
    XCUIApplication *app = [[XCUIApplication alloc] init];
    [app launch];
    
    // click button2
    XCUIElement *button2 = app.buttons[@"button2"];
    [button2 tap];
    
    // get button2 screenshoot
    XCTAttachment *attachment1 = [XCTAttachment attachmentWithScreenshot:XCUIScreen.mainScreen.screenshot];
    attachment1.name = @"button2 Screen";
    attachment1.lifetime = XCTAttachmentLifetimeKeepAlways;
    [self addAttachment:attachment1];
    
    // click button3
    XCUIElement *button3 = app.buttons[@"button3"];
    [button3 tap];
    
    // get button3 screenshoot
    XCTAttachment *attachment2 = [XCTAttachment attachmentWithScreenshot:XCUIScreen.mainScreen.screenshot];
    attachment2.name = @"button3 Screen";
    attachment2.lifetime = XCTAttachmentLifetimeKeepAlways;
    [self addAttachment:attachment2];
    
    // click testview
    XCUIElement *testview = [app.otherElements.element childrenMatchingType:XCUIElementTypeAny][@"testvc_view"];
    [testview tap];
}

I have got screenshoot successfully via xcode test (command + U)
xcode test result

However the test result of firebase has no screenshoot attachments, only contains logs and videos

What should I do to get the screenshot?

Thanks a lot!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文