Skip to content

[PROP] REP XXXX View Automation Dialect

Gregg Irwin edited this page Jul 25, 2018 · 1 revision

#REP XXXX - View Automation Dialect

REP: <Leave Blank>
Title: View Automation Dialect
Author(s): Peter W A Wood
Status: Draft
Date Created: <Leave blank>
Date Last Actioned: <Leave blank>

##Summary A Red dialect that would allow fully scripting of View layouts.

##Description The dialect would provide the ability to fully script Red View layouts. It would contain the following "commands":

--------Command----------- -------Arguments---------- Action
run script <file> <file> - filepath to a Red View script The dialect loads the file and intercepts any keyboard or mouse actions. If a key is pressed or mouse button clicked, the dialect would display an alert box asking if the user wishes to end the automation script run.
run layout <block>|<word>

<block> - block containing a Red View layout

<word> - word containing a reference to a Red View layout
The dialect loads the layout and intercepts any keyboard or mouse actions. If a key is pressed or mouse button clicked, the dialect would display an alert box asking if the user wishes to end the automation script run.
type <string> into <face-type> <word>

<string> - a Red string

<face-type> - the type of face e.g. field

<word> - word containing a reference to the face
Enters the string as though typed on the keyboard.
click on <face-type> <word>

<face-type> - the type of face e.g. button

<word> - word containing a reference to the face
Simulates a mouse click on the face
double click on <face-type> <word>

<face-type> - the type of face e.g. button

<word> - word containing a reference to the face
Simulates a double mouse click on the face
mouse over <face-type> <word>

<face-type> - the type of face e.g. button

<word> - word containing a reference to the face
Move the mouse pointer over the face
move mouse away from <face-type> <word>

<face-type> - the type of face e.g. button

<word> - word containing a reference to the face
Move the mouse pointer outside the specified face to a random location inside the the base layout window.
move mouse to <point> of <face-type> <word>

<point> - an x,y point (pair!)

<face-type> - the type of face e.g. button

<word> - word containing a reference to the face
Move mouse pointer to point x,y relative to the top left had corner of the face.
mouse down Simulate holding down the left mouse button at the current mouse pointer position.
mouse up Simulate releasing the left mouse button.
mouse right down Simulate holding down the right mouse button at the current mouse pointer position.
mouse right up Simulate releasing the left mouse button.
key <key> down <key> - character of key Simulate holding down the key at current cursor position.
key <key> up <key> - character of key Simulate relaeasing the key.
scroll <face-type> <word> up|down|right|left <number>

<face-type> - the type of face e.g. slider

<word> - word containing a reference to the face <number> - number of pixels to scroll
Scroll the specified face in the specified direction.
scroll <face-type> <word> to top|bottom|right|left edge

<face-type> - the type of face e.g. slider

<word> - word containing a reference to the face
Scroll the specified face to the specified edge.
perform <gesture> over <face-type> <word>

<gesture> - the type of gesture e.g. pinch zoom

<face-type> - the type of face e.g. image

<word> - word containing a reference to the face
Simulates the gesture over the specified face.

##Use Case The automation dialect could be used for demonstrations, tutorials, kiosk applications and automated GUI testing.

##Benefits Having built-in testing support for Red View applications will make Red more attractive to independent professional programmers who sell applications. It will increase the credibility of Red as a serious programming tool rather than something that is great to build quick, throw away and hobbyist apps.

Being able to automate Red View scripts will enable better tutorials to be written as the Red GUI console will be scriptable.

It will be possible to write an automated suite of tests for Red View itself.

##Consequences Introducing the dialect should raise no backward compatibility issues with Red View. The consequences are limited to the time required to build the dialect.

##Assistance I am willing to test and document the dialect.

##Community Support Do not complete until initial draft has been accepted.

The following people support the proposal in its entirety.

Real Name Github Account
<Real Name> <Link to Github Account>

##Debate The purpose of this section is to allow members of the community to succinctly express either (or both) the pros and cons of the proposal. Links to supporting information should be included.

This is not the place for long, discussion related to the proposal. The best place for such discussions would be the Red Mailing List as the conversations can be linked to from the proposal. Such discussions can also be held on Red Gitter Chat though they will not be preserved in such a convenient form as the mailing list.

This section will be curated by the Red Team.

Author: <The real name of the author.>

Date: <The date added to the proposal.>

Point: <The succinct reasons in support of or against the proposal.>

Clone this wiki locally