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.refactor.parameters.RenameParametersTest.java

License:Open Source License

@Test(priority = 5)
public void checkRenameParameters15() throws Exception {
    setFieldsForTest("test15");
    projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
    editor.waitActiveEditor();//from w w w .j a v  a2 s  . co m
    editor.waitTextIntoEditor(contentFromInA);
    editor.setCursorToDefinedLineAndChar(14, 15);
    editor.launchRefactorFormFromEditor();
    editor.launchRefactorFormFromEditor();
    refactor.waitRenameParametersFormIsOpen();
    refactor.setAndWaitStateUpdateReferencesCheckbox(true);
    refactor.typeAndWaitNewName("j");
    refactor.clickOkButtonRefactorForm();
    askDialog.acceptDialogWithText("Duplicate parameter j");
    loader.waitOnClosed();
    refactor.waitRenameParametersFormIsClosed();
    editor.waitActiveEditor();
    editor.setCursorToDefinedLineAndChar(14, 23);
    editor.launchRefactorFormFromEditor();
    editor.typeTextIntoEditor("i");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.waitMarkerDisappears(ERROR_MARKER, 14);
    editor.waitTextIntoEditor(contentFromOutA);
    editor.closeFileByNameWithSaving("A");
}

From source file:org.eclipse.che.selenium.refactor.parameters.RenameParametersTest.java

License:Open Source License

@Test(priority = 6)
public void checkRenameParameters18() throws Exception {
    setFieldsForTest("test18");
    projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
    editor.waitActiveEditor();//from   www .  j a v  a 2  s.  com
    editor.waitTextIntoEditor(contentFromInA);
    editor.setCursorToDefinedLineAndChar(14, 20);
    editor.launchRefactorFormFromEditor();
    editor.typeTextIntoEditor("j");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.waitTextIntoEditor(contentFromOutA);
    editor.closeFileByNameWithSaving("A");
}

From source file:org.eclipse.che.selenium.refactor.parameters.RenameParametersTest.java

License:Open Source License

@Test(priority = 7)
public void checkRenameParameters21() throws Exception {
    setFieldsForTest("test21");
    projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
    editor.waitActiveEditor();/* w w w  . j av a2s.  c o m*/
    editor.waitTextIntoEditor(contentFromInA);
    editor.setCursorToDefinedLineAndChar(14, 17);
    editor.launchRefactorFormFromEditor();
    editor.typeTextIntoEditor("j");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.waitTextIntoEditor(contentFromOutA);
    editor.closeFileByNameWithSaving("A");
}

From source file:org.eclipse.che.selenium.refactor.parameters.RenameParametersTest.java

License:Open Source License

@Test(priority = 8)
public void checkRenameParameters25() throws Exception {
    setFieldsForTest("test25");
    projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
    editor.waitActiveEditor();//www.  j  a  va 2 s  .c o m
    editor.waitTextIntoEditor(contentFromInA);
    editor.setCursorToDefinedLineAndChar(15, 16);
    editor.launchRefactorFormFromEditor();
    editor.typeTextIntoEditor("j");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.waitTextIntoEditor(contentFromOutA);
    editor.closeFileByNameWithSaving("A");
}

From source file:org.eclipse.che.selenium.refactor.parameters.RenameParametersTest.java

License:Open Source License

@Test(priority = 9)
public void checkRenameParameters28() throws Exception {
    setFieldsForTest("test28");
    projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
    editor.waitActiveEditor();/*w  ww.j  a v  a2s  .com*/
    editor.waitTextIntoEditor(contentFromInA);
    editor.setCursorToDefinedLineAndChar(14, 18);
    editor.typeTextIntoEditor(Keys.END.toString());
    editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString());
    editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString());
    editor.launchRefactorFormFromEditor();
    editor.typeTextIntoEditor("j");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.waitTextIntoEditor(contentFromOutA);
    editor.closeFileByNameWithSaving("A");
}

From source file:org.eclipse.che.selenium.refactor.parameters.RenameParametersTest.java

License:Open Source License

@Test(priority = 10)
public void checkRenameParameters31() throws Exception {
    setFieldsForTest("test31");
    projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
    editor.waitActiveEditor();//from  w ww  .j a v  a 2s . com
    editor.waitTextIntoEditor(contentFromInA);
    editor.setCursorToDefinedLineAndChar(14, 30);
    editor.launchRefactorFormFromEditor();
    editor.typeTextIntoEditor("kk");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.waitTextIntoEditor(contentFromOutA);
    editor.closeFileByNameWithSaving("A");
}

From source file:org.eclipse.che.selenium.subversion.DiffViewTest.java

License:Open Source License

@Test
public void checkDiffView() throws InterruptedException {
    projectExplorer.waitProjectExplorer();
    menu.runCommand(WORKSPACE, IMPORT_PROJECT);
    subversion.waitAndTypeImporterAsSvnInfo(svnRepo2urlProvider.get(), PROJECT_NAME, svnUsernameProvider.get(),
            svnPasswordProvider.get());/* w  w  w . j ava  2  s .  c o m*/
    importProjectFromLocation.waitMainFormIsClosed();

    wizard.waitOpenProjectConfigForm();
    wizard.clickSaveButton();
    wizard.waitCloseProjectConfigForm();

    loader.waitOnClosed();
    projectExplorer.waitItem(PROJECT_NAME);
    projectExplorer.openItemByPath(PROJECT_NAME);

    // Change the file 'readme'
    projectExplorer.waitItem(PROJECT_NAME);
    projectExplorer.openItemByPath(PROJECT_NAME + "/trunk");
    projectExplorer.openItemByPath(PROJECT_NAME + "/trunk/diff-view-test");
    projectExplorer.openItemByPath(PROJECT_NAME + "/trunk/diff-view-test/readme");
    editor.waitActiveEditor();
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor(Keys.ARROW_UP.toString());
    editor.typeTextIntoEditor("###### qa");
    editor.waitTextIntoEditor("###### qa");

    // Change the file 'document.html'
    projectExplorer.openItemByPath(PROJECT_NAME + "/trunk/diff-view-test/document.html");
    editor.waitActiveEditor();
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor(Keys.ARROW_UP.toString());
    editor.typeTextIntoEditor("<!*** change content ***>");
    editor.waitTextIntoEditor("<!*** change content ***>");

    projectExplorer.selectItem(PROJECT_NAME);
    menu.runCommand(SUBVERSION, SVN_COMMIT);
    subversion.waitSvnCommitFormOpened();
    subversion.clickSvnCommitDiffButton(FILE_NAME_1, FOLDER_NAME);
    loader.waitOnClosed();
    subversion.waitSvnCommitFormOpened();
    subversion.waitTextDiffView(DIFF_MESS_1);
    subversion.clickSvnCommitClosedButtonDiffView();

    // Check the diff view 'document.html' in the svn commit form
    subversion.clickSvnCommitDiffButton(FILE_NAME_2, FOLDER_NAME);
    loader.waitOnClosed();
    subversion.waitSvnCommitFormOpened();
    subversion.waitTextDiffView(DIFF_MESS_2);
    subversion.clickSvnCommitClosedButtonDiffView();
    subversion.waitSvnCommitFormOpened();
    subversion.clickSvnCommiCancelButtont();

    // Check the 'View Diff' in the svn status bar
    projectExplorer.selectItem(PROJECT_NAME + "/trunk/diff-view-test/readme");
    menu.runCommand(SUBVERSION, SVN_VIEW_DIFF);
    loader.waitOnClosed();

    subversion.waitSvnInfoPanelWithMessage(DIFF_MESS_1);
    projectExplorer.selectItem(PROJECT_NAME + "/trunk/diff-view-test/document.html");
    menu.runCommand(SUBVERSION, SVN_VIEW_DIFF);
    loader.waitOnClosed();

    subversion.waitSvnInfoPanelWithMessage(DIFF_MESS_2);
}

From source file:org.eclipse.che.selenium.workspaces.SnapshotTest.java

License:Open Source License

@Test
public void snapshotTest() throws Exception {
    projectExplorer.waitProjectExplorer();
    loader.waitOnClosed();//  www .java  2 s.  c om
    menu.runCommand(TestMenuCommandsConstants.Run.RUN_MENU, TestMenuCommandsConstants.Run.TERMINAL);
    terminal.waitTerminalConsole();
    consoles.selectProcessByTabName("Terminal");
    terminal.typeIntoTerminal(USER_DIRECTORY);
    terminal.waitExpectedTextIntoTerminal(USER_DIRECTORY);
    terminal.typeIntoTerminal(Keys.ENTER.toString());
    terminal.typeIntoTerminal(CREATE_TEXT_FILE);
    terminal.waitExpectedTextIntoTerminal(CREATE_TEXT_FILE);
    terminal.typeIntoTerminal(Keys.ENTER.toString());
    consoles.closeTerminalIntoConsoles();
    menu.runCommand(TestMenuCommandsConstants.Workspace.WORKSPACE,
            TestMenuCommandsConstants.Workspace.STOP_WORKSPACE);
    toastLoader.waitExpectedTextInToastLoader("Snapshotting the workspace");
    toastLoader.waitExpectedTextInToastLoader("Workspace is not running", 60);

    toastLoader.clickOnStartButton();
    notificationsPanel
            .waitExpectedMessageOnProgressPanelAndClosed(TestWorkspaceConstants.RUNNING_WORKSPACE_MESS, 240);
    terminal.waitTerminalConsole();
    consoles.selectProcessByTabName("Terminal");
    terminal.typeIntoTerminal(USER_DIRECTORY);
    terminal.waitExpectedTextIntoTerminal(USER_DIRECTORY);
    terminal.typeIntoTerminal(Keys.ENTER.toString());
    terminal.typeIntoTerminal(LS_COMMAND);
    terminal.waitExpectedTextIntoTerminal(LS_COMMAND);
    terminal.typeIntoTerminal(Keys.ENTER.toString());
    WaitUtils.sleepQuietly(3);
    Assert.assertTrue(terminal.getVisibleTextFromTerminal().contains(FILE_NAME));
}

From source file:org.eclipse.che.selenium.workspaces.WorkingWithJavaMySqlStackTest.java

License:Open Source License

@Test
public void checkJavaMySqlAndRunApp() {
    // create workspace and project
    dashboard.open();/*from   www .j  a  v a  2 s  .  c  o m*/
    navigationBar.waitNavigationBar();
    navigationBar.clickOnMenu(NavigationBar.MenuItem.WORKSPACES);
    dashboardWorkspace.waitToolbarTitleName("Workspaces");
    dashboardWorkspace.clickOnNewWorkspaceBtn();

    createWorkspace.waitToolbar();
    loader.waitOnClosed();
    createWorkspace.selectStack(TestStacksConstants.JAVA_MYSQL.getId());
    createWorkspace.typeWorkspaceName(WORKSPACE);
    projectSourcePage.clickAddOrImportProjectButton();
    projectSourcePage.selectSample(PROJECT_NAME);
    projectSourcePage.clickAdd();

    createWorkspace.clickCreate();
    loader.waitOnClosed();
    seleniumWebDriver.switchFromDashboardIframeToIde(60);

    // expand the project
    currentWindow = seleniumWebDriver.getWindowHandle();
    loader.waitOnClosed();
    projectExplorer.waitProjectExplorer();
    projectExplorer.waitItem(PROJECT_NAME, 600);
    projectExplorer
            .expandPathInProjectExplorer(PROJECT_NAME + "/src/main/java/org.springframework.samples.petclinic");
    projectExplorer.expandPathInProjectExplorer(
            PROJECT_NAME + "/src/test/java/org.springframework.samples.petclinic", 2);
    projectExplorer.openItemByPath(PROJECT_NAME + "/src/test/java/org/springframework/samples/petclinic/model");
    projectExplorer.openItemByPath(
            PROJECT_NAME + "/src/test/java/org/springframework/samples/petclinic/model/OwnerTests.java");
    editor.waitActiveEditor();
    projectExplorer
            .openItemByPath(PROJECT_NAME + "/src/main/java/org/springframework/samples/petclinic/service");
    projectExplorer.openItemByPath(
            PROJECT_NAME + "/src/main/java/org/springframework/samples/petclinic/service/ClinicService.java");
    editor.waitActiveEditor();

    // select the db machine and perform 'show databases'
    projectExplorer.invokeCommandWithContextMenu(ProjectExplorer.CommandsGoal.COMMON, PROJECT_NAME,
            "show databases", "db");
    loader.waitOnClosed();
    for (String text : infoDataBases) {
        consoles.waitExpectedTextIntoConsole(text);
    }

    // build and deploy the web application
    projectExplorer.invokeCommandWithContextMenu(ProjectExplorer.CommandsGoal.RUN, PROJECT_NAME,
            "build and deploy", "dev-machine");
    loader.waitOnClosed();
    consoles.waitTabNameProcessIsPresent(PROCESS_NAME);
    consoles.waitProcessInProcessConsoleTree(PROCESS_NAME);
    consoles.waitExpectedTextIntoConsole(TestBuildConstants.BUILD_SUCCESS, 150);
    consoles.waitExpectedTextIntoConsole("Server startup in", 200);
    consoles.waitPreviewUrlIsPresent();

    // run the application
    loader.waitOnClosed();
    consoles.clickOnPreviewUrl();
    seleniumWebDriver.switchToNoneCurrentWindow(currentWindow);
    checkWebJavaPetclinicAppl();
    seleniumWebDriver.close();
    seleniumWebDriver.switchTo().window(currentWindow);
    seleniumWebDriver.switchFromDashboardIframeToIde();
    consoles.waitProcessInProcessConsoleTree(PROCESS_NAME);
    consoles.waitTabNameProcessIsPresent(PROCESS_NAME);
    consoles.closeProcessByTabName(PROCESS_NAME);
    askDialog.acceptDialogWithText(MSG_CLOSE_PROCESS);
    consoles.waitProcessIsNotPresentInProcessConsoleTree(PROCESS_NAME);
    consoles.waitTabNameProcessIsNotPresent(PROCESS_NAME);
    consoles.selectProcessByTabName("Terminal");
    loader.waitOnClosed();
    terminal.typeIntoTerminal("ps ax | grep tomcat8");
    terminal.typeIntoTerminal(Keys.ENTER.toString());
    terminal.waitExpectedTextNotPresentTerminal("catalina.startup.Bootstrap start");
}

From source file:org.eclipse.scout.rt.testing.ui.rap.RapMock.java

License:Open Source License

protected Keys toSeleniumKey(Key key) {
    switch (key) {
    case Shift:/*from  w  ww  .j  a  v  a2  s  .  c  o m*/
        return Keys.SHIFT;
    case Control:
        return Keys.CONTROL;
    case Alt:
        return Keys.ALT;
    case Delete:
        return Keys.DELETE;
    case Backspace:
        return Keys.BACK_SPACE;
    case Enter:
        return Keys.ENTER;
    case Esc:
        return Keys.ESCAPE;
    case Tab:
        return Keys.TAB;
    case ContextMenu:
        throw new IllegalArgumentException("Unknown keyboard key: " + key);
    case Up:
        return Keys.UP;
    case Down:
        return Keys.DOWN;
    case Left:
        return Keys.LEFT;
    case Right:
        return Keys.RIGHT;
    case Windows:
        return Keys.META;
    case F1:
        return Keys.F1;
    case F2:
        return Keys.F2;
    case F3:
        return Keys.F3;
    case F4:
        return Keys.F4;
    case F5:
        return Keys.F5;
    case F6:
        return Keys.F6;
    case F7:
        return Keys.F7;
    case F8:
        return Keys.F8;
    case F9:
        return Keys.F9;
    case F10:
        return Keys.F10;
    case F11:
        return Keys.F11;
    case F12:
        return Keys.F12;
    case Home:
        return Keys.HOME;
    case End:
        return Keys.END;
    case PageUp:
        return Keys.PAGE_UP;
    case PageDown:
        return Keys.PAGE_DOWN;
    case NumPad0:
        return Keys.NUMPAD0;
    case NumPad1:
        return Keys.NUMPAD1;
    case NumPad2:
        return Keys.NUMPAD2;
    case NumPad3:
        return Keys.NUMPAD3;
    case NumPad4:
        return Keys.NUMPAD4;
    case NumPad5:
        return Keys.NUMPAD5;
    case NumPad6:
        return Keys.NUMPAD6;
    case NumPad7:
        return Keys.NUMPAD7;
    case NumPad8:
        return Keys.NUMPAD8;
    case NumPadMultiply:
        return Keys.MULTIPLY;
    case NumPadDivide:
        return Keys.DIVIDE;
    case NumPadAdd:
        return Keys.ADD;
    case NumPadSubtract:
        return Keys.SUBTRACT;
    case NumPadDecimal:
        return Keys.DECIMAL;
    case NumPadSeparator:
        return Keys.SEPARATOR;
    default:
        throw new IllegalArgumentException("Unknown keyboard key: " + key);
    }
}