Fail the test if the key binding was not found.

This commit is contained in:
Michel Kaporin 2017-06-13 10:34:03 +02:00
parent 631e0a74ee
commit 24c9b09925

View file

@ -152,6 +152,10 @@ export class SpectronApplication {
*/
public command(command: string, capture?: boolean): Promise<any> {
const binding = this.keybindings.find(x => x['command'] === command);
if (!binding) {
throw new Error(`Key binding for ${command} was not found`);
}
const keys: string = binding.key;
let keysToPress: string[] = [];