Example usage for org.openqa.selenium Keys ENTER

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

Introduction

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

Prototype

Keys ENTER

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

Click Source Link

Usage

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

License:Open Source License

@Test(priority = 1)
public void testUntrackedFileColorFromTerminal() {
    // Remove file from index
    terminal.selectTerminalTab();//from  w  ww.j  av a  2s . com
    terminal.typeIntoTerminal("cd " + PROJECT_NAME + Keys.ENTER);
    terminal.typeIntoTerminal("git rm --cached README.md" + Keys.ENTER);

    // Check file colors are yellow
    projectExplorer.waitYellowNode(PROJECT_NAME + "/README.md");
    editor.waitYellowTab("README.md");

    // Add to index
    terminal.typeIntoTerminal("git add README.md" + Keys.ENTER);

    // Check files are in default color
    projectExplorer.waitDefaultColorNode(PROJECT_NAME + "/README.md");
    editor.waitDefaultColorTab("README.md");
}

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

License:Open Source License

@Test(priority = 3)
public void testModifiedFilesColor() {
    // Check file is colored in default color
    projectExplorer.waitDefaultColorNode(PROJECT_NAME + "/README.md");
    editor.waitDefaultColorTab("README.md");

    // Make a change
    editor.selectTabByName("README.md");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.waitTabFileWithSavedStatus("README.md");
    projectExplorer.waitBlueNode(PROJECT_NAME + "/README.md");
    editor.waitBlueTab("README.md");

    // check that the file color is blue
    editor.typeTextIntoEditor(Keys.BACK_SPACE.toString());
    editor.waitTabFileWithSavedStatus("README.md");
    projectExplorer.waitDefaultColorNode(PROJECT_NAME + "/README.md");
    editor.waitDefaultColorTab("README.md");
}

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

License:Open Source License

@Test(priority = 5)
public void testFileColorsAfterCommitFromTerminal() {
    // Soft reset to previous commit
    menu.runCommand(GIT, RESET);//from  w w w .ja v a2s  .  c o m
    git.waitResetWindowOpen();
    git.selectCommitResetWindow(2);
    git.selectSoftReset();
    git.clickResetBtn();
    git.waitResetWindowClose();

    loader.waitOnClosed();
    terminal.selectTerminalTab();
    terminal.typeIntoTerminal("cd " + PROJECT_NAME + Keys.ENTER);
    terminal.typeIntoTerminal("git config --global user.email \"git@email.com\"" + Keys.ENTER);
    terminal.typeIntoTerminal("git config --global user.name \"name\"" + Keys.ENTER);
    terminal.typeIntoTerminal("git commit -a -m 'Terminal commit'" + Keys.ENTER);
    terminal.waitExpectedTextIntoTerminal("2 files changed, 1 insertion(+), 1 deletion(-)");

    // Check files are colored in default color
    projectExplorer.waitDefaultColorNode(PROJECT_NAME + "/newFile");
    projectExplorer.waitDefaultColorNode(PROJECT_NAME + "/README.md");
    editor.waitDefaultColorTab("newFile");
    editor.waitDefaultColorTab("README.md");
}

From source file:org.eclipse.che.selenium.intelligencecommand.AutocompleteCommandsEditorTest.java

License:Open Source License

@Test(priority = 1)
public void checkAutocompleteCommandLine() {
    projectExplorer.waitProjectExplorer();
    projectExplorer.waitItem(PROJ_NAME);
    projectExplorer.quickExpandWithJavaScript();
    projectExplorer.waitItem(PATH_TO_JAVA_FILE);
    projectExplorer.openItemByPath(PATH_TO_JAVA_FILE);
    createMavenCommand();/*  w w  w .j a  v  a2s.  c  o  m*/
    commandsEditor.setFocusIntoTypeCommandsEditor(COMMAND_LINE_EDITOR);
    commandsEditor.setCursorToLine(1);
    commandsEditor.deleteAllContent();
    commandsEditor.typeTextIntoEditor(MAVEN_COMMAND);
    commandsEditor.waitTextIntoEditor(MAVEN_COMMAND);
    commandsEditor.typeTextIntoEditor(Keys.ENTER.toString());
    commandsEditor.waitActiveEditor();
    commandsEditor.typeTextIntoEditor("echo ");
    commandsEditor.typeTextIntoEditor("type");
    commandsEditor.launchAutocompleteAndWaitContainer();
    String[] autocompleteItems = { "${editor.current.project.", "${explorer.current.project." };
    for (String autocompleteItem : autocompleteItems) {
        commandsEditor.waitTextIntoAutocompleteContainer(autocompleteItem);
    }
    commandsEditor.selectAutocompleteProposal("${explorer.current.project.");
    commandsEditor.waitTextIntoDescriptionMacrosForm("Project type of the file currently selected in explorer");
    commandsEditor.enterAutocompleteProposal("${editor.current.project.");
    commandsEditor.waitAutocompleteContainerIsClosed();
    commandsEditor.waitTextIntoEditor("${editor.current.project.type");
    commandsEditor.typeTextIntoEditor(Keys.ENTER.toString());
    commandsEditor.waitActiveEditor();
    commandsEditor.typeTextIntoEditor("echo ");
    commandsEditor.typeTextIntoEditor("na");
    commandsEditor.launchAutocompleteAndWaitContainer();
    commandsEditor.selectItemIntoAutocompleteAndPasteByDoubleClick("${explorer.current.project.");
    commandsEditor.waitAutocompleteContainerIsClosed();
    commandsEditor.waitTextIntoEditor("${explorer.current.project.name");
    commandsEditor.clickOnRunButton();
    consoles.waitExpectedTextIntoConsole(BUILD_SUCCESS);
    consoles.waitExpectedTextIntoConsole("maven");
    consoles.waitExpectedTextIntoConsole(PROJ_NAME);
}

From source file:org.eclipse.che.selenium.intelligencecommand.AutocompleteCommandsEditorTest.java

License:Open Source License

@Test(priority = 2)
public void checkAutocompletePreviewUrl() {
    commandsEditor.typeTextIntoEditor(Keys.ESCAPE.toString());
    commandsEditor.setFocusIntoTypeCommandsEditor(PREVIEW_URL_EDITOR);
    commandsEditor.setCursorToLine(1);//from   www.  j ava  2  s.  c  o m
    commandsEditor.deleteAllContent();
    commandsEditor.typeTextIntoEditor("port.80");
    commandsEditor.launchAutocompleteAndWaitContainer();
    String[] autocompleteItems = { "${server.port.8000/tcp}", "${server.port.8000}", "${server.port.8080/tcp}",
            "${server.port.8080}" };
    for (String autocompleteItem : autocompleteItems) {
        commandsEditor.waitTextIntoAutocompleteContainer(autocompleteItem);
    }
    commandsEditor.selectAutocompleteProposal("80/tcp}");
    commandsEditor.waitTextIntoDescriptionMacrosForm(
            "Returns external address of the server running on port 8080/tcp");
    commandsEditor.closeAutocomplete();
    commandsEditor.waitActiveEditor();
    commandsEditor.deleteAllContent();
    commandsEditor.typeTextIntoEditor("80.host");
    commandsEditor.launchAutocompleteAndWaitContainer();
    commandsEditor.selectItemIntoAutocompleteAndPasteByDoubleClick("${server.80");
    commandsEditor.waitTextIntoEditor("${server.8080.hostname}");
    commandsEditor.typeTextIntoEditor(Keys.ENTER.toString());
    commandsEditor.waitActiveEditor();
    commandsEditor.typeTextIntoEditor("8080.pro");
    commandsEditor.launchAutocomplete();
    commandsEditor.waitTextIntoEditor("${server.8080.protocol}");
    commandsEditor.clickOnRunButton();
    consoles.waitExpectedTextIntoConsole(BUILD_SUCCESS);
    consoles.waitExpectedTextIntoPreviewUrl("tomcat8 http");
}

From source file:org.eclipse.che.selenium.intelligencecommand.MacrosCommandsEditorTest.java

License:Open Source License

@Test(priority = 1)
public void checkCommandMacrosIntoCommandLine() {
    projectExplorer.waitProjectExplorer();
    projectExplorer.waitItem(PROJ_NAME);
    projectExplorer.quickExpandWithJavaScript();
    projectExplorer.waitItem(PATH_TO_FILE);
    projectExplorer.openItemByPath(PATH_TO_FILE);
    createNewJavaCommand();/*from   w  w  w . j a  v  a2  s.  c o m*/
    commandsEditor.selectMacrosLinkInCommandsEditor(EDITOR_MACROS_LINK);
    commandsEditor.cancelFormInEditorByEscape();
    commandsEditor.waitCommandsMacrosIsClosed();
    commandsEditor.setFocusIntoTypeCommandsEditor(COMMAND_LINE_EDITOR);
    commandsEditor.setCursorToLine(1);
    commandsEditor.typeTextIntoEditor(Keys.ENTER.toString());
    commandsEditor.typeTextIntoEditor(Keys.ARROW_UP.toString());
    commandsEditor.waitActiveEditor();
    commandsEditor.typeTextIntoEditor("echo ");
    commandsEditor.selectMacrosLinkInCommandsEditor(EDITOR_MACROS_LINK);
    commandsEditor.typeTextIntoSearchMacroField("rel");
    commandsEditor.waitTextIntoSearchMacroField("rel");
    String[] macrosItems = { "${current.project.relpath}", "${editor.current.file.relpath}",
            "${explorer.current.file.relpath}",
            "Path relative to the /projects folder to the selected file in editor",
            "Path relative to the /projects folder in project tree" };
    for (String macrosItem : macrosItems) {
        commandsEditor.waitTextIntoMacrosContainer(macrosItem);
    }
    commandsEditor.enterMacroCommandByEnter("${explorer.current.file.relpath}");
    commandsEditor.waitTextIntoEditor("echo ${explorer.current.file.relpath}");
    commandsEditor.clickOnRunButton();
    consoles.waitExpectedTextIntoConsole("/" + PROJ_NAME + "/src/Main.java");
    commandsEditor.setCursorToLine(1);
    commandsEditor.selectLineAndDelete();
    commandsEditor.waitActiveEditor();
    commandsEditor.typeTextIntoEditor("echo ");
    commandsEditor.selectMacrosLinkInCommandsEditor(EDITOR_MACROS_LINK);
    commandsEditor.selectMacroCommand("${current.class.fqn}");
    commandsEditor.typeTextIntoEditor(Keys.ARROW_DOWN.toString());
    commandsEditor.typeTextIntoEditor(Keys.SPACE.toString());
    commandsEditor.waitMacroCommandIsSelected("${current.project.path}");
    commandsEditor.enterMacroCommandByDoubleClick("${current.project.path}");
    commandsEditor.waitTextIntoEditor("echo ${current.project.path}");
    commandsEditor.clickOnRunButton();
    consoles.waitExpectedTextIntoConsole("/projects/" + PROJ_NAME);
}

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

License:Open Source License

@Test
public void checkFileStructureCodeEditor() {
    projectExplorer.waitProjectExplorer();
    projectExplorer.openItemByPath(PROJECT_NAME);
    expandTReeProjectAndOpenClass(JAVA_FILE_NAME);

    // check the highlighted item in editor
    menu.runCommand(TestMenuCommandsConstants.Assistant.ASSISTANT,
            TestMenuCommandsConstants.Assistant.FILE_STRUCTURE);
    fileStructure.waitFileStructureFormIsOpen(JAVA_FILE_NAME);
    fileStructure.selectItemInFileStructureByDoubleClick("getInstance() : Company");
    fileStructure.waitFileStructureFormIsClosed();
    editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString());
    editor.waitTextElementsActiveLine("getInstance");
    editor.waitSpecifiedValueForLineAndChar(40, 27);

    menu.runCommand(TestMenuCommandsConstants.Assistant.ASSISTANT,
            TestMenuCommandsConstants.Assistant.FILE_STRUCTURE);
    fileStructure.waitFileStructureFormIsOpen(JAVA_FILE_NAME);
    fileStructure.selectItemInFileStructureByEnter("INSTANCE");
    fileStructure.waitFileStructureFormIsClosed();
    editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString());
    editor.waitTextElementsActiveLine("INSTANCE");
    editor.waitSpecifiedValueForLineAndChar(24, 38);

    menu.runCommand(TestMenuCommandsConstants.Assistant.ASSISTANT,
            TestMenuCommandsConstants.Assistant.FILE_STRUCTURE);
    fileStructure.waitFileStructureFormIsOpen(JAVA_FILE_NAME);
    fileStructure.selectItemInFileStructureByEnter("getId() : double");
    fileStructure.waitFileStructureFormIsClosed();
    editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString());
    editor.waitTextElementsActiveLine("getId");
    editor.waitSpecifiedValueForLineAndChar(36, 23);

    // check new elements in the 'file structure' form
    editor.setCursorToLine(19);/*from  w w w  .ja va2 s.c  o  m*/
    editor.waitActiveEditor();
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor(NEW_CONTENT);
    editor.waitTextIntoEditor(EXPECTED_TEXT);
    menu.runCommand(TestMenuCommandsConstants.Assistant.ASSISTANT,
            TestMenuCommandsConstants.Assistant.FILE_STRUCTURE);
    fileStructure.waitFileStructureFormIsOpen(JAVA_FILE_NAME);
    fileStructure.waitExpectedTextInFileStructure(NEW_ITEMS);
}

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

License:Open Source License

@Test(priority = 1)
public void checkRecentlyCreatedFiles() throws Exception {
    String content = "FindTextFeatureTest";
    String fileNameCreatedFromAPI = "readme.api";
    String fileNameCreatedFromTerminal = "readme.con";

    projectExplorer.waitProjectExplorer();
    projectExplorer.selectItem(PROJECT_NAME);
    terminal.waitTerminalTab();//from w  ww  .  j  a  va2s  .  c  o m
    terminal.selectTerminalTab();
    createFileInTerminal(fileNameCreatedFromTerminal);
    WaitUtils.sleepQuietly(15);
    menu.runCommand(TestMenuCommandsConstants.Edit.EDIT, TestMenuCommandsConstants.Edit.FIND);
    findText.waitFindTextMainFormIsOpen();
    findText.typeTextIntoFindField("pom.xml");
    findText.waitTextIntoFindField("pom.xml");
    findText.setAndWaitWholeWordCheckbox(false);
    findText.waitPathIntoRootField("/" + PROJECT_NAME);
    findText.clickOnSearchButtonMainForm();
    findText.waitFindInfoPanelIsOpen();
    findText.waitExpectedTextInFindInfoPanel(fileNameCreatedFromTerminal);
    findText.selectItemInFindInfoPanel(fileNameCreatedFromTerminal);
    findText.sendCommandByKeyboardInFindInfoPanel(Keys.ENTER.toString());
    editor.waitActiveTabFileName(fileNameCreatedFromTerminal);

    projectExplorer.selectItem(PROJECT_NAME);
    createFileFromAPI(PROJECT_NAME, fileNameCreatedFromAPI, content);
    WaitUtils.sleepQuietly(15);
    menu.runCommand(TestMenuCommandsConstants.Edit.EDIT, TestMenuCommandsConstants.Edit.FIND);
    findText.waitFindTextMainFormIsOpen();
    findText.typeTextIntoFindField("Feature");
    findText.waitTextIntoFindField("Feature");
    findText.setAndWaitWholeWordCheckbox(false);
    findText.waitPathIntoRootField("/" + PROJECT_NAME);
    findText.clickOnSearchButtonMainForm();
    findText.waitFindInfoPanelIsOpen();
    findText.waitExpectedTextInFindInfoPanel(fileNameCreatedFromAPI);
    findText.selectItemInFindInfoPanel(fileNameCreatedFromAPI);
    findText.sendCommandByKeyboardInFindInfoPanel(Keys.ENTER.toString());
    editor.waitActiveTabFileName(fileNameCreatedFromAPI);
}

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

License:Open Source License

@Test(priority = 2)
public void checkFindTextBasic() {
    projectExplorer.waitProjectExplorer();
    projectExplorer.selectItem(PROJECT_NAME);
    menu.runCommand(TestMenuCommandsConstants.Edit.EDIT, TestMenuCommandsConstants.Edit.FIND);
    findText.waitFindTextMainFormIsOpen();
    findText.waitSearchBtnMainFormIsDisabled();
    findText.typeTextIntoFindField("dddhhh");
    findText.waitTextIntoFindField("dddhhh");
    loader.waitOnClosed();//from   ww w. j  a v  a 2 s .  c  o  m
    findText.clickOnSearchButtonMainForm();
    findText.waitFindInfoPanelIsOpen();
    findText.waitExpectedTextInFindInfoPanel(FIND_NOTHING);
    findText.clickHideBtnFindInfoPanel();
    findText.clickFindTab();
    findText.waitFindInfoPanelIsOpen();

    projectExplorer.selectItem(PROJECT_NAME);
    findText.launchFindFormByKeyboard();
    findText.waitFindTextMainFormIsOpen();
    findText.typeTextIntoFindField("String");
    findText.waitTextIntoFindField("String");
    findText.setAndWaitStateSearchRootCheckbox(false);
    findText.waitPathIntoRootField("/" + PROJECT_NAME);
    findText.clickOnSearchButtonMainForm();
    findText.waitFindInfoPanelIsOpen();
    findText.waitExpectedTextInFindInfoPanel(PR_1_EXPECTED_TEXT_1);
    findText.selectItemInFindInfoPanel("guess_num.jsp");
    findText.sendCommandByKeyboardInFindInfoPanel(Keys.ENTER.toString());
    editor.waitActiveEditor();
    editor.waitActiveTabFileName("guess_num.jsp");
    editor.waitTextIntoEditor("String");
    findText.selectItemInFindInfoPanelByDoubleClick("SayHello.java");
    editor.waitActiveEditor();
    editor.waitActiveTabFileName("SayHello");
    editor.waitTextIntoEditor("String");
    findText.selectItemInFindInfoPanel("guess_num.jsp");
    findText.sendCommandByKeyboardInFindInfoPanel(Keys.ARROW_UP.toString());
    findText.sendCommandByKeyboardInFindInfoPanel(Keys.ENTER.toString());
    editor.waitActiveTabFileName("SayHelloTest");
    editor.closeAllTabs();
}

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

License:Open Source License

private void createFileInTerminal(String fileName) {
    terminal.typeIntoTerminal("cd " + PROJECT_NAME + Keys.ENTER);
    terminal.typeIntoTerminal("ls -als > " + fileName + Keys.ENTER);
    terminal.typeIntoTerminal("cat " + fileName + Keys.ENTER);
    terminal.typeIntoTerminal("ls" + Keys.ENTER);
    terminal.waitExpectedTextIntoTerminal(fileName);
}