123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- //
- // AutoTestProtocal.swift
- // KdanAuto
- //
- // Created by 朱东勇 on 2022/11/22.
- //
- import Foundation
- enum AutoTestStatus : Int {
-
- case Normal = 0
-
- case Wait = 1
-
- case Process = 2
-
- case Finished = 3
-
- }
- protocol AutoTestProtocal : NSObjectProtocol {
- // 类型关键字
- func fileType() -> String // PPT/RTF/EXCEL/Word/....
- func type() -> String
- func name() -> String
- func extention() -> String
- func params() -> NSDictionary
-
- func keys() -> NSArray
- func selectedKeys() -> NSArray
-
- func setSelectedKeys(_ keys:NSArray)
- // 是否勾选了快照测试
- func needCompareTest() -> Bool
- func needTest() -> Bool
-
- // func autoTest()
- func autoTest(_ complention:@escaping (_ object:AutoTest, _ report:NSAttributedString?) -> ())
-
- func testReport() -> NSAttributedString?
- // func testReportOfFile(_ fileName:String) -> NSAttributedString?
-
- /** Default is 0.0, The range of value is [0, 1]
- */
- func degree() -> Double
- func degreeOfFile(_ fileName:String) -> Double
- func degreeOfFile(_ fileName:String, refFilePath:String?) -> Double
-
- func compareFiles() -> NSArray?
- func compareFiles(_ fileName: String) -> NSArray?
-
-
- /**
- Replace the refrence image for next image check test
- */
- func canUpdateRefImage() -> Bool
- func updateRefImage()
- func canUpdateRefImage(_ fileName:String) -> Bool
- func updateRefImage(_ fileName:String)
-
- var testlog : (_ msg:String, _ progress:Double) -> () { get }
-
- func status() -> AutoTestStatus
- }
|