Example usage for org.openqa.selenium Keys END

List of usage examples for org.openqa.selenium Keys END

Introduction

In this page you can find the example usage for org.openqa.selenium Keys END.

Prototype

Keys END

To view the source code for org.openqa.selenium Keys END.

Click Source Link

Usage

From source file:org.eclipse.che.selenium.editor.autocomplete.QuickFixAndCodeAssistantFeaturesTest.java

License:Open Source License

@Test
public void quickFixAndCodeAssistantTest() {
    projectExplorer.waitItem(PROJECT_NAME);
    notificationsPopupPanel.waitProgressPopupPanelClose();
    consoles.closeProcessesArea();/*from  w w w .  j  ava  2  s. c  o m*/
    projectExplorer.quickExpandWithJavaScript();
    projectExplorer.openItemByVisibleNameInExplorer("AppController.java");
    editor.waitActiveEditor();

    editor.setCursorToLine(28);
    editor.typeTextIntoEditor(TEXT_FOR_WARNING);
    editor.waitMarkerInPosition(WARNING_MARKER, 28);
    editor.launchPropositionAssistPanel();
    editor.waitTextIntoFixErrorProposition("Remove 'l', keep assignments with side effects");
    editor.waitTextIntoFixErrorProposition("Remove 'l' and all assignments");
    editor.typeTextIntoEditor(Keys.ESCAPE.toString());
    editor.waitErrorPropositionPanelClosed();

    editor.launchPropositionAssistPanel();
    editor.waitTextIntoFixErrorProposition("Convert local variable to field");
    editor.waitTextIntoFixErrorProposition("Inline local variable");
    editor.typeTextIntoEditor(Keys.ESCAPE.toString());
    editor.waitErrorPropositionPanelClosed();
    loader.waitOnClosed();
    editor.typeTextIntoEditor(Keys.END.toString());
    editor.typeTextIntoEditor("\n");

    editor.typeTextIntoEditor(TEXT_FOR_ERROR);
    editor.launchAutocompleteAndWaitContainer();
    //ide.getEditor().selectItemIntoAutocompleteAndPasteByDoubleClick("null"); //TODO cursor disappears IDEX-3353
    editor.enterAutocompleteProposal("null");
    projectExplorer.selectVisibleItem("AppController.java"); // TODO because the cursor disappears after click in the autocomplete panel
    projectExplorer.openItemByVisibleNameInExplorer("AppController.java");
    editor.typeTextIntoEditor(";");
    editor.waitMarkerInPosition(ERROR_MARKER, 29);
    editor.launchPropositionAssistPanel();
    editor.waitTextIntoFixErrorProposition("Change to 'ClassDesc' (javax.rmi.CORBA)");
    editor.waitTextIntoFixErrorProposition("Change to 'ClassUtils' (org.springframework.util)");
    editor.waitTextIntoFixErrorProposition("Change to 'ClassValue' (java.lang)");
    editor.waitTextIntoFixErrorProposition("Change to 'Class' (java.lang)");
    editor.typeTextIntoEditor(Keys.ESCAPE.toString());
    editor.waitErrorPropositionPanelClosed();
    editor.launchPropositionAssistPanel();
    editor.waitTextIntoFixErrorProposition("Change to 'ClassDesc' (javax.rmi.CORBA)");
    editor.waitTextIntoFixErrorProposition("Change to 'ClassUtils' (org.springframework.util)");
    editor.waitTextIntoFixErrorProposition("Change to 'ClassValue' (java.lang)");
    editor.waitTextIntoFixErrorProposition("Change to 'Class' (java.lang)");
}

From source file:org.eclipse.che.selenium.factory.CreateFactoryFromUiWithKeepDirTest.java

License:Open Source License

private void checkAutocompletion() {
    editor.setCursorToDefinedLineAndChar(18, 6);
    editor.typeTextIntoEditor(Keys.END.toString());
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor("Greeting");
    editor.launchAutocompleteAndWaitContainer();
    String textFromEditorAfterFirstCall = editor.getAllVisibleTextFromAutocomplete();
    for (String content : autocompleteContentAfterFirst) {
        assertTrue(textFromEditorAfterFirstCall.contains(content));
    }//from w w w.j a  va2  s.  co m
    editor.closeAutocomplete();
    editor.typeTextIntoEditor(" greeting =null;");
    editor.waitAllMarkersDisappear(ERROR_MARKER);
}

From source file:org.eclipse.che.selenium.git.AddFilesToIndexTest.java

License:Open Source License

@Test
public void addFilesTest() throws InterruptedException {
    projectExplorer.waitProjectExplorer();
    projectExplorer.openItemByPath(PROJECT_NAME);
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.INITIALIZE_REPOSITORY);
    askDialog.waitFormToOpen();/*  w  ww  .  ja  v a2  s .  c  o m*/
    askDialog.clickOkBtn();
    askDialog.waitFormToClose();
    git.waitGitStatusBarWithMess(TestGitConstants.GIT_INITIALIZED_SUCCESS);
    events.clickProjectEventsTab();
    events.waitExpectedMessage(TestGitConstants.GIT_INITIALIZED_SUCCESS);

    // perform init commit
    projectExplorer.quickExpandWithJavaScript();
    projectExplorer.selectItem(PROJECT_NAME);
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.COMMIT);
    git.waitAndRunCommit("init");
    loader.waitOnClosed();

    // check state of the index
    projectExplorer.selectItem(PROJECT_NAME);
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX);
    git.waitGitStatusBarWithMess(TestGitConstants.GIT_NOTHING_TO_ADD);
    events.clickProjectEventsTab();
    events.waitExpectedMessage(TestGitConstants.GIT_NOTHING_TO_ADD);

    //Edit index.jsp
    projectExplorer.openItemByVisibleNameInExplorer("index.jsp");
    editor.waitActiveEditor();
    editor.typeTextIntoEditor(Keys.PAGE_DOWN.toString());
    editor.typeTextIntoEditor(Keys.END.toString());
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor("<!-- Testing add to index-->");
    loader.waitOnClosed();

    //Add this file to index
    projectExplorer.selectItem(PROJECT_NAME + "/src/main/webapp/index.jsp");
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX);
    git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS);
    events.clickProjectEventsTab();
    events.waitExpectedMessage(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS);

    //Check status
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS);
    loader.waitOnClosed();
    git.waitGitStatusBarWithMess(STATUS_MESSAGE_ONE_FILE);

    //Edit GreetingController.java
    projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/org/eclipse/qa/examples/AppController.java");
    editor.waitActiveEditor();
    editor.setCursorToLine(16);
    editor.typeTextIntoEditor("//Testing add to index");
    loader.waitOnClosed();

    //Create new.css file
    projectExplorer.selectItem(PROJECT_NAME + "/src/main/webapp");
    menu.runCommand(TestMenuCommandsConstants.Project.PROJECT, TestMenuCommandsConstants.Project.New.NEW,
            TestMenuCommandsConstants.Project.New.CSS_FILE);
    askForValueDialog.waitFormToOpen();
    askForValueDialog.typeAndWaitText("new");
    askForValueDialog.clickOkBtn();

    //Add all files to index
    projectExplorer.selectItem(PROJECT_NAME);
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX);
    git.waitAddToIndexFormToOpen();
    git.waitAddToIndexFileName("Add content of folder " + PROJECT_NAME + " to index?");
    git.confirmAddToIndexForm();
    git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS);
    events.clickProjectEventsTab();
    events.waitExpectedMessage(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS);

    //Check status
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS);
    git.waitGitStatusBarWithMess(STATUS_MESSAGE_ALL_FILES);

    //Edit GreetingController.java
    editor.selectTabByName("AppController");
    editor.waitActiveEditor();
    editor.typeTextIntoEditor(Keys.DOWN.toString());
    editor.typeTextIntoEditor(Keys.DOWN.toString());
    editor.typeTextIntoEditor(Keys.DOWN.toString());
    editor.typeTextIntoEditor("//Testing add to index");
    loader.waitOnClosed();

    //Edit index.jsp
    editor.selectTabByName("index.jsp");
    editor.waitActiveEditor();
    editor.typeTextIntoEditor(Keys.PAGE_DOWN.toString());
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor("<!-- Testing add to index-->");
    loader.waitOnClosed();

    //Edit new.css
    editor.selectTabByName("new.css");
    editor.waitActiveEditor();
    editor.typeTextIntoEditor(Keys.PAGE_DOWN.toString());
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor("/* Testing add to index */");
    loader.waitOnClosed();

    //Check status and add to index all files
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS);
    git.waitGitStatusBarWithMess(STATUS_MESSAGE_AFTER_EDIT);
    projectExplorer.selectItem(PROJECT_NAME);
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX);
    git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS);

    // delete README file and add to index
    deleteFromMenuFile();
    projectExplorer.selectItem(PROJECT_NAME);
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX);
    git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS);
    menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS);
    git.waitGitStatusBarWithMess(STATUS_AFTER_DELETE_FILE);
}

From source file:org.eclipse.che.selenium.git.GitChangeMarkersTest.java

License:Open Source License

@Test
public void testModificationMarker() {
    projectExplorer.waitProjectExplorer();
    projectExplorer.openItemByPath(PROJECT_NAME);
    projectExplorer.quickExpandWithJavaScript();
    menu.runCommand(GIT, INITIALIZE_REPOSITORY);
    askDialog.waitFormToOpen();//from w  w  w  .  j a v a 2  s . c  o  m
    askDialog.clickOkBtn();
    askDialog.waitFormToClose();
    git.waitGitStatusBarWithMess(GIT_INITIALIZED_SUCCESS);
    events.clickEventLogBtn();
    events.waitExpectedMessage(GIT_INITIALIZED_SUCCESS);

    // perform init commit
    projectExplorer.waitAndSelectItem(PROJECT_NAME);
    menu.runCommand(GIT, TestMenuCommandsConstants.Git.COMMIT);
    git.waitAndRunCommit("init");
    loader.waitOnClosed();

    projectExplorer.openItemByPath(PROJECT_NAME + "/src/com/company/Main.java");
    editor.waitActive();
    editor.waitNoGitChangeMarkers();
    editor.typeTextIntoEditor("//", 11);
    editor.typeTextIntoEditor(Keys.END.toString());
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor(Keys.ENTER.toString());

    editor.waitGitModificationMarkerInPosition(11, 13);
}

From source file:org.eclipse.che.selenium.miscellaneous.WorkingWithTerminalTest.java

License:Open Source License

@Test(priority = 1)
public void shouldAppearMCDialogs() {
    terminal.typeIntoTerminal("cd ~ && touch -f testfile.txt" + Keys.ENTER);

    openMC("~");//  w ww. j  av a 2s.  co m
    //check F5
    terminal.typeIntoTerminal("" + Keys.END + Keys.F5);

    terminal.waitExpectedTextIntoTerminal("Copy file \"testfile.txt\" with source mask");
    terminal.typeIntoTerminal("" + Keys.ESCAPE + Keys.ESCAPE);

    //check F6
    terminal.typeIntoTerminal(Keys.F6.toString());
    terminal.waitExpectedTextIntoTerminal("Move file \"testfile.txt\" with source mask");
    terminal.typeIntoTerminal("" + Keys.ESCAPE + Keys.ESCAPE);

    //check F7
    terminal.typeIntoTerminal(Keys.F7.toString());
    terminal.waitExpectedTextIntoTerminal("Enter directory name:");
    terminal.typeIntoTerminal("" + Keys.ESCAPE + Keys.ESCAPE);

    //check F8
    terminal.typeIntoTerminal(Keys.F8.toString());
    terminal.waitExpectedTextIntoTerminal("Delete file");
    terminal.waitExpectedTextIntoTerminal("\"testfile.txt\"?");
    terminal.typeIntoTerminal("" + Keys.ESCAPE + Keys.ESCAPE);

    //check F9 - Select menu in MC
    terminal.typeIntoTerminal("" + Keys.F9 + Keys.ENTER);
    terminal.waitExpectedTextIntoTerminal("File listing");
    terminal.typeIntoTerminal("" + Keys.ESCAPE + Keys.ESCAPE);
}

From source file:org.eclipse.che.selenium.miscellaneous.WorkingWithTerminalTest.java

License:Open Source License

@Test(priority = 13)
public void shouldEditFileIntoMCEdit() {
    openMC("/projects/" + PROJECT_NAME);

    //check End, Home, F4, Delete keys
    terminal.typeIntoTerminal("" + Keys.END + Keys.ENTER + Keys.END + Keys.ARROW_UP + Keys.F4);
    //select editor
    terminal.typeIntoTerminal(valueOf(1) + Keys.ENTER);

    terminal.waitExpectedTextIntoTerminal(
            "README.md          " + "[----]  0 L:[  1+ 0   1/  1] *(0   /  21b) 0035 0x023");
    terminal.typeIntoTerminal("<!-some comment->");
    terminal.typeIntoTerminal(//from   w w w .  j a v  a  2 s.com
            "" + Keys.HOME + Keys.ARROW_RIGHT + Keys.ARROW_RIGHT + Keys.ARROW_RIGHT + Keys.DELETE);
    terminal.waitExpectedTextIntoTerminal("<!-ome comment->");
}

From source file:org.eclipse.che.selenium.pageobject.CheTerminal.java

License:Open Source License

/**
 * scroll terminal by pressing key 'End'
 *
 * @param item is the name of the highlighted item
 *//*from  w  ww.  java 2s.  c o  m*/
public void moveDownListTerminal(String item) {
    loader.waitOnClosed();
    typeIntoActiveTerminal(Keys.END.toString());
    WaitUtils.sleepQuietly(2);

    WebElement element = seleniumWebDriver
            .findElement(By.xpath(format("(//span[contains(text(), '%s')])[position()=1]", item)));

    if (!element.getCssValue("background-color").equals(LINE_HIGHLIGHTED_GREEN)) {
        typeIntoActiveTerminal(Keys.ARROW_UP.toString());
        element = seleniumWebDriver
                .findElement(By.xpath(format("(//span[contains(text(), '%s')])[position()=1]", item)));
        WaitUtils.sleepQuietly(2);
    }
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC).until(visibilityOf(element));
    WebElement finalElement = element;
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC).until(
            (WebDriver input) -> finalElement.getCssValue("background-color").equals(LINE_HIGHLIGHTED_GREEN));
}

From source file:org.eclipse.che.selenium.pageobject.CodenvyEditor.java

License:Open Source License

/**
 * Select text in defined interval/*from  ww  w.j av a2s  .c  o m*/
 *
 * @param fromLine beginning of first line for selection
 * @param numberOfLine end of first line for selection
 */
public void selectLines(int fromLine, int numberOfLine) {
    Actions action = seleniumWebDriverHelper.getAction(seleniumWebDriver);
    setCursorToLine(fromLine);
    action.keyDown(SHIFT).perform();
    for (int i = 0; i < numberOfLine; i++) {
        typeTextIntoEditor(Keys.ARROW_DOWN.toString());
    }
    action.keyUp(SHIFT).perform();
    action.sendKeys(Keys.END.toString()).keyUp(SHIFT).perform();
}

From source file:org.eclipse.che.selenium.pageobject.CodenvyEditor.java

License:Open Source License

/** Scroll autocomplete form to the bottom */
public void scrollAutocompleteFormToBottom() {
    webDriverWaitFactory.get(ELEMENT_TIMEOUT_SEC)
            .until(ExpectedConditions/*from ww w .  j a  va2  s .co  m*/
                    .visibilityOfElementLocated(By.xpath(Locators.AUTOCOMPLETE_CONTAINER + "/li[2]")))
            .sendKeys(Keys.END);
}

From source file:org.eclipse.che.selenium.pageobject.machineperspective.MachineTerminal.java

License:Open Source License

/**
 * scroll terminal by pressing key 'End'
 *
 * @param item is the name of the highlighted item
 *///from ww  w.  ja va 2 s .c o m
public void moveDownListTerminal(String item) {
    loader.waitOnClosed();
    actionsFactory.createAction(seleniumWebDriver).sendKeys(Keys.END.toString()).perform();
    WaitUtils.sleepQuietly(2);

    WebElement element = seleniumWebDriver
            .findElement(By.xpath(format("(//span[contains(text(), '%s')])[position()=1]", item)));
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC).until(visibilityOf(element));
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until((WebDriver input) -> element.getCssValue("background-color").equals(LINE_HIGHLIGHTED_GREEN));
}