diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testLayoutExample_1-iOS10@2x.png b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testLayoutExample_1-iOS10@2x.png new file mode 100644 index 00000000000000..140a1affc25ea9 Binary files /dev/null and b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testLayoutExample_1-iOS10@2x.png differ diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSliderExample_1-iOS10@2x.png b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSliderExample_1-iOS10@2x.png new file mode 100644 index 00000000000000..79603c68671632 Binary files /dev/null and b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSliderExample_1-iOS10@2x.png differ diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSliderExample_1@2x.png b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSliderExample_1@2x.png index 45b9547a82be78..fadbe2cb8977cd 100644 Binary files a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSliderExample_1@2x.png and b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSliderExample_1@2x.png differ diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSwitchExample_1-iOS10@2x.png b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSwitchExample_1-iOS10@2x.png new file mode 100644 index 00000000000000..15de56b65af70a Binary files /dev/null and b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testSwitchExample_1-iOS10@2x.png differ diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTabBarExample_1-iOS10@2x.png b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTabBarExample_1-iOS10@2x.png new file mode 100644 index 00000000000000..4bef6cb3b3b35d Binary files /dev/null and b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTabBarExample_1-iOS10@2x.png differ diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTabBarExample_1@2x.png b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTabBarExample_1@2x.png index cfde34a4a0e310..bff34cfbaf6b6e 100644 Binary files a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTabBarExample_1@2x.png and b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTabBarExample_1@2x.png differ diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTextExample_1-iOS10@2x.png b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTextExample_1-iOS10@2x.png new file mode 100644 index 00000000000000..367040097cda6f Binary files /dev/null and b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testTextExample_1-iOS10@2x.png differ diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testViewExample_1-iOS10@2x.png b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testViewExample_1-iOS10@2x.png new file mode 100644 index 00000000000000..203b2bb2f76d29 Binary files /dev/null and b/Examples/UIExplorer/UIExplorerIntegrationTests/ReferenceImages/Examples-UIExplorer-js-UIExplorerApp.ios/testViewExample_1-iOS10@2x.png differ diff --git a/Examples/UIExplorer/UIExplorerIntegrationTests/UIExplorerSnapshotTests.m b/Examples/UIExplorer/UIExplorerIntegrationTests/UIExplorerSnapshotTests.m index 9de51c3ed59ef6..d3a72633881178 100644 --- a/Examples/UIExplorer/UIExplorerIntegrationTests/UIExplorerSnapshotTests.m +++ b/Examples/UIExplorer/UIExplorerIntegrationTests/UIExplorerSnapshotTests.m @@ -33,6 +33,9 @@ @implementation UIExplorerSnapshotTests - (void)setUp { _runner = RCTInitRunnerForApp(@"Examples/UIExplorer/js/UIExplorerApp.ios", nil); + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10) { + _runner.testSuffix = @"-iOS10"; + } _runner.recordMode = NO; } @@ -46,8 +49,8 @@ - (void)test##name \ RCT_TEST(LayoutExample) RCT_TEST(TextExample) RCT_TEST(SwitchExample) -//RCT_TEST(SliderExample) // Disabled: #8985988 -//RCT_TEST(TabBarExample) // Disabled: #8985988 +RCT_TEST(SliderExample) +RCT_TEST(TabBarExample) - (void)testZZZNotInRecordMode { diff --git a/Examples/UIExplorer/UIExplorerUnitTests/TestBundle.js b/Examples/UIExplorer/UIExplorerUnitTests/TestBundle.js index 5919f0f4f0406e..6f3caed35ce4b0 100644 --- a/Examples/UIExplorer/UIExplorerUnitTests/TestBundle.js +++ b/Examples/UIExplorer/UIExplorerUnitTests/TestBundle.js @@ -7,3 +7,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +var __fbBatchedBridge = { + flushedQueue: function() { + return null; + } +}; diff --git a/Libraries/RCTTest/RCTTestModule.h b/Libraries/RCTTest/RCTTestModule.h index 06c408bea7bdda..bd0ffe58eeafe3 100644 --- a/Libraries/RCTTest/RCTTestModule.h +++ b/Libraries/RCTTest/RCTTestModule.h @@ -42,4 +42,6 @@ typedef NS_ENUM(NSInteger, RCTTestStatus) { */ @property (nonatomic, readonly) RCTTestStatus status; +@property (nonatomic, copy) NSString *testSuffix; + @end diff --git a/Libraries/RCTTest/RCTTestModule.m b/Libraries/RCTTest/RCTTestModule.m index e9ba29132c6680..402dbff71a2e81 100644 --- a/Libraries/RCTTest/RCTTestModule.m +++ b/Libraries/RCTTest/RCTTestModule.m @@ -15,9 +15,8 @@ #import "RCTLog.h" #import "RCTUIManager.h" -@implementation RCTTestModule -{ - NSMutableDictionary *_snapshotCounter; +@implementation RCTTestModule { + NSMutableDictionary *_snapshotCounter; } @synthesize bridge = _bridge; @@ -34,18 +33,23 @@ - (dispatch_queue_t)methodQueue RCTAssert(_controller != nil, @"No snapshot controller configured."); [_bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { - NSString *testName = NSStringFromSelector(self->_testSelector); if (!self->_snapshotCounter) { self->_snapshotCounter = [NSMutableDictionary new]; } - self->_snapshotCounter[testName] = (@([self->_snapshotCounter[testName] integerValue] + 1)).stringValue; + + NSNumber *counter = @([self->_snapshotCounter[testName] integerValue] + 1); + self->_snapshotCounter[testName] = counter; NSError *error = nil; + NSString *identifier = [counter stringValue]; + if (self->_testSuffix) { + identifier = [identifier stringByAppendingString:self->_testSuffix]; + } BOOL success = [self->_controller compareSnapshotOfView:self->_view - selector:self->_testSelector - identifier:self->_snapshotCounter[testName] - error:&error]; + selector:self->_testSelector + identifier:identifier + error:&error]; callback(@[@(success)]); }]; } diff --git a/Libraries/RCTTest/RCTTestRunner.h b/Libraries/RCTTest/RCTTestRunner.h index b5e8430cd83968..2688b2a019137c 100644 --- a/Libraries/RCTTest/RCTTestRunner.h +++ b/Libraries/RCTTest/RCTTestRunner.h @@ -35,6 +35,8 @@ */ @property (nonatomic, assign) BOOL recordMode; +@property (nonatomic, copy) NSString *testSuffix; + @property (nonatomic, readonly) NSURL *scriptURL; /** diff --git a/Libraries/RCTTest/RCTTestRunner.m b/Libraries/RCTTest/RCTTestRunner.m index c9d84a183605ac..1d2b416728530b 100644 --- a/Libraries/RCTTest/RCTTestRunner.m +++ b/Libraries/RCTTest/RCTTestRunner.m @@ -117,6 +117,7 @@ - (void)runTest:(SEL)test module:(NSString *)moduleName RCTAssert(_testController != nil, @"_testController should not be nil"); testModule.controller = _testController; testModule.testSelector = test; + testModule.testSuffix = _testSuffix; testModule.view = rootView; UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController;