• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 基于 KIF 的 iOS UI 自動化測試和持續集成(4)

    發表于:2017-03-10來源:美團點評技術團隊作者:美團點評技術團隊點擊數: 標簽:iOSKIF
    (2)用例常用操作接口: UI交互操作( KIFUITestActor.h 中可查閱): tapThisView: - (void)tapViewWithAccessibilityLabel:(NSString *)label; waitForView: - (UIView *)waitForViewWithAcces
    (2)用例常用操作接口:
    • UI交互操作( KIFUITestActor.h 中可查閱):
        tapThisView:                - (void)tapViewWithAccessibilityLabel:(NSString *)label;
        waitForView:                - (UIView *)waitForViewWithAccessibilityLabel:(NSString *)label;
            注意:函數返回了對應View的指針,可以對返回值取數據,從而進行一些判斷
        enterTextIntoView:          - (void)enterText:(NSString *)text intoViewWithAccessibilityLabel:(NSString *)label;
        tapRowOnTableView:          - (void)tapRowAtIndexPath:(NSIndexPath *)indexPath inTableViewWithAccessibilityIdentifier:(NSString *)identifier NS_AVAILABLE_IOS(5_0); 
        dismisses a system alert:   - (void)acknowledgeSystemAlert;
    

    擴展:我們還可以對 KIFUITestActor 類進行擴展,利用 KIFUITestActor 中的私有函數,使 AccessibilityIdentifier 代替 Label 識別元素,完成 tapThisView 、waitForView 等操作。

    • 用例集操作( KIFTestCase.h 中可查閱):
        - (void)beforeAll; 在本類中第一個 test case執行前執行一次
            用處:執行本類中各個測試函數的公共操作
            注意:因為不能保證這個方法與 test case 是同一個類實例,所以不能用來設置實例變量的值,但是可以設置靜態變量 
        - (void)beforeEach; 在每一個 test case 執行前執行一次
            用處:執行各個函數需要的測試環境
            注意:因為確保這個方法與 test case 是同一個類實例,所以可以用來設置實例變量
        - (void)afterEach; 在每一個 test case執行后執行一次
            用處:用來將 App 恢復至 test case 之前的狀態,可以包含一些條件判斷邏輯,從失敗的 test case 中恢復,以確保不影響之后的測試
        - (void)afterAll; 執行完測試類的最后一個 test case 后執行一次
            用處:用于將 App 恢復至測試的初始狀態
    
    • 系統的功能實現( KIFSystemTestActor.h 中可查閱):

      原文轉自:https://zhuanlan.zhihu.com/p/22283843

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>