forked from octalmage/robotjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move keyboard tests to it's own file.
- Loading branch information
Showing
4 changed files
with
38 additions
and
98 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,6 @@ | |
"devDependencies": { | ||
"jasmine": "^3.0.0", | ||
"prebuild": "v6.1.0", | ||
"tape": "^3.5.0", | ||
"targetpractice": "0.0.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* jshint esversion: 6 */ | ||
var robot = require('../..'); | ||
var targetpractice = require('targetpractice/index.js'); | ||
var os = require('os'); | ||
|
||
robot.setMouseDelay(100); | ||
|
||
let target, elements; | ||
|
||
describe('Integration/Keyboard', () => { | ||
beforeEach(done => { | ||
target = targetpractice.start(); | ||
target.once('elements', message => { | ||
elements = message; | ||
done(); | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
targetpractice.stop(); | ||
target = null; | ||
}); | ||
|
||
it('types', done => { | ||
const stringToType = 'hello world'; | ||
// Currently Target Practice waits for the "user" to finish typing before sending the event. | ||
target.once('type', element => { | ||
expect(element.id).toEqual('input_1'); | ||
expect(element.text).toEqual(stringToType); | ||
done(); | ||
}); | ||
|
||
const input_1 = elements.input_1; | ||
robot.moveMouse(input_1.x, input_1.y); | ||
robot.mouseClick(); | ||
robot.typeString(stringToType); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters