让我给你讲讲 iOS 自动化测试的那些干货(15)
发表于:2017-03-10来源:csdn作者:LeoMobileDeveloper点击数:
标签:iOS
describe( its click ) { context( when the dolphin is not near anything interesting ) { it( is only emitted once ) { expect(dolphin!. click() .count) .to ( equal( 1 ) ) } }} 1 2 3 4 5 6 7 1 2 3 4 5 6 7
describe("its click") {
context("when the dolphin is not near anything interesting") {
it("is only emitted once") {
expect(dolphin!.click().count).to(
equal(1))
}
}
}
除了这些之外,Quick也支持一些切入点,进行测试前的配置:
-
beforeEach
-
afterEach
-
beforeAll
-
afterAll
-
beforeSuite
-
afterSuite
Nimble
由于Quick是基于XCTest,开发者当然可以收使用断言来定义测试用例成功或者失败。Quick提供了一个更有好的Framework来进行这种断言:Nimble
比如,一个常见的XCTest断言如下:
原文转自:http://blog.csdn.net/hello_hwc/article/details/60957515