Jelajahi Sumber

Demo - 自动化测试结构调整,兼容目前快照只能取第一页图片情况方案

zhudongyong 2 tahun lalu
induk
melakukan
a22a57da3c
28 mengubah file dengan 954 tambahan dan 328 penghapusan
  1. 52 8
      KdanAutoTest/KdanAuto.xcodeproj/project.pbxproj
  2. 5 0
      KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/IDEFindNavigatorScopes.plist
  3. TEMPAT SAMPAH
      KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/UserInterfaceState.xcuserstate
  4. 21 5
      KdanAutoTest/KdanAuto.xcodeproj/xcuserdata/zhudongyong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  5. 1 0
      KdanAutoTest/KdanAuto/AppDelegate.swift
  6. 62 63
      KdanAutoTest/KdanAuto/Base.lproj/Main.storyboard
  7. 37 28
      KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTest.swift
  8. 150 0
      KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestProperty.plist
  9. 2 0
      KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestProtocal.swift
  10. 106 0
      KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestTypes.swift
  11. 9 9
      KdanAutoTest/KdanAuto/Class/AutoTestCase/ChineseStringAutoTest.swift
  12. 1 1
      KdanAutoTest/KdanAuto/Class/AutoTestCase/FontAutoTest.swift
  13. 16 0
      KdanAutoTest/KdanAuto/Class/AutoTestCase/RTFAutoTest.swift
  14. 2 2
      KdanAutoTest/KdanAuto/Class/AutoTestCase/TextColorAutoTest.swift
  15. 16 0
      KdanAutoTest/KdanAuto/Class/AutoTestCase/WordAutoTest.swift
  16. 36 22
      KdanAutoTest/KdanAuto/Class/DataModel/DataModel.swift
  17. 2 1
      KdanAutoTest/KdanAuto/Class/Norrmal/AutoTestAdvanceSettingView.swift
  18. 87 0
      KdanAutoTest/KdanAuto/Class/Norrmal/Cell/AutoTestCellInfo.swift
  19. 0 0
      KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestCaseCellView.swift
  20. 0 0
      KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestCaseCellView.xib
  21. 65 0
      KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestFileTypeCellView.swift
  22. 37 0
      KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestFileTypeCellView.xib
  23. 63 0
      KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestTypeCellView.swift
  24. 46 0
      KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestTypeCellView.xib
  25. 3 30
      KdanAutoTest/KdanAuto/Class/Setting/SettingViewController.swift
  26. 12 74
      KdanAutoTest/KdanAuto/Class/Setting/SettingViewController.xib
  27. 110 83
      KdanAutoTest/KdanAuto/ViewController.swift
  28. 13 2
      KdanAutoTest/ProcessCheckFile/Process/ProcessThumbnal.swift

+ 52 - 8
KdanAutoTest/KdanAuto.xcodeproj/project.pbxproj

@@ -18,8 +18,6 @@
 		24A6FF4F2930A1E100B34F2E /* FontAutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A6FF4E2930A1E100B34F2E /* FontAutoTest.swift */; };
 		24A6FF512930AC4D00B34F2E /* AutoTestAdvanceSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A6FF502930AC4D00B34F2E /* AutoTestAdvanceSettingView.swift */; };
 		24D70000292B6FD100DAB5EE /* SettingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24D7FFFF292B6FD100DAB5EE /* SettingViewController.xib */; };
-		24D70004292B94BE00DAB5EE /* TestCaseCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D70003292B94BE00DAB5EE /* TestCaseCellView.swift */; };
-		24D70006292B98FD00DAB5EE /* TestCaseCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24D70005292B98FD00DAB5EE /* TestCaseCellView.xib */; };
 		24D70009292D14DA00DAB5EE /* AutoTestProtocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D70008292D14DA00DAB5EE /* AutoTestProtocal.swift */; };
 		24D7000B292D16BB00DAB5EE /* ChineseStringAutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D7000A292D16BB00DAB5EE /* ChineseStringAutoTest.swift */; };
 		24D7FF9B29261A6400DAB5EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D7FF9A29261A6400DAB5EE /* AppDelegate.swift */; };
@@ -39,6 +37,17 @@
 		24D7FFF72926428300DAB5EE /* ProcessFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D7FFF62926428300DAB5EE /* ProcessFont.swift */; };
 		24D7FFFB292B501100DAB5EE /* SettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D7FFFA292B501100DAB5EE /* SettingViewController.swift */; };
 		24D7FFFE292B509000DAB5EE /* DataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D7FFFD292B509000DAB5EE /* DataModel.swift */; };
+		24DCE8A429504430004EBA35 /* AutoTestTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24DCE8A329504430004EBA35 /* AutoTestTypes.swift */; };
+		24DCE8A8295046A5004EBA35 /* TestCaseCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24DCE8A6295046A5004EBA35 /* TestCaseCellView.xib */; };
+		24DCE8A9295046A5004EBA35 /* TestCaseCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24DCE8A7295046A5004EBA35 /* TestCaseCellView.swift */; };
+		24DCE8AC295046E7004EBA35 /* TestFileTypeCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24DCE8AA295046E7004EBA35 /* TestFileTypeCellView.xib */; };
+		24DCE8AD295046E7004EBA35 /* TestFileTypeCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24DCE8AB295046E7004EBA35 /* TestFileTypeCellView.swift */; };
+		24DCE8B0295047D8004EBA35 /* TestTypeCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24DCE8AE295047D8004EBA35 /* TestTypeCellView.xib */; };
+		24DCE8B1295047D8004EBA35 /* TestTypeCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24DCE8AF295047D8004EBA35 /* TestTypeCellView.swift */; };
+		24DCE8B32950543C004EBA35 /* AutoTestCellInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24DCE8B22950543C004EBA35 /* AutoTestCellInfo.swift */; };
+		24DCE8B529506CDE004EBA35 /* AutoTestProperty.plist in Resources */ = {isa = PBXBuildFile; fileRef = 24DCE8B429506CDE004EBA35 /* AutoTestProperty.plist */; };
+		24DCE8B829508806004EBA35 /* RTFAutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24DCE8B729508806004EBA35 /* RTFAutoTest.swift */; };
+		24DCE8BA29508845004EBA35 /* WordAutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24DCE8B929508845004EBA35 /* WordAutoTest.swift */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -84,8 +93,6 @@
 		24A6FF4E2930A1E100B34F2E /* FontAutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontAutoTest.swift; sourceTree = "<group>"; };
 		24A6FF502930AC4D00B34F2E /* AutoTestAdvanceSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoTestAdvanceSettingView.swift; sourceTree = "<group>"; };
 		24D70001292B71FB00DAB5EE /* KdanAutoDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = KdanAutoDebug.entitlements; sourceTree = "<group>"; };
-		24D70003292B94BE00DAB5EE /* TestCaseCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestCaseCellView.swift; sourceTree = "<group>"; };
-		24D70005292B98FD00DAB5EE /* TestCaseCellView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TestCaseCellView.xib; sourceTree = "<group>"; };
 		24D70008292D14DA00DAB5EE /* AutoTestProtocal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoTestProtocal.swift; sourceTree = "<group>"; };
 		24D7000A292D16BB00DAB5EE /* ChineseStringAutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChineseStringAutoTest.swift; sourceTree = "<group>"; };
 		24D7FF9729261A6400DAB5EE /* KdanAuto.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KdanAuto.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -115,6 +122,17 @@
 		24D7FFFA292B501100DAB5EE /* SettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = "<group>"; };
 		24D7FFFD292B509000DAB5EE /* DataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataModel.swift; sourceTree = "<group>"; };
 		24D7FFFF292B6FD100DAB5EE /* SettingViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingViewController.xib; sourceTree = "<group>"; };
+		24DCE8A329504430004EBA35 /* AutoTestTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoTestTypes.swift; sourceTree = "<group>"; };
+		24DCE8A6295046A5004EBA35 /* TestCaseCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TestCaseCellView.xib; sourceTree = "<group>"; };
+		24DCE8A7295046A5004EBA35 /* TestCaseCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestCaseCellView.swift; sourceTree = "<group>"; };
+		24DCE8AA295046E7004EBA35 /* TestFileTypeCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TestFileTypeCellView.xib; sourceTree = "<group>"; };
+		24DCE8AB295046E7004EBA35 /* TestFileTypeCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestFileTypeCellView.swift; sourceTree = "<group>"; };
+		24DCE8AE295047D8004EBA35 /* TestTypeCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TestTypeCellView.xib; sourceTree = "<group>"; };
+		24DCE8AF295047D8004EBA35 /* TestTypeCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestTypeCellView.swift; sourceTree = "<group>"; };
+		24DCE8B22950543C004EBA35 /* AutoTestCellInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoTestCellInfo.swift; sourceTree = "<group>"; };
+		24DCE8B429506CDE004EBA35 /* AutoTestProperty.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = AutoTestProperty.plist; sourceTree = "<group>"; };
+		24DCE8B729508806004EBA35 /* RTFAutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTFAutoTest.swift; sourceTree = "<group>"; };
+		24DCE8B929508845004EBA35 /* WordAutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordAutoTest.swift; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -187,9 +205,8 @@
 		24D70002292B94A100DAB5EE /* Norrmal */ = {
 			isa = PBXGroup;
 			children = (
+				24DCE8A5295046A5004EBA35 /* Cell */,
 				243DACD12940C6CE008A8AA6 /* ActivityView */,
-				24D70003292B94BE00DAB5EE /* TestCaseCellView.swift */,
-				24D70005292B98FD00DAB5EE /* TestCaseCellView.xib */,
 				24A6FF502930AC4D00B34F2E /* AutoTestAdvanceSettingView.swift */,
 			);
 			path = Norrmal;
@@ -198,8 +215,12 @@
 		24D70007292D141A00DAB5EE /* AutoTestCase */ = {
 			isa = PBXGroup;
 			children = (
+				24DCE8B429506CDE004EBA35 /* AutoTestProperty.plist */,
+				24DCE8A329504430004EBA35 /* AutoTestTypes.swift */,
 				24D70008292D14DA00DAB5EE /* AutoTestProtocal.swift */,
 				24A6FF48293091E000B34F2E /* AutoTest.swift */,
+				24DCE8B729508806004EBA35 /* RTFAutoTest.swift */,
+				24DCE8B929508845004EBA35 /* WordAutoTest.swift */,
 				24D7000A292D16BB00DAB5EE /* ChineseStringAutoTest.swift */,
 				24A6FF4A2930939D00B34F2E /* TextColorAutoTest.swift */,
 				24A6FF4C2930988F00B34F2E /* SpecialCharacterAutoTest.swift */,
@@ -335,6 +356,20 @@
 			path = DataModel;
 			sourceTree = "<group>";
 		};
+		24DCE8A5295046A5004EBA35 /* Cell */ = {
+			isa = PBXGroup;
+			children = (
+				24DCE8AF295047D8004EBA35 /* TestTypeCellView.swift */,
+				24DCE8AE295047D8004EBA35 /* TestTypeCellView.xib */,
+				24DCE8AB295046E7004EBA35 /* TestFileTypeCellView.swift */,
+				24DCE8AA295046E7004EBA35 /* TestFileTypeCellView.xib */,
+				24DCE8A6295046A5004EBA35 /* TestCaseCellView.xib */,
+				24DCE8A7295046A5004EBA35 /* TestCaseCellView.swift */,
+				24DCE8B22950543C004EBA35 /* AutoTestCellInfo.swift */,
+			);
+			path = Cell;
+			sourceTree = "<group>";
+		};
 		24E4FD43293462F0008BA2EC /* Third Part Library */ = {
 			isa = PBXGroup;
 			children = (
@@ -513,10 +548,13 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				24DCE8A8295046A5004EBA35 /* TestCaseCellView.xib in Resources */,
 				24D7FF9F29261A6600DAB5EE /* Assets.xcassets in Resources */,
-				24D70006292B98FD00DAB5EE /* TestCaseCellView.xib in Resources */,
+				24DCE8B529506CDE004EBA35 /* AutoTestProperty.plist in Resources */,
 				24D70000292B6FD100DAB5EE /* SettingViewController.xib in Resources */,
 				24D7FFA229261A6600DAB5EE /* Main.storyboard in Resources */,
+				24DCE8B0295047D8004EBA35 /* TestTypeCellView.xib in Resources */,
+				24DCE8AC295046E7004EBA35 /* TestFileTypeCellView.xib in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -565,17 +603,23 @@
 			buildActionMask = 2147483647;
 			files = (
 				24D70009292D14DA00DAB5EE /* AutoTestProtocal.swift in Sources */,
-				24D70004292B94BE00DAB5EE /* TestCaseCellView.swift in Sources */,
 				24A6FF4D2930988F00B34F2E /* SpecialCharacterAutoTest.swift in Sources */,
 				24A6FF4F2930A1E100B34F2E /* FontAutoTest.swift in Sources */,
 				24A6FF49293091E000B34F2E /* AutoTest.swift in Sources */,
 				24D7FF9D29261A6400DAB5EE /* ViewController.swift in Sources */,
 				24A6FF512930AC4D00B34F2E /* AutoTestAdvanceSettingView.swift in Sources */,
+				24DCE8AD295046E7004EBA35 /* TestFileTypeCellView.swift in Sources */,
 				24D7FFFE292B509000DAB5EE /* DataModel.swift in Sources */,
 				24D7FF9B29261A6400DAB5EE /* AppDelegate.swift in Sources */,
 				243DACD32940C6E8008A8AA6 /* ActivityView.swift in Sources */,
 				24D7000B292D16BB00DAB5EE /* ChineseStringAutoTest.swift in Sources */,
+				24DCE8A9295046A5004EBA35 /* TestCaseCellView.swift in Sources */,
 				24D7FFFB292B501100DAB5EE /* SettingViewController.swift in Sources */,
+				24DCE8B829508806004EBA35 /* RTFAutoTest.swift in Sources */,
+				24DCE8A429504430004EBA35 /* AutoTestTypes.swift in Sources */,
+				24DCE8B32950543C004EBA35 /* AutoTestCellInfo.swift in Sources */,
+				24DCE8BA29508845004EBA35 /* WordAutoTest.swift in Sources */,
+				24DCE8B1295047D8004EBA35 /* TestTypeCellView.swift in Sources */,
 				24A6FF4B2930939D00B34F2E /* TextColorAutoTest.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

+ 5 - 0
KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/IDEFindNavigatorScopes.plist

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<array/>
+</plist>

TEMPAT SAMPAH
KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/UserInterfaceState.xcuserstate


+ 21 - 5
KdanAutoTest/KdanAuto.xcodeproj/xcuserdata/zhudongyong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -14,8 +14,8 @@
             filePath = "KdanAuto/Class/AutoTestCase/AutoTest.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "158"
-            endingLineNumber = "158"
+            startingLineNumber = "167"
+            endingLineNumber = "167"
             landmarkName = "stringToImage(_:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -110,9 +110,9 @@
             filePath = "KdanAuto/ViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "149"
-            endingLineNumber = "149"
-            landmarkName = "tableView(_:mouseDownInHeaderOf:)"
+            startingLineNumber = "166"
+            endingLineNumber = "166"
+            landmarkName = "tableView(_:shouldSelect:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -148,5 +148,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "B54E22B4-6E30-41B2-B5D8-90862655E3C6"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KdanAuto/Class/AutoTestCase/AutoTest.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "30"
+            endingLineNumber = "30"
+            landmarkName = "autoTestFor(_:type:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 1 - 0
KdanAutoTest/KdanAuto/AppDelegate.swift

@@ -15,6 +15,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
 
     func applicationDidFinishLaunching(_ aNotification: Notification) {
         // Insert code here to initialize your application
+        
     }
 
     func applicationWillTerminate(_ aNotification: Notification) {

+ 62 - 63
KdanAutoTest/KdanAuto/Base.lproj/Main.storyboard

@@ -713,40 +713,81 @@
                                 <rect key="frame" x="20" y="71" width="760" height="509"/>
                                 <autoresizingMask key="autoresizingMask"/>
                                 <subviews>
-                                    <scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="24" horizontalPageScroll="10" verticalLineScroll="24" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" usesPredominantAxisScrolling="NO" findBarPosition="aboveHorizontalRuler" translatesAutoresizingMaskIntoConstraints="NO" id="sqY-Gh-ndK">
-                                        <rect key="frame" x="0.0" y="0.0" width="225" height="509"/>
+                                    <customView id="Kjq-VU-WrU" customClass="AutoTestAdvanceSettingView" customModule="KdanAuto" customModuleProvider="target">
+                                        <rect key="frame" x="240" y="0.0" width="520" height="509"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                        <subviews>
+                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="97D-lF-aBw">
+                                                <rect key="frame" x="18" y="459" width="484" height="30"/>
+                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="left" placeholderString="Auto Test Case Title" id="av6-gu-OJW">
+                                                    <font key="font" metaFont="systemMedium" size="16"/>
+                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                </textFieldCell>
+                                            </textField>
+                                            <scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AmP-9q-6TA">
+                                                <rect key="frame" x="40" y="36" width="475" height="415"/>
+                                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                                                <clipView key="contentView" drawsBackground="NO" id="n3n-SJ-Ypz">
+                                                    <rect key="frame" x="0.0" y="0.0" width="475" height="415"/>
+                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                    <subviews>
+                                                        <view id="S9g-Wx-VNn">
+                                                            <rect key="frame" x="0.0" y="0.0" width="460" height="400"/>
+                                                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                                                        </view>
+                                                    </subviews>
+                                                </clipView>
+                                                <scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="Piq-J5-Npt">
+                                                    <rect key="frame" x="0.0" y="399" width="475" height="16"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
+                                                </scroller>
+                                                <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="RDM-Fo-oeX">
+                                                    <rect key="frame" x="459" y="0.0" width="16" height="415"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
+                                                </scroller>
+                                            </scrollView>
+                                        </subviews>
+                                        <connections>
+                                            <outlet property="_keyContentView" destination="S9g-Wx-VNn" id="Ns7-LW-Z1T"/>
+                                            <outlet property="_keyScrollView" destination="AmP-9q-6TA" id="ynY-Qs-1DP"/>
+                                            <outlet property="_titleLbl" destination="97D-lF-aBw" id="IzQ-1i-sEY"/>
+                                        </connections>
+                                    </customView>
+                                    <scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="24" horizontalPageScroll="10" verticalLineScroll="24" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vbh-MI-nC2">
+                                        <rect key="frame" x="0.0" y="0.0" width="241" height="509"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
-                                        <clipView key="contentView" drawsBackground="NO" id="xER-TF-eBT">
-                                            <rect key="frame" x="1" y="1" width="223" height="507"/>
+                                        <clipView key="contentView" drawsBackground="NO" id="31q-iH-Dv4">
+                                            <rect key="frame" x="0.0" y="0.0" width="241" height="509"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             <subviews>
-                                                <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="24" viewBased="YES" id="HVp-oR-9bT">
-                                                    <rect key="frame" x="0.0" y="0.0" width="223" height="507"/>
+                                                <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="24" rowSizeStyle="automatic" viewBased="YES" id="4NA-ss-yPX">
+                                                    <rect key="frame" x="0.0" y="0.0" width="241" height="509"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                    <size key="intercellSpacing" width="17" height="0.0"/>
                                                     <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                     <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
                                                     <tableColumns>
-                                                        <tableColumn identifier="AutomaticTableColumnIdentifier.0" width="211" minWidth="40" maxWidth="1000" id="eTX-MY-jWX">
+                                                        <tableColumn identifier="AutomaticTableColumnIdentifier.0" width="209" minWidth="40" maxWidth="1000" id="tTn-qb-QPH">
                                                             <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
                                                                 <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
                                                                 <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
                                                             </tableHeaderCell>
-                                                            <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="YB1-Xb-ayM">
+                                                            <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="vrE-UE-m0y">
                                                                 <font key="font" metaFont="system"/>
                                                                 <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                                                 <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                             </textFieldCell>
                                                             <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
                                                             <prototypeCellViews>
-                                                                <tableCellView id="Pep-7v-Abt">
-                                                                    <rect key="frame" x="8" y="0.0" width="206" height="24"/>
+                                                                <tableCellView id="61W-tC-cHP">
+                                                                    <rect key="frame" x="10" y="0.0" width="221" height="24"/>
                                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                                     <subviews>
-                                                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ocT-ML-Xzz">
-                                                                            <rect key="frame" x="0.0" y="4" width="206" height="16"/>
+                                                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qTx-Jq-OYX">
+                                                                            <rect key="frame" x="0.0" y="4" width="221" height="16"/>
                                                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
-                                                                            <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="d0r-4O-bDh">
+                                                                            <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="tC6-ue-LUg">
                                                                                 <font key="font" usesAppearanceFont="YES"/>
                                                                                 <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -754,71 +795,29 @@
                                                                         </textField>
                                                                     </subviews>
                                                                     <connections>
-                                                                        <outlet property="textField" destination="ocT-ML-Xzz" id="NG5-K9-CYb"/>
+                                                                        <outlet property="textField" destination="qTx-Jq-OYX" id="Jx2-Sq-wCl"/>
                                                                     </connections>
                                                                 </tableCellView>
                                                             </prototypeCellViews>
                                                         </tableColumn>
                                                     </tableColumns>
                                                     <connections>
-                                                        <outlet property="dataSource" destination="XfG-lQ-9wD" id="7pn-2Y-KRj"/>
-                                                        <outlet property="delegate" destination="XfG-lQ-9wD" id="vK5-oj-3A7"/>
+                                                        <outlet property="dataSource" destination="XfG-lQ-9wD" id="GM1-px-wZH"/>
+                                                        <outlet property="delegate" destination="XfG-lQ-9wD" id="vhT-bG-Gsh"/>
                                                     </connections>
                                                 </tableView>
                                             </subviews>
                                             <nil key="backgroundColor"/>
                                         </clipView>
-                                        <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="P2T-5L-Z7v">
-                                            <rect key="frame" x="-100" y="-100" width="160" height="16"/>
+                                        <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="mga-yI-f6V">
+                                            <rect key="frame" x="-100" y="-100" width="141" height="16"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                         </scroller>
-                                        <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="Pd0-Hi-vO3">
+                                        <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="uuz-kg-J2X">
                                             <rect key="frame" x="-100" y="-100" width="15" height="102"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                         </scroller>
                                     </scrollView>
-                                    <customView id="Kjq-VU-WrU" customClass="AutoTestAdvanceSettingView" customModule="KdanAuto" customModuleProvider="target">
-                                        <rect key="frame" x="225" y="0.0" width="535" height="509"/>
-                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        <subviews>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="97D-lF-aBw">
-                                                <rect key="frame" x="18" y="459" width="499" height="30"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
-                                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="left" placeholderString="Auto Test Case Title" id="av6-gu-OJW">
-                                                    <font key="font" metaFont="systemMedium" size="16"/>
-                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                </textFieldCell>
-                                            </textField>
-                                            <scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AmP-9q-6TA">
-                                                <rect key="frame" x="40" y="36" width="475" height="415"/>
-                                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                                <clipView key="contentView" drawsBackground="NO" id="n3n-SJ-Ypz">
-                                                    <rect key="frame" x="0.0" y="0.0" width="475" height="415"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                    <subviews>
-                                                        <view id="S9g-Wx-VNn">
-                                                            <rect key="frame" x="0.0" y="0.0" width="460" height="400"/>
-                                                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                                        </view>
-                                                    </subviews>
-                                                </clipView>
-                                                <scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="Piq-J5-Npt">
-                                                    <rect key="frame" x="0.0" y="399" width="475" height="16"/>
-                                                    <autoresizingMask key="autoresizingMask"/>
-                                                </scroller>
-                                                <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="RDM-Fo-oeX">
-                                                    <rect key="frame" x="459" y="0.0" width="16" height="415"/>
-                                                    <autoresizingMask key="autoresizingMask"/>
-                                                </scroller>
-                                            </scrollView>
-                                        </subviews>
-                                        <connections>
-                                            <outlet property="_keyContentView" destination="S9g-Wx-VNn" id="Ns7-LW-Z1T"/>
-                                            <outlet property="_keyScrollView" destination="AmP-9q-6TA" id="ynY-Qs-1DP"/>
-                                            <outlet property="_titleLbl" destination="97D-lF-aBw" id="IzQ-1i-sEY"/>
-                                        </connections>
-                                    </customView>
                                 </subviews>
                             </customView>
                             <button verticalHuggingPriority="750" id="CUw-Wo-mUO">
@@ -847,7 +846,7 @@
                     </view>
                     <connections>
                         <outlet property="advanceView" destination="Kjq-VU-WrU" id="ecC-8J-SWn"/>
-                        <outlet property="itemsList" destination="HVp-oR-9bT" id="8tC-Xh-0KM"/>
+                        <outlet property="itemsList" destination="4NA-ss-yPX" id="uIe-KN-SjY"/>
                         <outlet property="startBtn" destination="CUw-Wo-mUO" id="mGh-eH-Fbj"/>
                     </connections>
                 </viewController>

+ 37 - 28
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTest.swift

@@ -8,32 +8,38 @@
 import Foundation
 import AppKit
 
-let testCaseNames = [
-    "PDFConvert_Font_Auto_Test",
-    "PDFConvert_Color_Auto_Test",
-    "PDFConvert_China_Auto_Test",
-    "PDFConvert_SpecialCharacter_Auto_Test",
-//    "PDFConvert_English_Auto_Test"
-]
-
 class AutoTest : NSObject, AutoTestProtocal {
     var reportString : NSMutableAttributedString? = nil
     
     public var _status :  AutoTestStatus = .Normal
     
-    class func autoTestForType(_ type:NSString) -> AutoTest? {
-        
-        if type.isEqual(to: "PDFConvert_Font_Auto_Test") {
-            return FontAutoTest.shared()
-        }else if type.isEqual(to: "PDFConvert_China_Auto_Test") {
-            return ChineseStringAutoTest.shared()
-        }else if type.isEqual(to: "PDFConvert_Color_Auto_Test") {
-            return TextColorAutoTest.shared()
-        }else if type.isEqual(to: "PDFConvert_SpecialCharacter_Auto_Test") {
-            return SpecialCharacterAutoTest.shared()
+    var _fileType : String = "RTF"
+    
+    class func autoTestFor(_ fileType:NSString ,type:NSString) -> AutoTest? {
+        let fileTypes = testTypeInfo[fileType] as! NSArray
+       
+        let clsname = "KdanAuto"//Bundle.main.infoDictionary! ["CFBundleExecutable"]
+    
+        for item in fileTypes {
+            let cItem = item as! NSDictionary
+            
+            let cType = cItem["Type"] as! NSString
+            if (cType.isEqual(to: type)) {
+                let className = String((clsname )+"."+(cItem["Class"] as! String)) as! String
+                let cl = NSClassFromString(className) as! AutoTest.Type
+                
+                let object = cl.shared()
+                object?._fileType = fileType as! String
+                
+                return object
+            }
         }
         
-        return nil
+        let object = AutoTest.shared()
+        
+        object?._fileType = fileType as String
+        
+        return object
     }
     
     static var sharedInstance = AutoTest()
@@ -41,23 +47,26 @@ class AutoTest : NSObject, AutoTestProtocal {
         return sharedInstance
     }
     
+    func fileType() -> String {
+        return _fileType
+    }
+    
     func type() -> String {
-        return "Base_Auto_Test"
+        return "Others"
     }
     
     func name() -> String {
-        return "基础测试基类"
+        return "未指定类型对照测试"
     }
     
-    
     func keys() -> NSArray {
-        return []
+        return ["快照对比"]
     }
     
     func selectedKeys() -> NSArray {
         let userDefaults = UserDefaults.standard
         
-        let key = self.type() + ".selectedKeys"
+        let key = self.fileType() + "." + self.type() + ".selectedKeys"
         
         if userDefaults.value(forKey: key) != nil {
             return userDefaults.value(forKey: key) as! NSArray
@@ -71,7 +80,7 @@ class AutoTest : NSObject, AutoTestProtocal {
     func setSelectedKeys(_ keys: NSArray) {
         let userDefaults = UserDefaults.standard
         
-        let key = self.type() + ".selectedKeys"
+        let key = self.fileType() + "." + self.type() + ".selectedKeys"
         
         userDefaults.setValue(keys, forKey: key)
         userDefaults.synchronize()
@@ -101,15 +110,15 @@ class AutoTest : NSObject, AutoTestProtocal {
     
     /// Path
     func originFilePath() -> String {
-        return DataModel.shared.originPath().appendingFormat("/\(self.type()).pdf")
+        return DataModel.shared.directoryPath().appendingFormat("/\(self.fileType())/\(self.type())/\(kOriginPathComponent)")
     }
     
     func resultFilePath() -> String {
-        return DataModel.shared.resultPath().appendingFormat("/\(self.type()).rtf")
+        return DataModel.shared.directoryPath().appendingFormat("/\(self.fileType())/\(self.type())/\(kResultPathComponent)")
     }
     
     func checkFilePath() -> String {
-        return DataModel.shared.checkPath().appendingFormat("/\(self.type()).rtf")
+        return DataModel.shared.directoryPath().appendingFormat("/\(self.fileType())/\(self.type())/\(kCheckPathComponent)")
     }
     
     // check File Exist

+ 150 - 0
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestProperty.plist

@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>RTF</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Fonts</string>
+			<key>Class</key>
+			<string>FontAutoTest</string>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>Colors</string>
+			<key>Class</key>
+			<string>TextColorAutoTest</string>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>Characters</string>
+			<key>Class</key>
+			<string>ChineseStringAutoTest</string>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>RTFAutoTest</string>
+		</dict>
+	</array>
+	<key>Word</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>WordAutoTest</string>
+		</dict>
+	</array>
+	<key>PPT</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>Excel</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>CSV</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>HTML</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>TXT</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>JPEG</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>PNG</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>GIF</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>TIFF</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>TGA</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>BMP</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+	<key>JPEG2000</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Class</key>
+			<string>AutoTest</string>
+		</dict>
+	</array>
+</dict>
+</plist>

+ 2 - 0
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestProtocal.swift

@@ -7,6 +7,7 @@
 
 import Foundation
 
+
 enum AutoTestStatus : Int {
     
     case Normal = 0
@@ -21,6 +22,7 @@ enum AutoTestStatus : Int {
 
 protocol AutoTestProtocal : NSObjectProtocol {
     // 类型关键字
+    func fileType() -> String
     func type() -> String
     func name() -> String
     

+ 106 - 0
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestTypes.swift

@@ -0,0 +1,106 @@
+//
+//  AutoTestTypes.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2022/12/19.
+//
+
+import Foundation
+
+// all support output file types
+var testFileTypes : [String] = []
+//= [
+//    "Word",
+//    "Excel",
+//    "PPT",
+//    "RTF",
+//    "CSV",
+//    "HTML",
+//    "TXT",
+//    "JPEG",
+//    "PNG",
+//    "GIF",
+//    "TIFF",
+//    "TGA",
+//    "BMP",
+//    "JPEG2000"
+//]
+
+// all Test type
+var testTypeInfo : NSDictionary = NSDictionary()
+//= [
+//    // Word
+//    "Word":[
+//        "Others"
+//    ],
+//
+//    // Excel
+//    "Excel":[
+//        "Others"
+//    ],
+//
+//    // PPT
+//    "PPT":[
+//        "Others"
+//    ],
+//
+//    // RTF
+//    "RTF":[
+//        "Fonts",
+//        "Colors",
+//        "Characters",
+//
+//        "Others",
+//    ],
+//
+//    // CSV
+//    "CSV":[
+//        "Others"
+//    ],
+//
+//    // HTML
+//    "HTML":[
+//        "Others"
+//    ],
+//
+//    //TXT
+//    "TXT":[
+//        "Others"
+//    ],
+//
+//    //JPEG
+//    "JPEG":[
+//        "Others"
+//    ],
+//
+//    // PNG
+//    "PNG":[
+//        "Others"
+//    ],
+//
+//    //GIF
+//    "GIF":[
+//        "Others"
+//    ],
+//
+//    //TIFF
+//    "TIFF":[
+//        "Others"
+//    ],
+//
+//    //TGA
+//    "TGA":[
+//        "Others"
+//    ],
+//
+//    //BMP
+//    "BMP":[
+//        "Others"
+//    ],
+//
+//    //JPEG2000
+//    "JPEG2000":[
+//        "Others"
+//    ],
+//
+//]

+ 9 - 9
KdanAutoTest/KdanAuto/Class/AutoTestCase/ChineseStringAutoTest.swift

@@ -19,7 +19,7 @@ class ChineseStringAutoTest : AutoTest {
     }
     
     override func keys() -> NSArray {
-        return ["字符对比", "前一版对比"]
+        return ["字符对比", "快照对比"]
     }
     
     static var cSharedInstance = ChineseStringAutoTest()
@@ -33,7 +33,7 @@ class ChineseStringAutoTest : AutoTest {
         _status = .Process
         
         let checkString = self.selectedKeys().contains("字符对比")
-        let needCompare = self.selectedKeys().contains("前一版对比")
+        let needCompare = self.selectedKeys().contains("快照对比")
         
         if !needCompare && !checkString {
             return
@@ -113,13 +113,13 @@ class ChineseStringAutoTest : AutoTest {
                 resultStr = resultStr.replacingOccurrences(of: "\\pard", with: "") as NSString
                 resultStr = resultStr.replacingOccurrences(of: "\\par", with: "") as NSString
                 
-                do { // save cache file for test
-                    try? NSString(string: resultStr).write(toFile: NSString(string: DataModel.shared.resultPath()).appending("/\(self.name())-result-cache.txt"),
-                                                      atomically: true, encoding: NSUTF8StringEncoding)
-                    
-                    try? NSString(string: checkString).write(toFile: NSString(string: DataModel.shared.resultPath()).appending("/\(self.name())-check-cache.txt"),
-                                                          atomically: true, encoding: NSUTF8StringEncoding)
-                }
+//                do { // save cache file for test
+//                    try? NSString(string: resultStr).write(toFile: NSString(string: DataModel.shared.resultPath()).appending("/\(self.name())-result-cache.txt"),
+//                                                      atomically: true, encoding: NSUTF8StringEncoding)
+//                    
+//                    try? NSString(string: checkString).write(toFile: NSString(string: DataModel.shared.resultPath()).appending("/\(self.name())-check-cache.txt"),
+//                                                          atomically: true, encoding: NSUTF8StringEncoding)
+//                }
                 
                 let maxSize = checkString.length
                 var successCount = 0;

+ 1 - 1
KdanAutoTest/KdanAuto/Class/AutoTestCase/FontAutoTest.swift

@@ -18,7 +18,7 @@ class FontAutoTest : AutoTest {
     }
     
     override func keys() -> NSArray {
-        return ["字体名称", "字体大小", "字体样式", "前一版对比"]
+        return ["字体名称", "字体大小", "字体样式", "快照对比"]
     }
     
     static var fSharedInstance = FontAutoTest()

+ 16 - 0
KdanAutoTest/KdanAuto/Class/AutoTestCase/RTFAutoTest.swift

@@ -0,0 +1,16 @@
+//
+//  RTFAutoTest.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2022/12/19.
+//
+
+import Foundation
+
+class RTFAutoTest : AutoTest {
+    
+    override func fileType() -> String {
+        return "RTF"
+    }
+    
+}

+ 2 - 2
KdanAutoTest/KdanAuto/Class/AutoTestCase/TextColorAutoTest.swift

@@ -19,7 +19,7 @@ class TextColorAutoTest : AutoTest {
     }
     
     override func keys() -> NSArray {
-        return ["RGB", "透明度", "前一版对比"]
+        return ["RGB", "透明度", "快照对比"]
     }
     
     static var tcSharedInstance = TextColorAutoTest()
@@ -43,7 +43,7 @@ class TextColorAutoTest : AutoTest {
             
             let checkRGB = self.selectedKeys().contains("RGB")
             let checkAlpha = self.selectedKeys().contains("透明度")
-            let needCompare = self.selectedKeys().contains("前一版对比")
+            let needCompare = self.selectedKeys().contains("快照对比")
             
             var maxCount = 0;
             var succCount = 0;

+ 16 - 0
KdanAutoTest/KdanAuto/Class/AutoTestCase/WordAutoTest.swift

@@ -0,0 +1,16 @@
+//
+//  WordAutoTest.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2022/12/19.
+//
+
+import Foundation
+
+class WordAutoTest : AutoTest {
+    
+    override func fileType() -> String {
+        return "Word"
+    }
+    
+}

+ 36 - 22
KdanAutoTest/KdanAuto/Class/DataModel/DataModel.swift

@@ -7,50 +7,64 @@
 
 import Foundation
 
-var kLoadOriginDirectoryPathKey : String   = "kLoadOriginDirectoryPathKey";
-var kLoadResultDirectoryPathKey : String    = "kLoadResultDirectoryPathKey";
-var kLoadCheckDirectoryPathKey : String    = "kLoadCheckDirectoryPathKey";
+let kLoadDirectoryPathKey : String   = "kLoadDirectoryPathKey";
+
+let kOriginPathComponent : String = "Origin Files"
+let kResultPathComponent : String = "Result Files"
+let kCheckPathComponent : String = "Check Files"
     
 class DataModel : NSObject {
     static var shared : DataModel = DataModel()
     
-    var _originPath : String = ""
-    var _checkPath : String = ""
-    var _resultPath : String = ""
+    var _directoryPath : String = ""
     
     /// Setter & Getter
     
-    public func setOriginPath(_ path:String) {
+    public func setDirectoryPath(_ path:String) {
         let userDefaults = UserDefaults.standard
-        userDefaults.setValue(path, forKey: kLoadOriginDirectoryPathKey)
+        userDefaults.setValue(path, forKey: kLoadDirectoryPathKey)
         userDefaults.synchronize()
     }
     
-    public func originPath() -> String {
-        return UserDefaults.standard.value(forKey: kLoadOriginDirectoryPathKey) as! String
+    public func directoryPath() -> String {
+        var path = UserDefaults.standard.value(forKey: kLoadDirectoryPathKey)
+        
+        if path == nil {
+            path = ""
+        }
+        
+        return path as! String
     }
     
-    public func setResultPath(_ path:String) {
-        let userDefaults = UserDefaults.standard
-        userDefaults.setValue(path, forKey: kLoadResultDirectoryPathKey)
-        userDefaults.synchronize()
-    }
     
-    public func resultPath() -> String {
-        return UserDefaults.standard.value(forKey: kLoadResultDirectoryPathKey) as! String
-    }
     
-    public func setCheckPath(_ path:String) {
+    // Expand
+    public func setIsExpand(_ fileType:String, expand:Bool) {
         let userDefaults = UserDefaults.standard
-        userDefaults.setValue(path, forKey: kLoadCheckDirectoryPathKey)
+        if expand {
+            userDefaults.setValue("true", forKey: String("\(fileType)-expand"))
+        }else {
+            userDefaults.setValue(nil, forKey: String("\(fileType)-expand"))
+        }
         userDefaults.synchronize()
     }
     
-    public func checkPath() -> String {
-        return UserDefaults.standard.value(forKey: kLoadCheckDirectoryPathKey) as! String
+    public func isExpand(_ fileType:String) -> Bool {
+        let userDefaults = UserDefaults.standard
+        
+        return userDefaults.value(forKey: String("\(fileType)-expand")) != nil
     }
     
     
+    public func originFilesFor(_ fileType:String, type:String) -> [String] {
+        var path = self.directoryPath() as NSString
+        path = path.appendingPathComponent(fileType) as NSString
+        path = path.appendingPathComponent(type) as NSString
+        path = path.appendingPathComponent(kOriginPathComponent) as NSString
+        
+        return FileManager.default.subpaths(atPath: path as String) ?? []
+    }
+    
     /// Save Data
     
 }

+ 2 - 1
KdanAutoTest/KdanAuto/Class/Norrmal/AutoTestAdvanceSettingView.swift

@@ -36,10 +36,10 @@ class AutoTestAdvanceSettingView : NSView {
         _autoTestObj = obj;
         
         // Set Title
-        _titleLbl.stringValue = (_autoTestObj?.name()) ?? ""
         self.setAccessibilityEnabled((_autoTestObj?.isOriginFileExist() == true && _autoTestObj?.isCheckFileExist() == true))
         
         if nil != _autoTestObj {
+            _titleLbl.stringValue = String("[\(_autoTestObj?.fileType() as! String)]\(_autoTestObj?.name() as! String)")
             let checkKeys = _autoTestObj?.keys() as! NSArray
             let selectKeys = _autoTestObj?.selectedKeys() as! NSArray
             
@@ -91,6 +91,7 @@ class AutoTestAdvanceSettingView : NSView {
             
             _keyScrollView.documentView = _keyContentView;
         }else {
+            _titleLbl.stringValue = ""
             if _keyViews == nil {
                 _keyViews = NSMutableArray()
             }

+ 87 - 0
KdanAutoTest/KdanAuto/Class/Norrmal/Cell/AutoTestCellInfo.swift

@@ -0,0 +1,87 @@
+//
+//  AutoTestCellInfo.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2022/12/19.
+//
+
+import Foundation
+
+class AutoTestCellInfo : NSObject {
+    var _isFileType : Bool! = false
+    var _fileType:String = ""
+    
+    var _isType : Bool! = false
+    var _typeInfo: NSDictionary = NSDictionary()
+    
+    
+    class func initWithRow(_ row:Int) -> AutoTestCellInfo {
+        var cellInfo = AutoTestCellInfo()
+
+        var index = 0
+
+        for fileType in testFileTypes {
+            // 当前行是否为 文件类型行
+            if ((row - index) == 0) {
+                cellInfo.setFileType(fileType)
+                cellInfo.setIsFileType(true)
+
+                return cellInfo
+            }
+            index = index + 1;
+            
+            //当前文件类型是否为展开
+            if (DataModel.shared.isExpand(fileType)) {
+                let testTypes = testTypeInfo[fileType] as! NSArray
+
+                if (row - index < testTypes.count) {
+
+                    let typeInfo = testTypes[row - index] as! NSDictionary
+                    
+                    cellInfo.setFileType(fileType)
+                    cellInfo.setTypeInfo(typeInfo)
+                    cellInfo.setIsType(true)
+
+                    return cellInfo
+                }
+                index = index + testTypes.count
+            }
+        }
+        
+        return cellInfo
+    }
+    
+    /// Setter & Getter
+    func isFileType() -> Bool {
+        return _isFileType
+    }
+    
+    private func setIsFileType(_ isFileType:Bool) {
+        _isFileType = isFileType
+    }
+    
+    func fileType() -> String {
+        return _fileType
+    }
+    
+    private func setFileType(_ fileType:String) {
+        _fileType = fileType
+    }
+    
+    func isType() -> Bool {
+        return _isType
+    }
+    
+    private func setIsType(_ isType:Bool) {
+        _isType = isType
+    }
+    
+    func typeInfo() -> NSDictionary {
+        return _typeInfo
+    }
+    
+    private func setTypeInfo(_ typeInfo:NSDictionary) {
+        _typeInfo = typeInfo
+    }
+    
+}

KdanAutoTest/KdanAuto/Class/Norrmal/TestCaseCellView.swift → KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestCaseCellView.swift


KdanAutoTest/KdanAuto/Class/Norrmal/TestCaseCellView.xib → KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestCaseCellView.xib


+ 65 - 0
KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestFileTypeCellView.swift

@@ -0,0 +1,65 @@
+//
+//  TeseCaseCell.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2022/11/21.
+//
+
+import Foundation
+import AppKit
+
+class TestFileTypeCellView : NSTableCellView {
+    @IBOutlet var _titleLbl : NSTextField!
+    @IBOutlet var _sepLine : NSView!
+    
+    var _title : String!
+    var _isExpad: Bool!
+    
+    class func shared() -> TestFileTypeCellView? {
+        var objects : NSArray!
+        
+        Bundle.main.loadNibNamed("TestFileTypeCellView", owner: nil, topLevelObjects: &objects)
+        
+        for tView in objects {
+            if let tv = tView as? TestFileTypeCellView {
+                return tv
+            }
+        }
+        
+        return nil
+    }
+    
+    class func isExpand(_ fileType:String) -> Bool {
+        return DataModel.shared.isExpand(fileType)
+    }
+    
+    override func awakeFromNib() {
+        _sepLine.wantsLayer = true;
+        _sepLine.layer?.backgroundColor = NSColor.lightGray.cgColor
+    }
+    
+    // Setter & Getter
+    public func setTitle(_ title:String) {
+        _title = title;
+        
+        _titleLbl.stringValue = _title ?? ""
+    }
+    
+    public func title() -> String? {
+        return _title
+    }
+    
+    public func fileType() -> String? {
+        return _title
+    }
+    
+    public func setIsExpand(_ expand:Bool) {
+        _isExpad = expand
+        
+        
+    }
+    
+    public func isExpand() -> Bool {
+        return _isExpad
+    }
+}

+ 37 - 0
KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestFileTypeCellView.xib

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <tableCellView id="Ob6-j8-aNh" customClass="TestFileTypeCellView" customModule="KdanAuto" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="339" height="31"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EgA-BQ-X23">
+                    <rect key="frame" x="-2" y="10" width="343" height="16"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="4yb-fM-clL">
+                        <font key="font" metaFont="systemBold"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <customView id="Dg0-nG-U3m">
+                    <rect key="frame" x="0.0" y="0.0" width="339" height="1"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                </customView>
+            </subviews>
+            <connections>
+                <outlet property="_sepLine" destination="Dg0-nG-U3m" id="fck-m4-6W4"/>
+                <outlet property="_titleLbl" destination="EgA-BQ-X23" id="Kft-ve-pVP"/>
+                <outlet property="textField" destination="EgA-BQ-X23" id="j2n-kB-6EY"/>
+            </connections>
+            <point key="canvasLocation" x="-494.5" y="93.5"/>
+        </tableCellView>
+    </objects>
+</document>

+ 63 - 0
KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestTypeCellView.swift

@@ -0,0 +1,63 @@
+//
+//  TeseCaseCell.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2022/11/21.
+//
+
+import Foundation
+import AppKit
+
+class TestTypeCellView : NSTableCellView {
+    @IBOutlet var _titleLbl : NSTextField!
+    @IBOutlet var _sepLine : NSView!
+    
+    var _title : String!
+    var _isExpad: Bool!
+    var _typeInfo : NSDictionary!
+    
+    class func shared() -> TestTypeCellView? {
+        var objects : NSArray!
+        
+        Bundle.main.loadNibNamed("TestTypeCellView", owner: nil, topLevelObjects: &objects)
+        
+        for tView in objects {
+            if let tv = tView as? TestTypeCellView {
+                return tv
+            }
+        }
+        
+        return nil
+    }
+    
+    override func awakeFromNib() {
+        _sepLine.wantsLayer = true;
+        _sepLine.layer?.backgroundColor = NSColor.lightGray.cgColor
+    }
+    
+    // Setter & Getter
+    public func setTitle(_ title:String) {
+        _title = title;
+        
+        _titleLbl.stringValue = _title ?? ""
+    }
+    
+    public func title() -> String? {
+        return _title
+    }
+    
+    public func fileType() -> String? {
+        return _title
+    }
+    
+    public func setTypeInfo(_ typeInfo:NSDictionary) {
+        _typeInfo = typeInfo
+        
+        self.setTitle(_typeInfo["Type"] as! String)
+    }
+    
+    public func typeInfo() -> NSDictionary? {
+        return _typeInfo
+    }
+    
+}

+ 46 - 0
KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestTypeCellView.xib

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <tableCellView id="Ob6-j8-aNh" customClass="TestTypeCellView" customModule="KdanAuto" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="339" height="30"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EgA-BQ-X23">
+                    <rect key="frame" x="10" y="9" width="335" height="16"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="4yb-fM-clL">
+                        <font key="font" metaFont="system" size="11"/>
+                        <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <customView id="Dg0-nG-U3m">
+                    <rect key="frame" x="12" y="0.0" width="331" height="1"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                </customView>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="VzC-B0-Ms0">
+                    <rect key="frame" x="318" y="8" width="14" height="19"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" title="&gt;" id="k44-ke-U8H">
+                        <font key="font" metaFont="system" size="15"/>
+                        <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+            </subviews>
+            <connections>
+                <outlet property="_sepLine" destination="Dg0-nG-U3m" id="fck-m4-6W4"/>
+                <outlet property="_titleLbl" destination="EgA-BQ-X23" id="Kft-ve-pVP"/>
+                <outlet property="textField" destination="EgA-BQ-X23" id="j2n-kB-6EY"/>
+            </connections>
+            <point key="canvasLocation" x="-494.5" y="93.5"/>
+        </tableCellView>
+    </objects>
+</document>

+ 3 - 30
KdanAutoTest/KdanAuto/Class/Setting/SettingViewController.swift

@@ -25,12 +25,8 @@ class SettingViewController : NSViewController, NSTextFieldDelegate, NSWindowDel
     public var delegate : SettingViewControllerDelegate!
     
     @IBOutlet var originPathTF : NSTextField!
-    @IBOutlet var resultPathTF : NSTextField!
-    @IBOutlet var checkPathTF : NSTextField!
     
     @IBOutlet var originPathBtn : NSButton!
-    @IBOutlet var resultPathBtn : NSButton!
-    @IBOutlet var checkPathBtn : NSButton!
     
     class func shared() -> SettingViewController {
         if vc == nil {
@@ -47,9 +43,7 @@ class SettingViewController : NSViewController, NSTextFieldDelegate, NSWindowDel
     }
     
     override func viewWillAppear() {
-        self.originPathTF.stringValue = DataModel.shared.originPath();
-        self.checkPathTF.stringValue = DataModel.shared.checkPath();
-        self.resultPathTF.stringValue = DataModel.shared.resultPath();
+        self.originPathTF.stringValue = DataModel.shared.directoryPath() ?? "";
     }
     
     // IBAction
@@ -60,34 +54,13 @@ class SettingViewController : NSViewController, NSTextFieldDelegate, NSWindowDel
         openPanel.canChooseDirectories = true
         
         var pt:PathType = .Origin
-        if (sender == self.checkPathBtn) {
-            pt = .Check
-        }else if sender == self.resultPathBtn {
-            pt = .Result
-        }
         
         
         if openPanel.runModal() == NSApplication.ModalResponse.OK {
             let path = openPanel.directoryURL?.relativePath
             
-            switch (pt)
-            {
-            
-            case .Origin: do {
-                DataModel.shared.setOriginPath(path!);
-                self.originPathTF.stringValue = path!;
-            }
-            case .Check: do {
-                DataModel.shared.setCheckPath(path!);
-                self.checkPathTF.stringValue = path!;
-            }
-            
-            default: do {
-                DataModel.shared.setResultPath(path!);
-                self.resultPathTF.stringValue = path!;
-            }
-            
-            }
+            DataModel.shared.setDirectoryPath(path!);
+            self.originPathTF.stringValue = path!;
         }
         
     }

+ 12 - 74
KdanAutoTest/KdanAuto/Class/Setting/SettingViewController.xib

@@ -7,12 +7,8 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="SettingViewController" customModule="KdanAuto" customModuleProvider="target">
             <connections>
-                <outlet property="checkPathBtn" destination="OIp-Nm-RGf" id="7aK-1x-pWb"/>
-                <outlet property="checkPathTF" destination="aMK-Wf-4Om" id="HBZ-tD-AIr"/>
                 <outlet property="originPathBtn" destination="fOa-Eb-YOX" id="WOD-U8-MZj"/>
                 <outlet property="originPathTF" destination="3hj-Iu-skR" id="XBk-z0-ChP"/>
-                <outlet property="resultPathBtn" destination="4yv-JV-OlT" id="ij1-jZ-qnR"/>
-                <outlet property="resultPathTF" destination="qky-bv-YUg" id="ryG-DY-Guu"/>
                 <outlet property="view" destination="6UO-s2-2gI" id="Anz-wg-Gsp"/>
                 <outlet property="window" destination="Mtt-fY-Y6u" id="ebY-tg-SzD"/>
             </connections>
@@ -22,27 +18,27 @@
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" frameAutosaveName="" animationBehavior="default" id="Mtt-fY-Y6u">
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="196" y="239" width="480" height="270"/>
+            <rect key="contentRect" x="196" y="239" width="479" height="147"/>
             <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1175"/>
             <view key="contentView" id="6UO-s2-2gI">
-                <rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
+                <rect key="frame" x="0.0" y="0.0" width="479" height="147"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view id="oMy-XG-cue">
-                        <rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
-                        <autoresizingMask key="autoresizingMask"/>
+                        <rect key="frame" x="0.0" y="0.0" width="479" height="147"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sGm-pJ-h82">
-                                <rect key="frame" x="18" y="235" width="141" height="22"/>
+                                <rect key="frame" x="18" y="112" width="141" height="22"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                <textFieldCell key="cell" lineBreakMode="clipping" title="文件路径选择:" id="U1q-Rt-Rfs">
+                                <textFieldCell key="cell" lineBreakMode="clipping" title="测试文档路径选择:" id="U1q-Rt-Rfs">
                                     <font key="font" metaFont="systemSemibold" size="13"/>
                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                 </textFieldCell>
                             </textField>
                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QzR-fG-S65">
-                                <rect key="frame" x="36" y="195" width="100" height="16"/>
+                                <rect key="frame" x="36" y="72" width="100" height="16"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="原文档路径:" id="1fO-bs-ZOp">
                                     <font key="font" metaFont="system"/>
@@ -50,54 +46,18 @@
                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                 </textFieldCell>
                             </textField>
-                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="c2u-gi-dVT">
-                                <rect key="frame" x="36" y="135" width="100" height="16"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="存储路径:" id="gXb-qt-5aT">
-                                    <font key="font" metaFont="system"/>
-                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                </textFieldCell>
-                            </textField>
-                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="K58-XQ-Q3L">
-                                <rect key="frame" x="36" y="76" width="100" height="16"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="对比文档路径:" id="k6j-yW-PAb">
-                                    <font key="font" metaFont="system"/>
-                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                </textFieldCell>
-                            </textField>
                             <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3hj-Iu-skR">
-                                <rect key="frame" x="142" y="192" width="274" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                                <rect key="frame" x="142" y="69" width="273" height="21"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
                                 <textFieldCell key="cell" lineBreakMode="truncatingHead" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" baseWritingDirection="leftToRight" alignment="left" drawsBackground="YES" id="jaV-R5-1Pd">
                                     <font key="font" metaFont="system"/>
                                     <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                 </textFieldCell>
                             </textField>
-                            <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qky-bv-YUg">
-                                <rect key="frame" x="142" y="132" width="274" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                <textFieldCell key="cell" lineBreakMode="truncatingHead" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="sQw-Rv-mbu">
-                                    <font key="font" metaFont="system"/>
-                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                </textFieldCell>
-                            </textField>
-                            <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="aMK-Wf-4Om">
-                                <rect key="frame" x="142" y="73" width="274" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                <textFieldCell key="cell" lineBreakMode="truncatingHead" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="AEf-Bz-e2a">
-                                    <font key="font" metaFont="system"/>
-                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                </textFieldCell>
-                            </textField>
                             <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fOa-Eb-YOX">
-                                <rect key="frame" x="413" y="186" width="46" height="32"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                                <rect key="frame" x="412" y="63" width="46" height="32"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
                                 <buttonCell key="cell" type="push" title="..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="P1Z-nl-NoM">
                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                     <font key="font" metaFont="system"/>
@@ -106,28 +66,6 @@
                                     <action selector="pathSelected:" target="-2" id="AfD-Ba-ABf"/>
                                 </connections>
                             </button>
-                            <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4yv-JV-OlT">
-                                <rect key="frame" x="413" y="126" width="46" height="32"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                <buttonCell key="cell" type="push" title="..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="l9P-0n-GKu">
-                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                    <font key="font" metaFont="system"/>
-                                </buttonCell>
-                                <connections>
-                                    <action selector="pathSelected:" target="-2" id="iJc-ca-81l"/>
-                                </connections>
-                            </button>
-                            <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OIp-Nm-RGf">
-                                <rect key="frame" x="413" y="67" width="46" height="32"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                                <buttonCell key="cell" type="push" title="..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="hIf-a9-9NN">
-                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                    <font key="font" metaFont="system"/>
-                                </buttonCell>
-                                <connections>
-                                    <action selector="pathSelected:" target="-2" id="qlz-fO-nAw"/>
-                                </connections>
-                            </button>
                         </subviews>
                     </view>
                 </subviews>
@@ -135,7 +73,7 @@
             <connections>
                 <outlet property="delegate" destination="-2" id="lZI-2d-PkW"/>
             </connections>
-            <point key="canvasLocation" x="-73" y="-38"/>
+            <point key="canvasLocation" x="-73.5" y="-99.5"/>
         </window>
     </objects>
 </document>

+ 110 - 83
KdanAutoTest/KdanAuto/ViewController.swift

@@ -14,14 +14,25 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
     @IBOutlet var settingVC : SettingViewController!
     
     @IBOutlet var itemsList : NSTableView!
+    var _currentCellInfo : AutoTestCellInfo?
     @IBOutlet var advanceView : AutoTestAdvanceSettingView!
     
     @IBOutlet var startBtn : NSButton!
     var _isProcessing : Bool!
+    
+    var _selectFileType : String! = ""
 
     override func viewDidLoad() {
         super.viewDidLoad()
 
+        // Load Infos
+        let path = Bundle.main.path(forResource: "AutoTestProperty", ofType: "plist")!
+        let initInfo = try! NSDictionary.init(contentsOf: URL.init(filePath: path), error: ()) 
+        
+        testFileTypes = initInfo.allKeys as [String]
+        testTypeInfo = initInfo as NSDictionary
+                
+        //
         advanceView.delegate = self;
         updateProcessStatus()
         // Do any additional setup after loading the view.
@@ -46,6 +57,19 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
         
     }
     
+    // Setter & Getter
+    func setCurrentCellInfo(_ cellInfo : AutoTestCellInfo?) {
+        _currentCellInfo = cellInfo
+        
+        if (nil != _currentCellInfo) {
+            let autoTestObj = AutoTest.autoTestFor(NSString(string: (_currentCellInfo?.fileType())!), type:NSString(string: (_currentCellInfo?.typeInfo()["Type"] as! String)))
+            
+            advanceView.setAutoTestObj(autoTestObj)
+        }else {
+            advanceView.setAutoTestObj(nil)
+        }
+    }
+    
     
     // IBAction
     @IBAction func showSettingVC(_ sender:NSButton) {
@@ -60,43 +84,43 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
         
         DispatchQueue.global().async {
             var report = NSMutableAttributedString.init()
-            for testType in testCaseNames {
-                let testObject = AutoTest.autoTestForType(testType as NSString)
-                testObject?.setStatus(.Wait)
-            }
-            self.reloadListData()
-            
-            for testType in testCaseNames {
-                let testObject = AutoTest.autoTestForType(testType as NSString)
-                testObject?.setStatus(.Process)
-                self.reloadListData()
-                
-                if nil != testObject {
-                    testObject?.autoTest()
-                    
-                    testObject?.autoCheck()
-                    
-                    if let cReport = testObject?.testReport() {
-                        report.append(cReport)
-                    }
-                }
-                testObject?.setStatus(.Finished)
-                self.reloadListData()
-            }
-            for testType in testCaseNames {
-                let testObject = AutoTest.autoTestForType(testType as NSString)
-                testObject?.setStatus(.Normal)
-            }
-            
-            do {
-                let rtfData = try report.data(from: .init(location: 0, length: report.length),
-                                                 documentAttributes: [.documentType: NSAttributedString.DocumentType.rtf])
-                
-                let path = DataModel.shared.resultPath().appendingFormat("/TestReport_\(NSDate.now.timeIntervalSince1970).rtf")
-                try rtfData.write(to: NSURL.fileURL(withPath: path))
-            } catch {
-                print(error)
-            }
+//            for testType in testCaseNames {
+//                let testObject = AutoTest.autoTestForType(testType as NSString)
+//                testObject?.setStatus(.Wait)
+//            }
+//            self.reloadListData()
+//
+//            for testType in testCaseNames {
+//                let testObject = AutoTest.autoTestForType(testType as NSString)
+//                testObject?.setStatus(.Process)
+//                self.reloadListData()
+//
+//                if nil != testObject {
+//                    testObject?.autoTest()
+//
+//                    testObject?.autoCheck()
+//
+//                    if let cReport = testObject?.testReport() {
+//                        report.append(cReport)
+//                    }
+//                }
+//                testObject?.setStatus(.Finished)
+//                self.reloadListData()
+//            }
+//            for testType in testCaseNames {
+//                let testObject = AutoTest.autoTestForType(testType as NSString)
+//                testObject?.setStatus(.Normal)
+//            }
+//
+//            do {
+//                let rtfData = try report.data(from: .init(location: 0, length: report.length),
+//                                                 documentAttributes: [.documentType: NSAttributedString.DocumentType.rtf])
+//
+//                let path = DataModel.shared.resultPath().appendingFormat("/TestReport_\(NSDate.now.timeIntervalSince1970).rtf")
+//                try rtfData.write(to: NSURL.fileURL(withPath: path))
+//            } catch {
+//                print(error)
+//            }
             
             DispatchQueue.main.async {
                 self._isProcessing = false
@@ -108,32 +132,25 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
     
     // TableView Delegate
     func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
-        let cellView = TestCaseCellView.shared()
-        
-        let type = testCaseNames[row]
-        let autoTestObj = AutoTest.autoTestForType(type as! NSString)
+        let cellInfo = AutoTestCellInfo.initWithRow(row)
         
-        cellView?.setAutoTestObj(autoTestObj)
-        
-        return cellView
+        if cellInfo.isFileType() {
+            let cellView = TestFileTypeCellView.shared()
+            
+            let title = cellInfo.fileType()
+            
+            cellView?.setTitle(title)
+            
+            return cellView
+        }else {
+            let cellView = TestTypeCellView.shared()
+            
+            cellView?.setTypeInfo(cellInfo.typeInfo());
+            
+            return cellView
+        }
     }
-//
-//    func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? {
-//        let cell = TestCaseCellView.shared()
-//
-//        cell?.setTitle(testCaseNames[row])
-//
-//        return cell as! NSTableRowView
-//    }
     
-//    func tableView(_ tableView: NSTableView, dataCellFor tableColumn: NSTableColumn?, row: Int) -> NSCell? {
-//        var cell = NSCell.init(textCell: testCaseNames[row]);
-//
-//        cell.title = testCaseNames[row]
-//
-//        return cell
-//    }
-
     func selectionShouldChange(in tableView: NSTableView) -> Bool {
         
         
@@ -163,7 +180,7 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
     }
     
     func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat {
-        return 60
+        return 30
     }
     
     func tableView(_ tableView: NSTableView, isGroupRow row: Int) -> Bool {
@@ -179,14 +196,23 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
     }
     
     func tableViewSelectionDidChange(_ notification: Notification) {
-        let selectRow = itemsList.selectedRow
-        if selectRow != -1 {
-            let type = testCaseNames[selectRow]
-            let autoTestObj = AutoTest.autoTestForType(type as! NSString)
+        if ((notification.object as! NSTableView) == itemsList) {
+            let selectRow = itemsList.selectedRow
             
-            advanceView?.setAutoTestObj(autoTestObj)
-        }else {
-            advanceView?.setAutoTestObj(nil)
+            if selectRow != -1 {
+                let cellInfo = AutoTestCellInfo.initWithRow(selectRow)
+                
+                if cellInfo.isFileType() {
+                    let isExpend = DataModel.shared.isExpand(cellInfo.fileType())
+                    
+                    DataModel.shared.setIsExpand(cellInfo.fileType(), expand: (!isExpend))
+                    itemsList.reloadData()
+                }else {
+                    self.setCurrentCellInfo(cellInfo)
+                }
+            }else {
+                
+            }
         }
         
     }
@@ -195,14 +221,25 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
     
     // TableView Data Source
     func numberOfRows(in tableView: NSTableView) -> Int {
-        return testCaseNames.count;
+        var count = testFileTypes.count
+        
+        for fileType in testFileTypes {
+            //当前文件类型是否为展开
+            if (DataModel.shared.isExpand(fileType)) {
+                let testTypes = testTypeInfo[fileType] as! NSArray
+                
+                count = count + testTypes.count
+            }
+        }
+        
+        return count
     }
     
     /* This method is required for the "Cell Based" TableView, and is optional for the "View Based" TableView. If implemented in the latter case, the value will be set to the view at a given row/column if the view responds to -setObjectValue: (such as NSControl and NSTableCellView). Note that NSTableCellView does not actually display the objectValue, and its value is to be used for bindings. See NSTableCellView.h for more information.
      */
-    func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {
-        return testCaseNames[row]
-    }
+//    func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {
+//        return testCaseNames[row]
+//    }
     
     
     // SettingViewConntroller Handle
@@ -212,17 +249,7 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
     
     //AutoTestAdvanceSettingView Delegate
     func advanceSettingDidUpdate(_ settingView: NSView?) {
-        let selectRow = itemsList.selectedRow
-        if selectRow != -1 {
-            let cellView = itemsList.view(atColumn: 0, row: selectRow, makeIfNecessary: true) as! TestCaseCellView
-            
-            let type = testCaseNames[selectRow]
-            let autoTestObj = AutoTest.autoTestForType(type as! NSString)
-            
-            cellView.setAutoTestObj(autoTestObj)
-        }else {
-            itemsList.reloadData()
-        }
+        self.setCurrentCellInfo(_currentCellInfo)
     }
     
 }

+ 13 - 2
KdanAutoTest/ProcessCheckFile/Process/ProcessThumbnal.swift

@@ -17,14 +17,25 @@ class ProcessThumbnal : NSObject {
     
     class func process(_ filePath:String) {
         let url = URL.init(filePath: filePath)
+                generator.generateRepresentations(for: QLThumbnailGenerator.Request.init(fileAt: url, size: CGSizeMake(1024.0, 10240.0), scale: 1.0, representationTypes: QLThumbnailGenerator.Request.RepresentationTypes.thumbnail),
+
+                                                  update: { (representation, type, error) in
+            let image = representation!.nsImage as NSImage
+                         
+            try? image.tiffRepresentation?.write(to: URL.init(filePath: "/Users/zhudongyong/Desktop/imae01.png"))
+            NSLog("\(representation?.nsImage)\(error)")
+        })
         
         generator.generateRepresentations(for: QLThumbnailGenerator.Request.init(fileAt: url, size: CGSizeMake(1024.0, 10240.0), scale: 1.0, representationTypes: QLThumbnailGenerator.Request.RepresentationTypes.thumbnail),
-                                                            update: { (representation, type, error) in
+                                          update: { (representation, type, error) in
             let image = representation!.nsImage as NSImage
-                         
+            
+            try? image.tiffRepresentation?.write(to: URL.init(filePath: "/Users/zhudongyong/Desktop/imae02.png"))
             NSLog("\(representation?.nsImage)\(error)")
         })
         
+        
+        
 //        return []
     }