【问题标题】:Trouble running KIF iOS Automation Tests运行 KIF iOS 自动化测试时遇到问题
【发布时间】:2014-05-12 01:31:55
【问题描述】:

刚刚完成将 KIF 集成到我的项目中 -- 但我无法让测试运行...

当我运行单元测试时,XCTest 示例运行良好,但单独的 kif 测试从不执行。此外,它们会出现在测试导航器中,但是当我明确告诉它们执行时,它们根本不会。

我的 KIF 测试如下所示:

- (void)beforeEach
{
    NSLog(@"starting");
}

- (void)afterEach
{
    NSLog(@"ending");
}

- (void)testSuccessfulLogin
{
    [tester enterText:@"user@example.com" intoViewWithAccessibilityLabel:@"Login User Name"];
    [tester enterText:@"thisismypassword" intoViewWithAccessibilityLabel:@"Login Password"];
    [tester tapViewWithAccessibilityLabel:@"Log In"];
    [tester waitForTappableViewWithAccessibilityLabel:@"Welcome"];
}

和子类KIFTestCase

我很想提供更多信息,但我不知道还能说什么……有人有运行 KIF 测试的经验吗?

谢谢!

【问题讨论】:

  • 您看到的错误信息是什么?您的应用是否可访问?
  • 这可能不是测试,而是您运行测试的方式。你能再解释一下吗?

标签: ios kif


【解决方案1】:

很抱歉回答迟了,但我实际上是在检查 v1 cocoapod(XCTest 前)。这样就行了!!

当我切换时一切正常。确保在您的 pod 文件中执行此操作:

target 'Acceptance Tests', :exclusive => true do
    pod 'KIF', '~> 3.0'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-09
    • 2019-09-28
    • 2017-12-28
    • 1970-01-01
    • 2015-12-01
    • 1970-01-01
    • 2016-04-25
    • 2021-08-09
    相关资源
    最近更新 更多