Skip to content

Commit 05ceeee

Browse files
authored
Merge pull request Boris-Em#32 from Boris-Em/feature/uitests
UI Tests
2 parents 81a3b61 + daa79bc commit 05ceeee

File tree

5 files changed

+210
-4
lines changed

5 files changed

+210
-4
lines changed

Sample Project/CheckBox.xcodeproj/project.pbxproj

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
C3DFB9BA1BBA475B00D2F8B4 /* AnimationManangerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3DFB9B91BBA475B00D2F8B4 /* AnimationManangerTests.m */; };
2626
C3DFB9BD1BBD0E2800D2F8B4 /* BEMAnimationsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C3DFB9BC1BBD0E2800D2F8B4 /* BEMAnimationsTableViewController.m */; };
2727
C3E594901BC220C7005EA38B /* BEMCurrentSetupTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C3E5948F1BC220C7005EA38B /* BEMCurrentSetupTableViewController.m */; };
28+
FC76C2451D7A121200EE3AA4 /* CheckBoxUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = FC76C2441D7A121200EE3AA4 /* CheckBoxUITests.m */; };
2829
/* End PBXBuildFile section */
2930

3031
/* Begin PBXContainerItemProxy section */
@@ -42,6 +43,13 @@
4243
remoteGlobalIDString = C325370C1B9231780059F394;
4344
remoteInfo = CheckBox;
4445
};
46+
FC76C2471D7A121200EE3AA4 /* PBXContainerItemProxy */ = {
47+
isa = PBXContainerItemProxy;
48+
containerPortal = C32537051B9231780059F394 /* Project object */;
49+
proxyType = 1;
50+
remoteGlobalIDString = C325370C1B9231780059F394;
51+
remoteInfo = CheckBox;
52+
};
4553
/* End PBXContainerItemProxy section */
4654

4755
/* Begin PBXCopyFilesBuildPhase section */
@@ -86,6 +94,9 @@
8694
C3E837A91BAE3493004576D6 /* BEMAnimationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BEMAnimationManager.m; path = ../Classes/BEMAnimationManager.m; sourceTree = "<group>"; };
8795
C3E837AB1BAE35D8004576D6 /* BEMPathManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BEMPathManager.h; path = ../Classes/BEMPathManager.h; sourceTree = "<group>"; };
8896
C3E837AC1BAE35D8004576D6 /* BEMPathManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BEMPathManager.m; path = ../Classes/BEMPathManager.m; sourceTree = "<group>"; };
97+
FC76C2421D7A121200EE3AA4 /* CheckBoxUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CheckBoxUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
98+
FC76C2441D7A121200EE3AA4 /* CheckBoxUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CheckBoxUITests.m; sourceTree = "<group>"; };
99+
FC76C2461D7A121200EE3AA4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
89100
/* End PBXFileReference section */
90101

91102
/* Begin PBXFrameworksBuildPhase section */
@@ -111,6 +122,13 @@
111122
);
112123
runOnlyForDeploymentPostprocessing = 0;
113124
};
125+
FC76C23F1D7A121200EE3AA4 /* Frameworks */ = {
126+
isa = PBXFrameworksBuildPhase;
127+
buildActionMask = 2147483647;
128+
files = (
129+
);
130+
runOnlyForDeploymentPostprocessing = 0;
131+
};
114132
/* End PBXFrameworksBuildPhase section */
115133

116134
/* Begin PBXGroup section */
@@ -128,8 +146,9 @@
128146
children = (
129147
C32537361B92318C0059F394 /* Classes */,
130148
C325370F1B9231780059F394 /* CheckBox */,
131-
C32537291B9231780059F394 /* CheckBoxTests */,
132149
5643F12C1CDE722C0020E238 /* BEMCheckBox */,
150+
C32537291B9231780059F394 /* CheckBoxTests */,
151+
FC76C2431D7A121200EE3AA4 /* CheckBoxUITests */,
133152
C325370E1B9231780059F394 /* Products */,
134153
);
135154
sourceTree = "<group>";
@@ -140,6 +159,7 @@
140159
C325370D1B9231780059F394 /* CheckBox.app */,
141160
C32537261B9231780059F394 /* CheckBoxTests.xctest */,
142161
5643F12B1CDE722C0020E238 /* BEMCheckBox.framework */,
162+
FC76C2421D7A121200EE3AA4 /* CheckBoxUITests.xctest */,
143163
);
144164
name = Products;
145165
sourceTree = "<group>";
@@ -203,6 +223,15 @@
203223
name = Classes;
204224
sourceTree = "<group>";
205225
};
226+
FC76C2431D7A121200EE3AA4 /* CheckBoxUITests */ = {
227+
isa = PBXGroup;
228+
children = (
229+
FC76C2441D7A121200EE3AA4 /* CheckBoxUITests.m */,
230+
FC76C2461D7A121200EE3AA4 /* Info.plist */,
231+
);
232+
path = CheckBoxUITests;
233+
sourceTree = "<group>";
234+
};
206235
/* End PBXGroup section */
207236

208237
/* Begin PBXHeadersBuildPhase section */
@@ -274,6 +303,24 @@
274303
productReference = C32537261B9231780059F394 /* CheckBoxTests.xctest */;
275304
productType = "com.apple.product-type.bundle.unit-test";
276305
};
306+
FC76C2411D7A121200EE3AA4 /* CheckBoxUITests */ = {
307+
isa = PBXNativeTarget;
308+
buildConfigurationList = FC76C24B1D7A121200EE3AA4 /* Build configuration list for PBXNativeTarget "CheckBoxUITests" */;
309+
buildPhases = (
310+
FC76C23E1D7A121200EE3AA4 /* Sources */,
311+
FC76C23F1D7A121200EE3AA4 /* Frameworks */,
312+
FC76C2401D7A121200EE3AA4 /* Resources */,
313+
);
314+
buildRules = (
315+
);
316+
dependencies = (
317+
FC76C2481D7A121200EE3AA4 /* PBXTargetDependency */,
318+
);
319+
name = CheckBoxUITests;
320+
productName = CheckBoxUITests;
321+
productReference = FC76C2421D7A121200EE3AA4 /* CheckBoxUITests.xctest */;
322+
productType = "com.apple.product-type.bundle.ui-testing";
323+
};
277324
/* End PBXNativeTarget section */
278325

279326
/* Begin PBXProject section */
@@ -293,6 +340,11 @@
293340
CreatedOnToolsVersion = 6.4;
294341
TestTargetID = C325370C1B9231780059F394;
295342
};
343+
FC76C2411D7A121200EE3AA4 = {
344+
CreatedOnToolsVersion = 8.0;
345+
ProvisioningStyle = Automatic;
346+
TestTargetID = C325370C1B9231780059F394;
347+
};
296348
};
297349
};
298350
buildConfigurationList = C32537081B9231780059F394 /* Build configuration list for PBXProject "CheckBox" */;
@@ -310,6 +362,7 @@
310362
targets = (
311363
C325370C1B9231780059F394 /* CheckBox */,
312364
C32537251B9231780059F394 /* CheckBoxTests */,
365+
FC76C2411D7A121200EE3AA4 /* CheckBoxUITests */,
313366
5643F12A1CDE722C0020E238 /* BEMCheckBox */,
314367
);
315368
};
@@ -340,6 +393,13 @@
340393
);
341394
runOnlyForDeploymentPostprocessing = 0;
342395
};
396+
FC76C2401D7A121200EE3AA4 /* Resources */ = {
397+
isa = PBXResourcesBuildPhase;
398+
buildActionMask = 2147483647;
399+
files = (
400+
);
401+
runOnlyForDeploymentPostprocessing = 0;
402+
};
343403
/* End PBXResourcesBuildPhase section */
344404

345405
/* Begin PBXSourcesBuildPhase section */
@@ -374,6 +434,14 @@
374434
);
375435
runOnlyForDeploymentPostprocessing = 0;
376436
};
437+
FC76C23E1D7A121200EE3AA4 /* Sources */ = {
438+
isa = PBXSourcesBuildPhase;
439+
buildActionMask = 2147483647;
440+
files = (
441+
FC76C2451D7A121200EE3AA4 /* CheckBoxUITests.m in Sources */,
442+
);
443+
runOnlyForDeploymentPostprocessing = 0;
444+
};
377445
/* End PBXSourcesBuildPhase section */
378446

379447
/* Begin PBXTargetDependency section */
@@ -387,6 +455,11 @@
387455
target = C325370C1B9231780059F394 /* CheckBox */;
388456
targetProxy = C32537271B9231780059F394 /* PBXContainerItemProxy */;
389457
};
458+
FC76C2481D7A121200EE3AA4 /* PBXTargetDependency */ = {
459+
isa = PBXTargetDependency;
460+
target = C325370C1B9231780059F394 /* CheckBox */;
461+
targetProxy = FC76C2471D7A121200EE3AA4 /* PBXContainerItemProxy */;
462+
};
390463
/* End PBXTargetDependency section */
391464

392465
/* Begin PBXVariantGroup section */
@@ -585,6 +658,39 @@
585658
};
586659
name = Release;
587660
};
661+
FC76C2491D7A121200EE3AA4 /* Debug */ = {
662+
isa = XCBuildConfiguration;
663+
buildSettings = {
664+
CLANG_ANALYZER_NONNULL = YES;
665+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
666+
CLANG_WARN_INFINITE_RECURSION = YES;
667+
CLANG_WARN_SUSPICIOUS_MOVES = YES;
668+
DEBUG_INFORMATION_FORMAT = dwarf;
669+
INFOPLIST_FILE = CheckBoxUITests/Info.plist;
670+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
671+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
672+
PRODUCT_BUNDLE_IDENTIFIER = borisemorine.CheckBoxUITests;
673+
PRODUCT_NAME = "$(TARGET_NAME)";
674+
TEST_TARGET_NAME = CheckBox;
675+
};
676+
name = Debug;
677+
};
678+
FC76C24A1D7A121200EE3AA4 /* Release */ = {
679+
isa = XCBuildConfiguration;
680+
buildSettings = {
681+
CLANG_ANALYZER_NONNULL = YES;
682+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
683+
CLANG_WARN_INFINITE_RECURSION = YES;
684+
CLANG_WARN_SUSPICIOUS_MOVES = YES;
685+
INFOPLIST_FILE = CheckBoxUITests/Info.plist;
686+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
687+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
688+
PRODUCT_BUNDLE_IDENTIFIER = borisemorine.CheckBoxUITests;
689+
PRODUCT_NAME = "$(TARGET_NAME)";
690+
TEST_TARGET_NAME = CheckBox;
691+
};
692+
name = Release;
693+
};
588694
/* End XCBuildConfiguration section */
589695

590696
/* Begin XCConfigurationList section */
@@ -624,6 +730,15 @@
624730
defaultConfigurationIsVisible = 0;
625731
defaultConfigurationName = Release;
626732
};
733+
FC76C24B1D7A121200EE3AA4 /* Build configuration list for PBXNativeTarget "CheckBoxUITests" */ = {
734+
isa = XCConfigurationList;
735+
buildConfigurations = (
736+
FC76C2491D7A121200EE3AA4 /* Debug */,
737+
FC76C24A1D7A121200EE3AA4 /* Release */,
738+
);
739+
defaultConfigurationIsVisible = 0;
740+
defaultConfigurationName = Release;
741+
};
627742
/* End XCConfigurationList section */
628743
};
629744
rootObject = C32537051B9231780059F394 /* Project object */;

Sample Project/CheckBox.xcodeproj/xcshareddata/xcschemes/CheckBox.xcscheme

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
ReferencedContainer = "container:CheckBox.xcodeproj">
5353
</BuildableReference>
5454
</TestableReference>
55+
<TestableReference
56+
skipped = "NO">
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "FC76C2411D7A121200EE3AA4"
60+
BuildableName = "CheckBoxUITests.xctest"
61+
BlueprintName = "CheckBoxUITests"
62+
ReferencedContainer = "container:CheckBox.xcodeproj">
63+
</BuildableReference>
64+
</TestableReference>
5565
</Testables>
5666
<MacroExpansion>
5767
<BuildableReference

Sample Project/CheckBox.xcodeproj/xcshareddata/xcschemes/CheckBoxTests.xcscheme

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,23 @@
5252
ReferencedContainer = "container:CheckBox.xcodeproj">
5353
</BuildableReference>
5454
</TestableReference>
55+
<TestableReference
56+
skipped = "NO">
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "FC76C2411D7A121200EE3AA4"
60+
BuildableName = "CheckBoxUITests.xctest"
61+
BlueprintName = "CheckBoxUITests"
62+
ReferencedContainer = "container:CheckBox.xcodeproj">
63+
</BuildableReference>
64+
</TestableReference>
5565
</Testables>
5666
<MacroExpansion>
5767
<BuildableReference
5868
BuildableIdentifier = "primary"
59-
BlueprintIdentifier = "C32537251B9231780059F394"
60-
BuildableName = "CheckBoxTests.xctest"
61-
BlueprintName = "CheckBoxTests"
69+
BlueprintIdentifier = "C325370C1B9231780059F394"
70+
BuildableName = "CheckBox.app"
71+
BlueprintName = "CheckBox"
6272
ReferencedContainer = "container:CheckBox.xcodeproj">
6373
</BuildableReference>
6474
</MacroExpansion>
@@ -94,6 +104,15 @@
94104
savedToolIdentifier = ""
95105
useCustomWorkingDirectory = "NO"
96106
debugDocumentVersioning = "YES">
107+
<MacroExpansion>
108+
<BuildableReference
109+
BuildableIdentifier = "primary"
110+
BlueprintIdentifier = "C325370C1B9231780059F394"
111+
BuildableName = "CheckBox.app"
112+
BlueprintName = "CheckBox"
113+
ReferencedContainer = "container:CheckBox.xcodeproj">
114+
</BuildableReference>
115+
</MacroExpansion>
97116
</ProfileAction>
98117
<AnalyzeAction
99118
buildConfiguration = "Debug">
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// CheckBoxUITests.m
3+
// CheckBoxUITests
4+
//
5+
// Created by Boris Emorine on 9/2/16.
6+
// Copyright © 2016 Boris Emorine. All rights reserved.
7+
//
8+
9+
#import <XCTest/XCTest.h>
10+
#import "BEMCheckBox.h"
11+
12+
@interface CheckBoxUITests : XCTestCase
13+
14+
@end
15+
16+
@implementation CheckBoxUITests
17+
18+
- (void)setUp {
19+
[super setUp];
20+
21+
self.continueAfterFailure = NO;
22+
[[[XCUIApplication alloc] init] launch];
23+
}
24+
25+
- (void)tearDown {
26+
[super tearDown];
27+
}
28+
29+
- (void)testOn {
30+
XCUIElement *element = [[[[[[[[XCUIApplication alloc] init].otherElements containingType:XCUIElementTypeNavigationBar identifier:@"BEMCheckBox"] childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther] elementBoundByIndex:1];
31+
XCTAssertTrue(element.isHittable);
32+
33+
[element tap];
34+
XCTAssertTrue(element.isHittable);
35+
36+
[element tap];
37+
XCTAssertTrue(element.isHittable);
38+
}
39+
40+
@end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>

0 commit comments

Comments
 (0)