askui
Version:
Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on
16 lines (15 loc) • 550 B
JavaScript
import { InputEvent } from './input-event';
export class Action {
constructor(inputEvent, position, text, parameters = {}) {
this.inputEvent = inputEvent;
this.position = position;
this.text = text;
this.parameters = parameters;
}
static fromJson(action, resizeRatio = 1) {
return new Action(InputEvent[action.inputEvent], {
x: action.position.x * resizeRatio,
y: action.position.y * resizeRatio,
}, action.text, action.parameters ? action.parameters : {});
}
}