List of usage examples for org.openqa.selenium Keys ARROW_DOWN
Keys ARROW_DOWN
To view the source code for org.openqa.selenium Keys ARROW_DOWN.
Click Source Link
From source file:org.auraframework.integration.test.components.ui.tabset.TabsetUITest.java
License:Apache License
/** * Test that will verify that the arrows keys work. This is not something that will be run on mobile devices * /* w w w . j a v a 2 s. c o m*/ * IE7/8 don't handle arrows well. */ @ExcludeBrowsers({ BrowserType.ANDROID_PHONE, BrowserType.ANDROID_TABLET, BrowserType.IPHONE, BrowserType.IPAD, BrowserType.IE8, BrowserType.IE7 }) @Test public void testLeftRightUpDownArrows() throws Exception { open(createURL("basic", "false")); // Left/Up and Right/Down Arrows do the samething. Making sure that the result is also the same iterateThroughTabs(Keys.ARROW_RIGHT, Keys.ARROW_LEFT); iterateThroughTabs(Keys.ARROW_DOWN, Keys.ARROW_UP); }
From source file:org.eclipse.che.selenium.editor.autocomplete.AutocompleteWithInheritTest.java
License:Open Source License
@Test public void updateDependencyWithInheritTest() { projectExplorer.waitProjectExplorer(); //projectExplorer.waitItem(PROJECT_NAME); mavenPluginStatusBar.waitClosingInfoPanel(); projectExplorer.quickExpandWithJavaScript(); projectExplorer.openItemByVisibleNameInExplorer("AppController.java"); editor.waitAllMarkersDisappear(ERROR_MARKER); projectExplorer.openItemByVisibleNameInExplorer(EXTENDED_CLASS + ".java"); editor.returnFocusInCurrentLine();/*from w w w .j av a 2s . com*/ editor.waitMarkerInPosition(ERROR_MARKER, 13); editor.setCursorToLine(13); editor.launchPropositionAssistPanel(); editor.waitTextIntoFixErrorProposition("Add constructor 'InheritClass(int,String)'"); editor.selectFirstItemIntoFixErrorPropByEnter(); editor.waitTextIntoEditor(contentAfterFix); editor.waitMarkerDisappears(ERROR_MARKER, 13); editor.waitMarkerInPosition(TASK_MARKER_OVERVIEW, 18); editor.waitTabFileWithSavedStatus(EXTENDED_CLASS); editor.selectTabByName(BASE_CLASS); loader.waitOnClosed(); editor.selectLineAndDelete(24); editor.typeTextIntoEditor("int testString;"); editor.typeTextIntoEditor(Keys.ARROW_DOWN.toString()); editor.typeTextIntoEditor(Keys.ARROW_DOWN.toString()); editor.selectLineAndDelete(); editor.typeTextIntoEditor("public AppController(int testInt, int testString) {"); editor.typeTextIntoEditor(Keys.DELETE.toString()); editor.waitTabFileWithSavedStatus(BASE_CLASS); editor.selectTabByName(EXTENDED_CLASS); loader.waitOnClosed(); editor.setCursorToLine(16); editor.typeTextIntoEditor(Keys.END.toString()); editor.typeTextIntoEditor(Keys.HOME.toString()); editor.typeTextIntoEditor(Keys.DELETE.toString()); editor.typeTextIntoEditor("s"); editor.launchPropositionAssistPanel(); editor.waitTextIntoFixErrorProposition("Change type of 'testString' to 'int'"); editor.selectFirstItemIntoFixErrorPropByDoubleClick(); editor.waitAllMarkersDisappear(ERROR_MARKER); }
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 . java 2s .c om 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.FindUsagesBaseOperationTest.java
License:Open Source License
@Test public void checkFindUsagesBaseOperation() { projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.expandPathInProjectExplorerAndOpenFile(PATH_FOR_EXPAND, "AppController.java"); // Check basic operations of the 'find usages' panel editor.selectTabByName("AppController"); editor.setCursorToDefinedLineAndChar(26, 17); menu.runCommand(TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.FIND_USAGES); loader.waitOnClosed();// www.j ava 2 s . c om findUsages.waitFindUsagesPanelIsOpen(); findUsages.clickFindUsagesTab(); findUsages.waitFindUsegesPanelIsClosed(); findUsages.clickFindUsagesTab(); findUsages.waitFindUsagesPanelIsOpen(); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT); findUsages.waitSelectedElementInFindUsagesPanel("numGuessByUser"); // Check nodes in the 'find usages' panel by 'double click' and click on the icon node findUsages.clickOnIconNodeInFindUsagesPanel(PROJECT_NAME); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesByDoubleClick(PROJECT_NAME); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesByDoubleClick("org.eclipse.qa.examples"); findUsages.selectNodeInFindUsagesByDoubleClick("AppController"); findUsages.selectNodeInFindUsagesByDoubleClick("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesByDoubleClick("AppController"); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.clickOnIconNodeInFindUsagesPanel("AppController"); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.clickOnIconNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_2); // Check nodes in the 'find usages' panel by 'Enter' findUsages.selectNodeInFindUsagesPanel(PROJECT_NAME); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesPanel("org.eclipse.qa.examples"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.selectNodeInFindUsagesPanel("AppController"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.selectNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesPanel("AppController"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.selectNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_2); // Check nodes in the 'find usages' panel by keyboard findUsages.selectNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_LEFT.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_UP.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_UP.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_UP.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_LEFT.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_1); // Check the found items in the editor findUsages.selectHighlightedItemInFindUsagesByDoubleClick(29); editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString()); editor.expectedNumberOfActiveLine(29); editor.waitTextElementsActiveLine("numGuessByUser"); findUsages.selectNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString()); editor.expectedNumberOfActiveLine(33); editor.waitTextElementsActiveLine("numGuessByUser"); }
From source file:org.eclipse.che.selenium.miscellaneous.WorkingWithTerminalTest.java
License:Open Source License
@Test(priority = 4) public void shouldNavigateToMC() { openMC("/");//from w w w. j av a 2 s.co m //navigate to midnight commander tree consoles.selectProcessByTabName("Terminal"); terminal.typeIntoTerminal(Keys.ARROW_DOWN.toString()); terminal.typeIntoTerminal(Keys.ARROW_DOWN.toString()); terminal.typeIntoTerminal(Keys.ARROW_DOWN.toString()); terminal.typeIntoTerminal(Keys.ARROW_DOWN.toString()); terminal.typeIntoTerminal(Keys.ENTER.toString()); terminal.typeIntoTerminal(Keys.ARROW_DOWN.toString()); terminal.typeIntoTerminal(Keys.ENTER.toString()); // check the home content of the midnight commander for (String partOfContent : CHECK_MC_OPENING) { terminal.waitExpectedTextIntoTerminal(partOfContent); } terminal.typeIntoTerminal(Keys.F10.toString()); }
From source file:org.eclipse.che.selenium.pageobject.CodenvyEditor.java
License:Open Source License
/** * Select text in defined interval/*from www .j a va 2 s . co 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.intelligent.CommandsPalette.java
License:Open Source License
/** * Search and start command by name//from w ww . j a va 2 s . co m * * @param mt where to move(down or up) * @param steps */ public void moveAndStartCommand(MoveTypes mt, int steps) { Keys k = mt.equals(MoveTypes.UP) ? Keys.ARROW_UP : Keys.ARROW_DOWN; for (int i = 0; i < steps; i++) { actionsFactory.createAction(seleniumWebDriver).sendKeys(k.toString()).perform(); loader.waitOnClosed(); } actionsFactory.createAction(seleniumWebDriver).sendKeys(Keys.ENTER.toString()).perform(); }
From source file:org.hepaces.surveyfeedbacktestscript.KrogerFeedbackManager.java
/** * Centralized handling for numeric dropdowns (select elements) * @param numberDownArrowPresses// www.j a v a 2 s . com * @param input */ private static void numericDropDownHandler(int numberDownArrowPresses, WebElement input) { input.click(); for (int i = 1; i <= numberDownArrowPresses; i++) { input.sendKeys(Keys.ARROW_DOWN); } input.sendKeys(Keys.TAB); }
From source file:org.kuali.rice.krad.demo.uif.library.controls.DemoControlCheckboxDefaultAft.java
License:Educational Community License
protected void testCheckboxControlEnableWhenChanged() throws Exception { navigateToExample("Demo-CheckboxControl-Example8"); waitForElementPresentById("ST-DemoCheckboxControlExample8-Input1_control"); waitForElementPresentById("ST-DemoCheckboxControlExample8-Input2_control"); assertTextPresent("Specifies the property names of fields that when changed, will enable this component"); // check that checkbox controls is visible, not selected and disabled assertTrue(isVisibleById("ST-DemoCheckboxControlExample8-Input2_control")); assertFalse(isCheckedById("ST-DemoCheckboxControlExample8-Input2_control")); assertFalse(isEnabledById("ST-DemoCheckboxControlExample8-Input2_control")); // backspace input1 and remove focus from input1 (by doing an arrow down on the div) driver.findElement(By.id("ST-DemoCheckboxControlExample8-Input1_control")).sendKeys(Keys.BACK_SPACE); driver.findElement(By.id("Demo-CheckboxControl-Example8")).sendKeys(Keys.ARROW_DOWN); // check that checkbox controls is visible, not selected and disabled assertTrue(isVisibleById("ST-DemoCheckboxControlExample8-Input2_control")); assertFalse(isCheckedById("ST-DemoCheckboxControlExample8-Input2_control")); assertFalse(isEnabledById("ST-DemoCheckboxControlExample8-Input2_control")); // type "Hello" in input1 and remove focus from input1 (by doing an arrow down on the div) driver.findElement(By.id("ST-DemoCheckboxControlExample8-Input1_control")).sendKeys("Hello"); driver.findElement(By.id("Demo-CheckboxControl-Example8")).sendKeys(Keys.ARROW_DOWN); // check that checkbox controls is visible, not selected and enabled assertTrue(isVisibleById("ST-DemoCheckboxControlExample8-Input2_control")); assertFalse(isCheckedById("ST-DemoCheckboxControlExample8-Input2_control")); assertTrue(isEnabledById("ST-DemoCheckboxControlExample8-Input2_control")); }
From source file:org.kuali.rice.krad.demo.uif.library.controls.DemoControlCheckboxDefaultAft.java
License:Educational Community License
protected void testCheckboxControlDisableWhenChanged() throws Exception { navigateToExample("Demo-CheckboxControl-Example9"); waitForElementPresentById("ST-DemoCheckboxControlExample9-Input1_control"); waitForElementPresentById("ST-DemoCheckboxControlExample9-Input2_control"); assertTextPresent("Specifies the property names of fields that when changed, will disable this component"); // check that checkbox controls is visible, not selected and enabled assertTrue(isVisibleById("ST-DemoCheckboxControlExample9-Input2_control")); assertFalse(isCheckedById("ST-DemoCheckboxControlExample9-Input2_control")); assertTrue(isEnabledById("ST-DemoCheckboxControlExample9-Input2_control")); // backspace input1 and remove focus from input1 (by doing an arrow down on the checkbox) driver.findElement(By.id("ST-DemoCheckboxControlExample9-Input1_control")).sendKeys(Keys.BACK_SPACE); driver.findElement(By.id("Demo-CheckboxControl-Example9")).sendKeys(Keys.ARROW_DOWN); // check that checkbox controls is visible, not selected and enabled assertTrue(isVisibleById("ST-DemoCheckboxControlExample9-Input2_control")); assertFalse(isCheckedById("ST-DemoCheckboxControlExample9-Input2_control")); assertTrue(isEnabledById("ST-DemoCheckboxControlExample9-Input2_control")); // type "Hello" in input1 and remove focus from input1 (by doing an arrow down on the checkbox) driver.findElement(By.id("ST-DemoCheckboxControlExample9-Input1_control")).sendKeys("Hello"); driver.findElement(By.id("Demo-CheckboxControl-Example9")).sendKeys(Keys.ARROW_DOWN); // check that checkbox controls is visible, not selected and disabled assertTrue(isVisibleById("ST-DemoCheckboxControlExample9-Input2_control")); assertFalse(isCheckedById("ST-DemoCheckboxControlExample9-Input2_control")); assertFalse(isEnabledById("ST-DemoCheckboxControlExample9-Input2_control")); }