Skip to content

Commit

Permalink
Tests for getPixelColor and getScreenSize.
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Jul 19, 2015
1 parent 1208cf8 commit 790c3c6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/screen.js
@@ -0,0 +1,20 @@
var test = require('tape');
var robot = require('..');
var pixelColor, screenSize;

test('Get pixel color.', function(t)
{
t.plan(4);
t.ok(pixelColor = robot.getPixelColor(5, 5), 'successfully got pixel color.');
t.ok(pixelColor !== undefined, 'pixelColor is a valid value.');
t.ok(pixelColor.length === 6, 'pixelColor is the correct length.');
t.ok(/^[0-9A-F]{6}$/i.test(pixelColor), "pixelColor is valid hex.");
});

test('Get screen size.', function(t)
{
t.plan(3);
t.ok(screenSize = robot.getScreenSize(), 'successfully got the screen size.');
t.ok(screenSize.width !== undefined, 'screenSize.width is a valid value.');
t.ok(screenSize.height !== undefined, 'screenSize.height is a valid value.');
});

0 comments on commit 790c3c6

Please sign in to comment.