VisualEditor/Typing/Right-to-left

Introduction
This is an acceptance test procedure for typing in a right-to-left language in the VisualEditor.

The basic typing test is done using Hebrew, because Hebrew characters should be easier to discern than of the other alphabets. Special features of complex RTL scripts will be checked in other tests.

Basic assumptions

 * Visual Editor is completely installed and configured (Parsoid etc.)
 * LocalSettings.php:
 * The computer has an English (US) keyboard enabled.
 * The computer has a Hebrew keyboard enabled. (TODO: Which one? Specify for Mac, Desktop Linux, Windows.)
 * The computer has a Hebrew font installed.
 * The user interface of the wiki is Hebrew (change using preferences or ULS)

TODO: Before publishing, check that all usages of the words "right" and "left" are clear to the reader.

Basic typing

 * 1) Start a new article that doesn't exist.
 * 2) Start editing it using the Visual Editor.
 * 3) * Check: The cursor is at the top right corner.
 * 4) Type.
 * 5) * Check: The letter appears on the screen in the top right corner.
 * 6) * Check: The cursor is immediately to the left of the letter.
 * 7) Type.
 * 8) * Check: The letters appear on the screen in the top right corner.
 * 9) * Check: The cursor is immediately to the left of the letters.
 * 10) Type
 * 11) * Check: The letters appear on the screen in the top right corner. From right to left:, then , then.
 * 12) * Check: The cursor is immediately to the left of the question mark.
 * 13) Press Enter.
 * 14) * Check: The first line didn't change.
 * 15) * The cursor is at the right end of the second line.
 * 16) Switch the keyboard layout to English
 * 17) Type in English:
 * Check: The text appears as at the right side of the second line. The exclamation mark must appear on the left end, next to the letter.
 * Check: The cursor is at the left of the line, next to the exclamation mark.

Paragraph direction
not implemented yet


 * 1) Press the toolbar button for changing the paragraph direction to left-to-right.
 * Check: The first line hasn't changed - it's still, at the right side of the line.
 * Check: The second line now has the text at the left side of the line, with the exclamation mark on the right side of the word, next to the letter.
 * 1) Select the whole text (probably something like Ctrl-A)
 * 2) Press the toolbar button for changing the paragraph direction to right-to-left.
 * Check: The first line says aligned to the right.
 * Check: The second line says aligned to the right, with the exclamation mark at the left end.
 * 1) Press the keyboard shortcut for changing the paragraph direction to left-to-right.
 * Check: The first line says aligned to the left, with the question mark at the right end.
 * Check: The second line says aligned to the left, with the exclamation mark at the right end.
 * 1) Press the keyboard shortcut for changing the paragraph direction to right-to-left.
 * Check: The first line says aligned to the right, with the question mark at the left end.
 * Check: The second line says aligned to the right, with the exclamation mark at the left end.

Keyboard shortcuts for movement and selection

 * 1) While the whole text is selected, change the keyboard layout to Hebrew and type.
 * Check: All the previous text was deleted and replaced by new text.
 * Check: The first line says, aligned to the right and the cursor is at the left end of the line.
 * 1) Press the right arrow on the keyboard (→).
 * Check: The cursor moved one character to the right and is between the letters of the two-letter word.
 * 1) Press the Home button (probably Ctrl-→ on a Mac).
 * Check: The cursor is at the right end of the line.
 * 1) Press the left arrow on the keyboard (←).
 * Check: The cursor moved one letter to the left and is between the first letter from the right and the apostrophe.
 * 1) Hold Shift and press ← three times.
 * Check: The words appear in the first line, aligned to the right.
 * Check: The letters are selected.
 * 1) Type.
 * Check: The words appear in the first line, aligned to the right.
 * Check: No text is selected.
 * Check: The cursor is on the right side of the space between two words.
 * 1) Hold Shift and press → three times.
 * Check: The text appear in the first line, aligned to the right.
 * Check: The letters are selected.
 * 1) Type
 * Check: The words appear in the first line, aligned to the right.
 * Check: No text is selected.
 * Check: The cursor is on the right side of the space between two words.
 * 1) Press Shift-Control-→ (Probably Shift-Command-→ on a Mac).
 * Check: The words appear in the first line, aligned to the right.
 * Check: The first word from the right is selected.
 * 1) Press the End key. (Probably Control-← on a Mac)
 * Check: The words appear in the first line, aligned to the right.
 * Check: The cursor is on the left end of the first line.
 * 1) Press Ctrl-→.
 * Check: The words appear in the first line, aligned to the right.
 * Check: The cursor is in the left side of the space between the two words.
 * 1) Press Ctrl-→.
 * Check: The words appear in the first line, aligned to the right.
 * Check: The cursor is in the right end of the first line.
 * 1) Press Ctrl-←.
 * Check: The words appear in the first line, aligned to the right.
 * Check: The cursor is in the left side of the space between the two words.
 * 1) Press Ctrl-←.
 * Check: The words appear in the first line, aligned to the right.
 * Check: The cursor is in the right end of the first line.
 * 1) Press Ctrl-←.
 * 2) Press Ctrl-Shift-←
 * Check: The words appear in the first line, aligned to the right.
 * Check: The two letter word is selected.
 * 1) Press the End key.
 * Check: The words appear in the first line, aligned to the right.
 * Check: The cursor is in the left end of the first line.
 * 1) Press Shift-Home
 * Check: The words appear in the first line, aligned to the right.
 * Check: Both words are selected.
 * 1) Press the Home key.
 * Check: The words appear in the first line, aligned to the right.
 * Check: The cursor is in the right end of the first line.
 * 1) Press Shift-End
 * Check: The words appear in the first line, aligned to the right.
 * Check: Both words are selected.
 * 1) Press the End key.
 * 2) Press Enter twice.
 * 3) Type.
 * Check: The words appear in the first line, aligned to the right.
 * Check: The second line is empty.
 * Check: The word appears in the third line, aligned to the right, and the period is at the left end of the line.
 * Check: The cursor is at the left end of the third line.
 * 1) Press Ctrl-Home.
 * Check: The cursor is at the right end of the first line.
 * 1) Press Ctrl-End.
 * Check: The cursor is at the right end of the third line.
 * 1) Press Ctrl-Shift-Home.
 * Check: The whole text is selected.
 * 1) Press End.
 * Check: The cursor is at the left end of the first line.
 * 1) Press Ctrl-Shift-End.
 * Check: The first line is not selected.
 * Check: The second and the third line are selected.
 * 1) Press the Home key.
 * 2) Press the Delete key (Mac: fn-delete).
 * Check: Nothing is selected.
 * Check: The third line says.
 * Check: The cursor is at the right end of the third line.
 * 1) Press the End key.
 * 2) Press the Backspace key ("delete" on Macs).
 * Check: The cursor is at the left end of the third line.
 * Check: The third line says.

Inline direction
not implemented yet


 * 1) Press Ctrl-Home.
 * 2) Press End.
 * 3) Type one space.
 * 4) Switch the keyboard layout to English.
 * 5) Type
 * 6) Type one space.
 * 7) Switch to the Hebrew keyboard
 * 8) Type
 * Check: The first line says: . The number is to the right of the words . (This is intentionally incorrect display.)
 * 1) Select the words  (with any punctuation marks).
 * 2) This is the unimplemented part, which is the main point of this test: Perform the operation, which defines the language of the selection to English (lang="en"), with isolated directionality (should be the default). (The operation is described in the Bidirectional text requirements document).
 * Check: The semicolon appears to the left of the words, and the number appears to the left of the semicolon.

More shortcuts

 * 1) Press Ctrl-End.
 * 2) Press Enter twice.
 * 3) Type.
 * 4) Press Ctrl-Backspace
 * Check: The words appear in the fifth line.
 * 1) Press the undo button (probably Ctrl-Z).
 * Check: The words appear in the fifth line.
 * 1) Press Ctrl-→ twice.
 * 2) Press Ctrl-Delete.
 * Check: The words appear in the fifth line.