File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ var test = require ( 'tape' ) ;
2+ var robot = require ( '..' ) ;
3+ var pixelColor , screenSize ;
4+
5+ test ( 'Get pixel color.' , function ( t )
6+ {
7+ t . plan ( 4 ) ;
8+ t . ok ( pixelColor = robot . getPixelColor ( 5 , 5 ) , 'successfully got pixel color.' ) ;
9+ t . ok ( pixelColor !== undefined , 'pixelColor is a valid value.' ) ;
10+ t . ok ( pixelColor . length === 6 , 'pixelColor is the correct length.' ) ;
11+ t . ok ( / ^ [ 0 - 9 A - F ] { 6 } $ / i. test ( pixelColor ) , "pixelColor is valid hex." ) ;
12+ } ) ;
13+
14+ test ( 'Get screen size.' , function ( t )
15+ {
16+ t . plan ( 3 ) ;
17+ t . ok ( screenSize = robot . getScreenSize ( ) , 'successfully got the screen size.' ) ;
18+ t . ok ( screenSize . width !== undefined , 'screenSize.width is a valid value.' ) ;
19+ t . ok ( screenSize . height !== undefined , 'screenSize.height is a valid value.' ) ;
20+ } ) ;
You can’t perform that action at this time.
0 commit comments