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 00000000000..140a1affc25 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 00000000000..79603c68671 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 45b9547a82b..fadbe2cb897 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 00000000000..15de56b65af 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 00000000000..4bef6cb3b3b 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 cfde34a4a0e..bff34cfbaf6 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 00000000000..367040097cd 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 00000000000..203b2bb2f76 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 9de51c3ed59..d3a72633881 100644 --- a/Examples/UIExplorer/UIExplorerIntegrationTests/UIExplorerSnapshotTests.m +++ b/Examples/UIExplorer/UIExplorerIntegrationTests/UIExplorerSnapshotTests.m @@ -33,6 +33,9 @@ - (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 @@ RCT_TEST(ViewExample) 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 5919f0f4f04..6f3caed35ce 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 06c408bea7b..bd0ffe58eea 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 e9ba29132c6..402dbff71a2 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 @@ RCT_EXPORT_METHOD(verifySnapshot:(RCTResponseSenderBlock)callback) 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 b5e8430cd83..2688b2a0191 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 c9d84a18360..1d2b4167285 100644 --- a/Libraries/RCTTest/RCTTestRunner.m +++ b/Libraries/RCTTest/RCTTestRunner.m @@ -117,6 +117,7 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock 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;