Search in sources :

Example 1 with EditorMouseFixture

use of com.intellij.testFramework.fixtures.EditorMouseFixture in project intellij-community by JetBrains.

the class FindInEditorTest method testSecondFind.

public void testSecondFind() throws Exception {
    configureFromText("<selection>a<caret></selection> b b a");
    invokeFind();
    new EditorMouseFixture((EditorImpl) myEditor).doubleClickAt(0, 3);
    invokeFind();
    checkResultByText("a <selection>b<caret></selection> b a");
}
Also used : EditorMouseFixture(com.intellij.testFramework.fixtures.EditorMouseFixture) EditorImpl(com.intellij.openapi.editor.impl.EditorImpl)

Example 2 with EditorMouseFixture

use of com.intellij.testFramework.fixtures.EditorMouseFixture in project intellij-community by JetBrains.

the class EditorLastActionTrackerTest method testMouseClickClearsLastAction.

public void testMouseClickClearsLastAction() throws Exception {
    new EditorMouseFixture((EditorImpl) myFixture.getEditor()).clickAt(0, 1);
    assertNull(myTracker.getLastActionId());
}
Also used : EditorMouseFixture(com.intellij.testFramework.fixtures.EditorMouseFixture)

Example 3 with EditorMouseFixture

use of com.intellij.testFramework.fixtures.EditorMouseFixture in project intellij-community by JetBrains.

the class EditorMultiCaretTest method testMiddleButtonDragStartingFromVirtualSpace.

public void testMiddleButtonDragStartingFromVirtualSpace() throws Exception {
    initText("<caret>line\n" + "long line\n" + "very long line\n" + "long line\n" + "line");
    setEditorVisibleSize(1000, 1000);
    EditorMouseFixture mouse = mouse();
    mouse.middle().pressAt(1, 17);
    checkResultByText("line\n" + "long line<caret>\n" + "very long line\n" + "long line\n" + "line");
    mouse.dragTo(2, 16);
    checkResultByText("line\n" + "long line<caret>\n" + "very long line<caret>\n" + "long line\n" + "line");
    mouse.dragTo(3, 12);
    checkResultByText("line\n" + "long line\n" + "very long li<selection><caret>ne</selection>\n" + "long line\n" + "line");
    mouse.dragTo(3, 6).release();
    checkResultByText("line\n" + "long l<selection><caret>ine</selection>\n" + "very l<selection><caret>ong line</selection>\n" + "long l<selection><caret>ine</selection>\n" + "line");
}
Also used : EditorMouseFixture(com.intellij.testFramework.fixtures.EditorMouseFixture)

Example 4 with EditorMouseFixture

use of com.intellij.testFramework.fixtures.EditorMouseFixture in project intellij-community by JetBrains.

the class FindInEditorMultiCaretTest method testActionsInEditorWorkIndependently.

public void testActionsInEditorWorkIndependently() throws IOException {
    init("abc\n" + "abc\n" + "abc");
    initFind();
    setTextToFind("b");
    checkResultByText("a<selection>b<caret></selection>c\n" + "abc\n" + "abc");
    new EditorMouseFixture((EditorImpl) myFixture.getEditor()).clickAt(0, 1);
    addOccurrenceFromEditor();
    addOccurrenceFromEditor();
    checkResultByText("<selection>a<caret>bc</selection>\n" + "<selection>a<caret>bc</selection>\n" + "abc");
    nextOccurrenceFromEditor();
    checkResultByText("<selection>a<caret>bc</selection>\n" + "abc\n" + "<selection>a<caret>bc</selection>");
    prevOccurrenceFromEditor();
    checkResultByText("<selection>a<caret>bc</selection>\n" + "<selection>a<caret>bc</selection>\n" + "abc");
    removeOccurrenceFromEditor();
    checkResultByText("<selection>a<caret>bc</selection>\n" + "abc\n" + "abc");
    allOccurrencesFromEditor();
    checkResultByText("<selection>a<caret>bc</selection>\n" + "<selection>a<caret>bc</selection>\n" + "<selection>a<caret>bc</selection>");
    assertNotNull(getEditorSearchComponent());
}
Also used : EditorMouseFixture(com.intellij.testFramework.fixtures.EditorMouseFixture) EditorImpl(com.intellij.openapi.editor.impl.EditorImpl)

Example 5 with EditorMouseFixture

use of com.intellij.testFramework.fixtures.EditorMouseFixture in project intellij-community by JetBrains.

the class FindInEditorMultiCaretTest method testFindNextRetainsOnlyOneCaretIfNotUsedAsMoveToNextOccurrence.

public void testFindNextRetainsOnlyOneCaretIfNotUsedAsMoveToNextOccurrence() throws Exception {
    init("<caret>To be or not to be?");
    initFind();
    setTextToFind("be");
    checkResultByText("To <selection>be<caret></selection> or not to be?");
    closeFind();
    // adding second caret
    new EditorMouseFixture((EditorImpl) myFixture.getEditor()).alt().shift().clickAt(0, 8);
    checkResultByText("To <selection>be<caret></selection> or<caret> not to be?");
    nextOccurrenceFromEditor();
    checkResultByText("To be or not to <selection>be<caret></selection>?");
}
Also used : EditorMouseFixture(com.intellij.testFramework.fixtures.EditorMouseFixture) EditorImpl(com.intellij.openapi.editor.impl.EditorImpl)

Aggregations

EditorMouseFixture (com.intellij.testFramework.fixtures.EditorMouseFixture)7 EditorImpl (com.intellij.openapi.editor.impl.EditorImpl)3