Skip to content

Commit 589b4b6

Browse files
committed
Fix tests
Signed-off-by: Hasan Turken <[email protected]>
1 parent 22f1b85 commit 589b4b6

File tree

5 files changed

+3
-46
lines changed

5 files changed

+3
-46
lines changed

KubeContext.xcodeproj/project.pbxproj

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
8A0A020E21D2BDFB007DF454 /* ui-test-config-cleaned.yaml in Resources */ = {isa = PBXBuildFile; fileRef = 8A0A020D21D2BDFB007DF454 /* ui-test-config-cleaned.yaml */; };
1110
8A5DB217259535A1004F6EED /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 8A5DB216259535A1004F6EED /* Yams */; };
1211
8A5DB21D259535D3004F6EED /* SwiftyStoreKit in Frameworks */ = {isa = PBXBuildFile; productRef = 8A5DB21C259535D3004F6EED /* SwiftyStoreKit */; };
1312
8A795B772595240E003EA721 /* EonilFSEvents in Frameworks */ = {isa = PBXBuildFile; productRef = 8A795B762595240E003EA721 /* EonilFSEvents */; };
@@ -16,10 +15,7 @@
1615
E4393759217926C40077CCF1 /* TestData in Resources */ = {isa = PBXBuildFile; fileRef = E4393757217922E90077CCF1 /* TestData */; };
1716
E471094521695DF70037A107 /* Kubernetes.swift in Sources */ = {isa = PBXBuildFile; fileRef = E471094421695DF70037A107 /* Kubernetes.swift */; };
1817
E47109472169F3610037A107 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = E47109462169F3610037A107 /* Utils.swift */; };
19-
E4AB87BE217B6B85001C70C9 /* TestData in Resources */ = {isa = PBXBuildFile; fileRef = E4393757217922E90077CCF1 /* TestData */; };
20-
E4AB87C0217BA1F3001C70C9 /* TestData in CopyFiles */ = {isa = PBXBuildFile; fileRef = E4393757217922E90077CCF1 /* TestData */; };
2118
E4AB87C2217BB704001C70C9 /* Globals.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4AB87C1217BB704001C70C9 /* Globals.swift */; };
22-
E4AB87C4217BB766001C70C9 /* file-to-import.yaml in Resources */ = {isa = PBXBuildFile; fileRef = E4AB87C3217BB766001C70C9 /* file-to-import.yaml */; };
2319
E4B0B223217126CD00AB7817 /* MenuManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B0B222217126CD00AB7817 /* MenuManager.swift */; };
2420
E4B0B22C217285AA00AB7817 /* Manage.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E4B0B22B217285AA00AB7817 /* Manage.storyboard */; };
2521
E4B0B22E2172886100AB7817 /* ManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B0B22D2172886100AB7817 /* ManageViewController.swift */; };
@@ -49,31 +45,15 @@
4945
};
5046
/* End PBXContainerItemProxy section */
5147

52-
/* Begin PBXCopyFilesBuildPhase section */
53-
E4AB87BF217BA1D7001C70C9 /* CopyFiles */ = {
54-
isa = PBXCopyFilesBuildPhase;
55-
buildActionMask = 2147483647;
56-
dstPath = TestDatam;
57-
dstSubfolderSpec = 16;
58-
files = (
59-
E4AB87C0217BA1F3001C70C9 /* TestData in CopyFiles */,
60-
);
61-
runOnlyForDeploymentPostprocessing = 0;
62-
};
63-
/* End PBXCopyFilesBuildPhase section */
64-
6548
/* Begin PBXFileReference section */
66-
8A0A020D21D2BDFB007DF454 /* ui-test-config-cleaned.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "ui-test-config-cleaned.yaml"; path = "../../../KubeContext/KubeContextUITests/TestData/ui-test-config-cleaned.yaml"; sourceTree = "<group>"; };
6749
E422CCAC216E8D0A0008D173 /* Config.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = "<group>"; };
6850
E439374C21791F8A0077CCF1 /* KubeContextTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KubeContextTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6951
E439374E21791F8A0077CCF1 /* KubeContextTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KubeContextTests.swift; sourceTree = "<group>"; };
7052
E439375021791F8A0077CCF1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7153
E4393757217922E90077CCF1 /* TestData */ = {isa = PBXFileReference; lastKnownFileType = folder; path = TestData; sourceTree = "<group>"; };
7254
E471094421695DF70037A107 /* Kubernetes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Kubernetes.swift; sourceTree = "<group>"; };
7355
E47109462169F3610037A107 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
74-
E4AB87BA217B6B68001C70C9 /* ui-test-config.yaml */ = {isa = PBXFileReference; lastKnownFileType = text; path = "ui-test-config.yaml"; sourceTree = "<group>"; };
7556
E4AB87C1217BB704001C70C9 /* Globals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Globals.swift; sourceTree = "<group>"; };
76-
E4AB87C3217BB766001C70C9 /* file-to-import.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "file-to-import.yaml"; sourceTree = "<group>"; };
7757
E4B0B222217126CD00AB7817 /* MenuManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuManager.swift; sourceTree = "<group>"; };
7858
E4B0B22B217285AA00AB7817 /* Manage.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Manage.storyboard; sourceTree = "<group>"; };
7959
E4B0B22D2172886100AB7817 /* ManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageViewController.swift; sourceTree = "<group>"; };
@@ -131,16 +111,6 @@
131111
path = KubeContextTests;
132112
sourceTree = "<group>";
133113
};
134-
E4AB87B7217B6B68001C70C9 /* TestData */ = {
135-
isa = PBXGroup;
136-
children = (
137-
8A0A020D21D2BDFB007DF454 /* ui-test-config-cleaned.yaml */,
138-
E4AB87C3217BB766001C70C9 /* file-to-import.yaml */,
139-
E4AB87BA217B6B68001C70C9 /* ui-test-config.yaml */,
140-
);
141-
path = TestData;
142-
sourceTree = "<group>";
143-
};
144114
E4B0B22A2172857C00AB7817 /* ManageWindow */ = {
145115
isa = PBXGroup;
146116
children = (
@@ -192,7 +162,6 @@
192162
E4F96DC5217B60BB004428F6 /* KubeContextUITests */ = {
193163
isa = PBXGroup;
194164
children = (
195-
E4AB87B7217B6B68001C70C9 /* TestData */,
196165
E4F96DC6217B60BB004428F6 /* KubeContextUITests.swift */,
197166
E4F96DC8217B60BB004428F6 /* Info.plist */,
198167
);
@@ -246,10 +215,8 @@
246215
isa = PBXNativeTarget;
247216
buildConfigurationList = E4F96DCB217B60BB004428F6 /* Build configuration list for PBXNativeTarget "KubeContextUITests" */;
248217
buildPhases = (
249-
E4AB87BF217BA1D7001C70C9 /* CopyFiles */,
250218
E4F96DC0217B60BB004428F6 /* Sources */,
251219
E4F96DC1217B60BB004428F6 /* Frameworks */,
252-
E4F96DC2217B60BB004428F6 /* Resources */,
253220
);
254221
buildRules = (
255222
);
@@ -336,16 +303,6 @@
336303
);
337304
runOnlyForDeploymentPostprocessing = 0;
338305
};
339-
E4F96DC2217B60BB004428F6 /* Resources */ = {
340-
isa = PBXResourcesBuildPhase;
341-
buildActionMask = 2147483647;
342-
files = (
343-
E4AB87C4217BB766001C70C9 /* file-to-import.yaml in Resources */,
344-
8A0A020E21D2BDFB007DF454 /* ui-test-config-cleaned.yaml in Resources */,
345-
E4AB87BE217B6B85001C70C9 /* TestData in Resources */,
346-
);
347-
runOnlyForDeploymentPostprocessing = 0;
348-
};
349306
/* End PBXResourcesBuildPhase section */
350307

351308
/* Begin PBXSourcesBuildPhase section */
File renamed without changes.
File renamed without changes.
File renamed without changes.

KubeContextUITests/KubeContextUITests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class KubeContextUITests: XCTestCase {
5858

5959
func testChangeContext() {
6060
let app = XCUIApplication()
61-
let statusItem = app.children(matching: .menuBar).element(boundBy: 1).children(matching: .statusItem).element
61+
let statusItem = app.children(matching: .menuBar).element(boundBy: 1).children(matching: .statusItem).element(boundBy: 0)
6262
statusItem.click()
6363

6464
let menuBarsQuery = app.menuBars
@@ -279,7 +279,7 @@ class KubeContextUITests: XCTestCase {
279279
let applyButton = contextManagementWindow.buttons["Apply"]
280280
applyButton.click()
281281

282-
let expectedContent = try? String(contentsOfFile: "/Users/hasanturken/Workspace/KubeContext/KubeContextUITests/TestData/ui-test-config-cleaned.yaml", encoding: .utf8)
282+
let expectedContent = try? String(contentsOfFile: "/Users/hasanturken/Workspace/my-repos/KubeContext/KubeContextUITests/TestData/ui-test-config-cleaned.yaml", encoding: .utf8)
283283

284284
let currentContent = try? String(contentsOfFile: "/Users/hasanturken/Library/Containers/com.ht.kubecontext/Data/Documents/TempData/ui-test-config.yaml", encoding: .utf8)
285285

@@ -429,7 +429,7 @@ class KubeContextUITests: XCTestCase {
429429
statusItem.click()
430430
menuBarsQuery/*@START_MENU_TOKEN@*/.menuItems["Select kubeconfig file"]/*[[".statusItems",".menus.menuItems[\"Select kubeconfig file\"]",".menuItems[\"Select kubeconfig file\"]"],[[[-1,2],[-1,1],[-1,0,1]],[[-1,2],[-1,1]]],[0]]@END_MENU_TOKEN@*/.click()
431431

432-
let origContent = try? String(contentsOfFile: "/Users/hasanturken/Workspace/KubeContext/KubeContextUITests/TestData/ui-test-config.yaml", encoding: .utf8)
432+
let origContent = try? String(contentsOfFile: "/Users/hasanturken/Workspace/my-repos/KubeContext/KubeContextUITests/TestData/ui-test-config.yaml", encoding: .utf8)
433433

434434
let currentContent = try? String(contentsOfFile: "/Users/hasanturken/Library/Containers/com.ht.kubecontext/Data/Documents/TempData/ui-test-config.yaml", encoding: .utf8)
435435

0 commit comments

Comments
 (0)