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 a physical US QWERTY keyboard.
 * The computer has an English (US) keyboard enabled in software.
 * 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)

N.B.: The words "right" and "left" in this document refer to sides. "Right" doesn't mean "correct" and "left" doesn't mean "not taken".

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:
 * 18) * 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.
 * 19) * Check: The cursor is at the left of the line, next to the exclamation mark.

Paragraph direction
This feature is not implemented yet. Reference bug: Bug 41010 - There's no way to specify the directionality of a paragraph.


 * 1) Press the toolbar button for changing the paragraph direction to left-to-right.
 * 2) * Check: The first line hasn't changed - it's still, at the right side of the line.
 * 3) * 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.
 * 4) Select the whole text (probably something like Ctrl-A)
 * 5) Press the toolbar button for changing the paragraph direction to right-to-left.
 * 6) * Check: The first line says aligned to the right.
 * 7) * Check: The second line says aligned to the right, with the exclamation mark at the left end.
 * 8) Press the keyboard shortcut for changing the paragraph direction to left-to-right.
 * 9) * Check: The first line says aligned to the left, with the question mark at the right end.
 * 10) * Check: The second line says aligned to the left, with the exclamation mark at the right end.
 * 11) Press the keyboard shortcut for changing the paragraph direction to right-to-left.
 * 12) * Check: The first line says aligned to the right, with the question mark at the left end.
 * 13) * 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.
 * 2) * Check: All the previous text was deleted and replaced by new text.
 * 3) * Check: The first line says, aligned to the right and the cursor is at the left end of the line.
 * 4) Press the right arrow on the keyboard (→).
 * 5) * Check: The cursor moved one character to the right and is between the letters of the two-letter word.
 * 6) Press the Home button (probably Ctrl-→ on a Mac).
 * 7) * Check: The cursor is at the right end of the line.
 * 8) Press the left arrow on the keyboard (←).
 * 9) * Check: The cursor moved one letter to the left and is between the first letter from the right and the apostrophe.
 * 10) Hold Shift and press ← three times.
 * 11) * Check: The words appear in the first line, aligned to the right.
 * 12) * Check: The letters are selected.
 * 13) Type.
 * 14) * Check: The words appear in the first line, aligned to the right.
 * 15) * Check: No text is selected.
 * 16) * Check: The cursor is on the right side of the space between two words.
 * 17) Hold Shift and press → three times.
 * 18) * Check: The text appear in the first line, aligned to the right.
 * 19) * Check: The letters are selected.
 * 20) Type
 * 21) * Check: The words appear in the first line, aligned to the right.
 * 22) * Check: No text is selected.
 * 23) * Check: The cursor is on the right side of the space between two words.
 * 24) Press Shift-Control-→ (Probably Shift-Command-→ on a Mac).
 * 25) * Check: The words appear in the first line, aligned to the right.
 * 26) * Check: The first word from the right is selected.
 * 27) Press the End key. (Probably Control-← on a Mac)
 * 28) * Check: The words appear in the first line, aligned to the right.
 * 29) * Check: No text is selected.
 * 30) * Check: The cursor is on the left end of the first line.
 * 31) Press Ctrl-→.
 * 32) * Check: The words appear in the first line, aligned to the right.
 * 33) * Check: The cursor is on the left side of the space between the two words.
 * 34) Press Ctrl-→.
 * 35) * Check: The words appear in the first line, aligned to the right.
 * 36) * Check: The cursor is in the right end of the first line.
 * 37) Press Ctrl-←.
 * 38) * Check: The words appear in the first line, aligned to the right.
 * 39) * Check: The cursor is in the right side of the space between the two words.
 * 40) Press Ctrl-←.
 * 41) * Check: The words appear in the first line, aligned to the right.
 * 42) * Check: The cursor is in the left end of the first line.
 * 43) Press Ctrl-←.
 * 44) Press Ctrl-Shift-→.
 * 45) * Check: The words appear in the first line, aligned to the right.
 * 46) * Check: The two letter word is selected.
 * 47) Press the End key.
 * 48) * Check: The words appear in the first line, aligned to the right.
 * 49) * Check: The cursor is in the left end of the first line.
 * 50) Press Shift-Home
 * 51) * Check: The words appear in the first line, aligned to the right.
 * 52) * Check: Both words are selected.
 * 53) Press the Home key.
 * 54) * Check: The words appear in the first line, aligned to the right.
 * 55) * Check: The cursor is in the right end of the first line.
 * 56) Press Shift-End
 * 57) * Check: The words appear in the first line, aligned to the right.
 * 58) * Check: Both words are selected.
 * 59) Press the End key.
 * 60) Press Enter twice.
 * 61) Type.
 * 62) * Check: The words appear in the first line, aligned to the right.
 * 63) * Check: The second line is empty.
 * 64) * Check: The word appears in the third line, aligned to the right, and the period is at the left end of the line.
 * 65) * Check: The cursor is at the left end of the third line.
 * 66) Press Ctrl-Home.
 * 67) * Check: The cursor is at the right end of the first line.
 * 68) Press Ctrl-End.
 * 69) * Check: The cursor is at the left end of the third line.
 * 70) Press Ctrl-Shift-Home.
 * 71) * Check: The whole text is selected.
 * 72) Press End.
 * 73) * Check: The cursor is at the left end of the first line.
 * 74) Press Ctrl-Shift-End.
 * 75) * Check: The first line is not selected.
 * 76) * Check: The second and the third line are selected.
 * 77) Press the Home key.
 * 78) * Check: No lines are selected.
 * 79) * Check: The cursor is at the right end of the third line.
 * 80) Press the Delete key (Mac: fn-delete).
 * 81) * Check: Nothing is selected.
 * 82) * Check: The third line says.
 * 83) * Check: The cursor is at the right end of the third line.
 * 84) Press the End key.
 * 85) Press the Backspace key ("delete" on Macs) twice.
 * 86) * Check: The cursor is at the left end of the third line.
 * 87) * Check: The third line says.

Inline direction

 * 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
 * 9) * Check: The first line says: . The number is to the right of the words . (This is intentionally incorrect display.)
 * 10) Select the words  (with any punctuation marks).
 * 11) Use the language setting button to set the language of the selected text to English.
 * 12) * Check: The first line says: . 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
 * 5) * Check: The words appear in the fifth line.
 * 6) Press the undo button (probably Ctrl-Z).
 * 7) * Check: The words appear in the fifth line.
 * 8) Press Ctrl-→ twice.
 * 9) Press Ctrl-Delete.
 * 10) * Check: The words appear in the fifth line.

Clusters in Arabic
Assumption: An Arabic keyboard layout is installed.


 * 1) Start in an empty editing window.
 * 2) * Check: The cursor is at the top right corner.
 * 3) Type.
 * 4) * Check: The word appears in the first line.
 * 5) * Check: The exclamation mark is at the left end of the first line.
 * 6) * Check: The cursor is to the left of the exclamation mark.
 * 7) Press the right arrow (→) four times.
 * 8) * Check: The cursor is between and.
 * 9) Hold down Shift and press the left arrow ← twice.
 * 10) * Check: is selected.
 * 11) Press Ctrl-End.
 * 12) Press Enter twice.
 * 13) Type.
 * 14) * Check: The word appears in the first line.
 * 15) * Check: The inverted question mark is at the left end of the first line.
 * 16) * Check: The cursor is to the left of the inverted question mark.
 * 17) Press the Home key.
 * 18) Hold down Shift and press the left arrow (←) four times.
 * 19) * Check: The word is selected.