Skip to content

Commit

Permalink
hardened-screen-test
Browse files Browse the repository at this point in the history
  • Loading branch information
FossPrime committed Mar 31, 2020
1 parent 603de61 commit 7a6b060
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/integration/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@ describe('Integration/Screen', () => {
target = null;
});

it('reads a pixel color', () => {
var color_1 = elements.color_1;
const color = robot.getPixelColor(color_1.x, color_1.y);
expect(color).toEqual('c0ff33');
it('reads a pixel color', (done) => {
const maxDelay = 1000
jasmine.DEFAULT_TIMEOUT_INTERVAL = maxDelay + 1000
const expected = 'c0ff33'
const color_1 = elements.color_1;
const sleepTime = robot.getPixelColor(color_1.x, color_1.y) === expected ? 0
: maxDelay

setTimeout(() => {
const color = robot.getPixelColor(color_1.x, color_1.y);
expect(color).toEqual(expected);
done()
}, sleepTime)
});
});

0 comments on commit 7a6b060

Please sign in to comment.