@@ -28,7 +28,7 @@ public class ContextMenuTests extends InlineCssTextAreaAppTest {
2828 @ Test
2929 public void clickingSecondaryShowsContextMenu () {
3030 // when
31- rightClickOn ( area );
31+ rightClickOnFirstLine ( );
3232
3333 // then
3434 assertTrue (area .getContextMenu ().isShowing ());
@@ -37,8 +37,7 @@ public void clickingSecondaryShowsContextMenu() {
3737 @ Test
3838 public void pressingSecondaryShowsContextMenu () {
3939 // when
40- moveTo (area );
41- press (MouseButton .SECONDARY );
40+ rightClickOnFirstLine ();
4241
4342 // then
4443 assertTrue (area .getContextMenu ().isShowing ());
@@ -47,7 +46,7 @@ public void pressingSecondaryShowsContextMenu() {
4746 @ Test
4847 public void pressingPrimaryMouseButtonHidesContextMenu () {
4948 // given menu is showing
50- rightClickOn ( area );
49+ rightClickOnFirstLine ( );
5150
5251 press (MouseButton .PRIMARY );
5352 assertFalse (area .getContextMenu ().isShowing ());
@@ -56,7 +55,7 @@ public void pressingPrimaryMouseButtonHidesContextMenu() {
5655 @ Test
5756 public void pressingMiddleMouseButtonHidesContextMenu () {
5857 // given menu is showing
59- rightClickOn ( area );
58+ rightClickOnFirstLine ( );
6059
6160 press (MouseButton .MIDDLE );
6261 assertFalse (area .getContextMenu ().isShowing ());
@@ -66,10 +65,10 @@ public void pressingMiddleMouseButtonHidesContextMenu() {
6665 @ Test
6766 public void requestingContextMenuViaKeyboardWorksOnWindows () {
6867 if (WINDOWS_OS ) {
69- clickOn ( area );
68+ leftClickOnFirstLine ( );
7069 push (KeyCode .CONTEXT_MENU );
7170
72- assert area .getContextMenu ().isShowing ();
71+ assertTrue ( area .getContextMenu ().isShowing () );
7372 }
7473 }
7574
@@ -104,21 +103,21 @@ public void shiftClickingAreaDoesNothing() {
104103
105104 @ Test
106105 public void singleClickingAreaDoesNothing () {
107- clickOn ( area );
106+ leftClickOnFirstLine ( );
108107
109108 assertFalse (area .isFocused ());
110109 }
111110
112111 @ Test
113112 public void doubleClickingAreaDoesNothing () {
114- doubleClickOn ( area );
113+ doubleClickOnFirstLine ( );
115114
116115 assertFalse (area .isFocused ());
117116 }
118117
119118 @ Test
120119 public void tripleClickingAreaDoesNothing () {
121- clickOn ( area , MouseButton . PRIMARY ). doubleClickOn ( MouseButton . PRIMARY );
120+ tripleClickOnFirstLine ( );
122121
123122 assertFalse (area .isFocused ());
124123 }
@@ -372,8 +371,8 @@ public void typingALetterMovesTheCaretAfterThatInsertedLetter() {
372371 area .clear ();
373372 });
374373
375- String userInputtedText = "some user-inputted text" ;
376- clickOn ( area ).write (userInputtedText );
374+ String userInputtedText = "some text" ;
375+ leftClickOnFirstLine ( ).write (userInputtedText );
377376
378377 assertEquals (userInputtedText , area .getText ());
379378 assertEquals (userInputtedText .length (), area .getCaretPosition ());
0 commit comments