We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1208cf8 commit 790c3c6Copy full SHA for 790c3c6
test/screen.js
@@ -0,0 +1,20 @@
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-9A-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
0 commit comments