Example usage for org.openqa.selenium Keys CONTROL

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

Introduction

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

Prototype

Keys CONTROL

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

Click Source Link

Usage

From source file:org.auraframework.integration.test.http.AuraResourceServletUITest.java

License:Apache License

private void openCachesAppWithRefresh(String cache, String key) throws Exception {
    open(CACHES_URL + "?key=" + BOGUS_KEY);
    waitForKey(BOGUS_KEY);//from   w  ww .jav  a2 s  .c  om
    WebElement el = getDriver().findElement(By.className("searchButton"));
    el.sendKeys(Keys.CONTROL, Keys.F5);
    open(CACHES_URL + "?cache=" + cache + "&key=" + key);
    waitForCache(cache);
    waitForKey(key);
}

From source file:org.eclipse.che.selenium.assistant.KeyBindingsTest.java

License:Open Source License

@Test
public void enterKeyCombinationTest() throws Exception {
    projectExplorer.waitItem(PROJECT_NAME);
    projectExplorer.openItemByPath(PROJECT_NAME);
    notificationsPopupPanel.waitProgressPopupPanelClose();
    loader.waitOnClosed();//w  w w .  ja  v a2  s .  co  m
    keyBindings.enterKeyCombination(Keys.CONTROL, Keys.ALT, Keys.getKeyFromUnicode('n'));
    navigateToFile.waitFormToOpen();
    navigateToFile.closeNavigateToFileForm();
    keyBindings.enterKeyCombination(Keys.ALT, Keys.F12);
    terminal.waitTerminalTab();
    WaitUtils.sleepQuietly(1);
    consoles.closeTerminalIntoConsoles();
    consoles.closeProcessesArea();
}

From source file:org.eclipse.che.selenium.debugger.BreakpointReorderingTest.java

License:Open Source License

@Test(priority = 2)
public void shouldReorderBreakpointsWhenLineRemoved() throws Exception {
    editor.deleteCurrentLine();//from   w  w w  . j ava  2 s . com

    editor.waitInactiveBreakpoint(28);
    editor.waitInactiveBreakpoint(30);
    editor.waitInactiveBreakpoint(37);

    actionsFactory.createAction(seleniumWebDriver).keyDown(Keys.CONTROL).sendKeys("z").keyUp(Keys.CONTROL)
            .perform();

    editor.waitInactiveBreakpoint(29);
    editor.waitInactiveBreakpoint(31);
    editor.waitInactiveBreakpoint(38);
}

From source file:org.eclipse.che.selenium.debugger.BreakpointReorderingTest.java

License:Open Source License

@Test(priority = 3)
public void shouldReorderBreakpointsWhenLineAdded() throws Exception {
    editor.goToCursorPositionVisible(26, 1);
    actionsFactory.createAction(seleniumWebDriver).sendKeys(Keys.ENTER).build().perform();

    editor.waitInactiveBreakpoint(30);/*from  w  w w.j a va 2s. c o m*/
    editor.waitInactiveBreakpoint(32);
    editor.waitInactiveBreakpoint(39);

    actionsFactory.createAction(seleniumWebDriver).keyDown(Keys.CONTROL).sendKeys("z").keyUp(Keys.CONTROL)
            .perform();

    editor.waitInactiveBreakpoint(29);
    editor.waitInactiveBreakpoint(31);
    editor.waitInactiveBreakpoint(38);
}

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

License:Open Source License

@Test
public void javaDocPopupTest() throws Exception {
    projectExplorer.waitProjectExplorer();
    projectExplorer.waitItem(PROJECT_NAME);
    consoles.closeProcessesArea();//w w  w .ja va  2  s  .c  o  m
    projectExplorer.quickExpandWithJavaScript();
    projectExplorer.waitItem(PATH_TO_FILES + "/AppController.java");
    projectExplorer.openItemByVisibleNameInExplorer("AppController.java");
    loader.waitOnClosed();
    // Class javadoc popup
    editor.setCursorToDefinedLineAndChar(25, 105);

    editor.openJavaDocPopUp();
    editor.waitJavaDocPopUpOpened();
    editor.checkTextToBePresentInJavaDocPopUp(CLASS_TEXT);

    editor.selectTabByName("AppController");
    editor.waitJavaDocPopUpClosed();

    // Annotation javadoc popup
    editor.typeTextIntoEditor(Keys.CONTROL.toString());
    editor.waitActiveEditor();
    editor.setCursorToDefinedLineAndChar(24, 6);

    editor.openJavaDocPopUp();
    editor.waitJavaDocPopUpOpened();
    editor.checkTextToBePresentInJavaDocPopUp(ANNOTATION_TEXT);

    editor.typeTextIntoEditor(Keys.ESCAPE.toString());
    editor.waitJavaDocPopUpClosed();
    editor.typeTextIntoEditor(Keys.CONTROL.toString());

    // Class name javadoc popup
    editor.setCursorToDefinedLineAndChar(21, 17);
    editor.openJavaDocPopUp();
    editor.waitJavaDocPopUpOpened();
    editor.checkTextToBePresentInJavaDocPopUp(CLASS_NAME_TEXT);

    editor.selectTabByName("AppController");
    editor.waitJavaDocPopUpClosed();
    editor.typeTextIntoEditor(Keys.CONTROL.toString());

    // Class constructor name javadoc popup
    editor.setCursorToLine(23);
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor("public AppController() {}");
    editor.typeTextIntoEditor(Keys.ENTER.toString());

    editor.setCursorToDefinedLineAndChar(24, 15);
    editor.openJavaDocPopUp();
    editor.checkTextToBePresentInJavaDocPopUp(CONSTRUCTOR_TEXT);

    editor.selectTabByName("AppController");
    editor.waitJavaDocPopUpClosed();
    editor.typeTextIntoEditor(Keys.CONTROL.toString());

    createClass("TestClass", PATH_TO_FILES);
    editor.setCursorToLine(2);
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor("/**");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor(Keys.UP.toString());
    editor.typeTextIntoEditor("Hello");
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor("<script>alert('Hello')</script>");
    editor.closeAllTabsByContextMenu();
    projectExplorer.openItemByPath(PATH_TO_FILES + "/AppController.java");
    editor.setCursorToLine(23);
    editor.typeTextIntoEditor(Keys.END.toString());
    editor.typeTextIntoEditor(Keys.ENTER.toString());
    editor.typeTextIntoEditor("TestClass abc = new TestClass(); Object testObject = new Object();");
    editor.typeTextIntoEditor(Keys.HOME.toString());

    editor.setCursorToDefinedLineAndChar(24, 5);
    editor.openJavaDocPopUp();
    editor.checkTextToBePresentInJavaDocPopUp(JAVA_DOC_FOR_TEST_CLASS);

    editor.selectTabByName("AppController");
    editor.waitJavaDocPopUpClosed();
    editor.typeTextIntoEditor(Keys.CONTROL.toString());

    editor.setCursorToDefinedLineAndChar(24, 35);
    editor.openJavaDocPopUp();
    editor.waitJavaDocPopUpOpened();
    editor.checkTextToBePresentInJavaDocPopUp(JAVA_DOC_FOR_OBJECT);
}

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

License:Open Source License

@Test(priority = 6)
public void shouldCancelProcessByCtrlC() throws InterruptedException {
    terminal.typeIntoTerminal("cd /" + Keys.ENTER);

    // launch bash script
    terminal.typeIntoTerminal(BASH_SCRIPT + Keys.ENTER);
    terminal.waitExpectedTextIntoTerminal("test=1");

    //cancel script
    terminal.typeIntoTerminal(Keys.CONTROL + "c");

    // wait 1 sec. If process was really stopped we should not get text "test=2"
    Thread.sleep(1000);/* w w w  .  j  av a 2s . c  o  m*/
    terminal.waitExpectedTextNotPresentTerminal("test=2");
}

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

License:Open Source License

@Test(priority = 9)
public void shouldTurnToNormalModeFromAlternativeScreenModeAndOtherwise() {
    // open MC - terminal will switch off from normal mode to alternative screen with text user interface (pseudo user graphics).
    openMC("/");//w  ww  . j  ava 2s  .  c  o  m

    // turn back to "normal" mode
    terminal.typeIntoTerminal(Keys.CONTROL + "o");
    for (String partOfContent : CHECK_MC_OPENING) {
        terminal.waitExpectedTextNotPresentTerminal(partOfContent);
    }

    terminal.typeIntoTerminal(Keys.CONTROL + "o" + Keys.ENTER);
    for (String partOfContent : CHECK_MC_OPENING) {
        terminal.waitExpectedTextIntoTerminal(partOfContent);
    }
}

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

License:Open Source License

/** launch the 'Find' main form by keyboard */
public void launchFindFormByKeyboard() {
    loader.waitOnClosed();//  ww w .  j  a  v  a  2  s. co m
    Actions action = actionsFactory.createAction(seleniumWebDriver);
    action.keyDown(Keys.CONTROL).keyDown(Keys.SHIFT).sendKeys("f").keyUp(Keys.SHIFT).keyUp(Keys.CONTROL)
            .perform();
}

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

License:Open Source License

/** Open 'Search and Replace' panel by using key combination ALT+F for opened file in editor */
public void openSearchReplacePanel() {
    editor.waitActive();/*from   ww w .  j a v a2 s  .com*/
    Actions action = actionsFactory.createAction(seleniumWebDriver);
    action.keyDown(Keys.CONTROL).sendKeys("f").keyUp(Keys.CONTROL).perform();
    waitSearchReplacePanel();
}

From source file:org.eclipse.che.selenium.pageobject.theia.TheiaEditor.java

License:Open Source License

public void performPasteAction() {
    String keysCombination = Keys.chord(Keys.CONTROL, "v");
    seleniumWebDriverHelper.sendKeys(keysCombination);
}