讓我給你講講 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