2015-03-23 20:28:42 +00:00
/ * *
2015-03-28 05:18:47 +00:00
* The examples provided by Facebook are for non - commercial testing and
* evaluation purposes only .
2015-03-23 20:28:42 +00:00
*
2015-03-28 05:18:47 +00:00
* Facebook reserves all rights not expressly granted .
*
* THE SOFTWARE IS PROVIDED "AS IS" , WITHOUT WARRANTY OF ANY KIND , EXPRESS
* OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY ,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT . IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN
* AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE .
2015-03-23 20:28:42 +00:00
* /
2015-03-10 21:06:09 +00:00
# import < UIKit / UIKit . h >
# import < XCTest / XCTest . h >
2015-03-25 05:07:16 +00:00
# import < RCTTest / RCTTestRunner . h >
# import "RCTAssert.h"
2015-03-17 18:35:41 +00:00
# import "RCTRedBox.h"
2015-03-25 05:07:16 +00:00
# import "RCTRootView.h"
2015-03-17 18:35:41 +00:00
2015-07-07 23:19:40 +00:00
@ interface UIExplorerSnapshotTests : XCTestCase
2015-03-25 05:07:16 +00:00
{
RCTTestRunner * _runner ;
}
2015-03-10 21:06:09 +00:00
@ end
2015-07-07 23:19:40 +00:00
@ implementation UIExplorerSnapshotTests
2015-03-10 21:06:09 +00:00
2015-03-25 05:07:16 +00:00
- ( void ) setUp
{
2015-08-01 08:44:05 +00:00
# if __LP64 __
RCTAssert ( NO , @ "Tests should be run on 32-bit device simulators (e.g. iPhone 5)" ) ;
2015-03-25 05:07:16 +00:00
# endif
2015-08-01 08:44:05 +00:00
NSOperatingSystemVersion version = [ [ NSProcessInfo processInfo ] operatingSystemVersion ] ;
RCTAssert ( version . majorVersion = = 8 || version . minorVersion >= 3 , @ "Snapshot tests should be run on iOS 8.3+, found %zd.%zd.%zd" , version . majorVersion , version . minorVersion , version . patchVersion ) ;
2015-07-07 23:19:40 +00:00
_runner = RCTInitRunnerForApp ( @ "Examples/UIExplorer/UIExplorerApp.ios" , nil ) ;
_runner . recordMode = NO ;
2015-03-10 21:06:09 +00:00
}
2015-07-07 23:19:40 +00:00
# define RCT_TEST ( name ) \
- ( void ) test # # name \
{ \
[ _runner runTest : _cmd module : @ # name ] ; \
2015-03-25 05:07:16 +00:00
}
2015-07-07 23:19:40 +00:00
RCT_TEST ( ViewExample )
RCT_TEST ( LayoutExample )
RCT_TEST ( TextExample )
RCT_TEST ( SwitchExample )
RCT_TEST ( SliderExample )
RCT_TEST ( TabBarExample )
- ( void ) testZZZNotInRecordMode
{
XCTAssertFalse ( _runner . recordMode , @ "Don't forget to turn record mode back to off" ) ;
}
2015-03-25 05:07:16 +00:00
2015-03-10 21:06:09 +00:00
@ end