List of usage examples for org.openqa.selenium Keys ARROW_LEFT
Keys ARROW_LEFT
To view the source code for org.openqa.selenium Keys ARROW_LEFT.
Click Source Link
From source file:org.auraframework.integration.test.components.ui.inputDateTime.InputDateTimeUITest.java
License:Apache License
/** * Test flow/*from w ww.ja v a 2 s . c o m*/ * - go to 12:30 PM * - move to the previous time value and see it's 12:00 PM * @throws Exception */ @Test // TODO: Flapping on Jenkins autobuilds public void _testTPLeftArrow() throws Exception { open(URL); selectTimePicker(Keys.ARROW_LEFT, TIME_1230_XPATH, "12:00 PM"); }
From source file:org.auraframework.integration.test.components.ui.inputTextArea.InputTextAreaUITest.java
License:Apache License
@Test public void testTextAreaWithMultipleLinesOfText() throws Exception { open(TEST_CMP2);//from w ww .j a v a 2 s . c o m WebElement div = findDomElement(By.id("textAreaWithLabel")); WebElement input = div.findElement(By.tagName("textarea")); WebElement outputDiv = findDomElement(By.id("output")); String inputAuraId = "textAreaWithLabel"; String valueExpression = getAuraUITestingUtil().getValueFromCmpRootExpression(inputAuraId, "v.value"); String inputText = String.format("%s%n%s%n%s%n%s", "LINE1", "LINE2", "LINE3", "L4"); input.clear(); input.click(); input.sendKeys(inputText); input.sendKeys(Keys.ARROW_LEFT, Keys.ARROW_LEFT); String inputNewString = "L5"; input.sendKeys(inputNewString); inputText = String.format("%s%n%s%n%s%n%s", "LINE1", "LINE2", "LINE3", "L5L4"); outputDiv.click(); // to simulate tab behavior for touch browsers String actualText = (String) getAuraUITestingUtil().getEval(valueExpression); assertEquals("Total number of bytes with \r\n does not match", inputText.getBytes().length + 3, actualText.getBytes().length); assertEquals("Value of Input text Area shoud be updated after removing carriage return", inputText, actualText.replaceAll("(\\r)", "")); }
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 * //from w w w. j ava2 s . co 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.auraframework.integration.test.components.ui.tabset.TabsetUITest.java
License:Apache License
/** * Test to navigate from a random tab to the overflow menu using the right arrow and open the overflow * menu using the ENTER key/*from w w w . j a v a 2 s . c o m*/ * Disabled against mobile since tabbing does not make sense on mobile Tabbing with Safari acts oddly. * * @throws Exception */ @ExcludeBrowsers({ BrowserType.SAFARI, BrowserType.ANDROID_PHONE, BrowserType.ANDROID_TABLET, BrowserType.IPHONE, BrowserType.IPAD }) @Test public void testOverflowKeyboardInteraction() throws Exception { open("/uitest/tabset_Test.cmp?renderItem=overflow"); overflowKeyboardNav(5, false, Keys.ARROW_LEFT); }
From source file:org.eclipse.che.selenium.editor.autocomplete.InheritClassTest.java
License:Open Source License
@Test public void autoCompleteClassInTheSamePackage() { //create java class in the same package with GreetingController.java projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); notificationsPopupPanel.waitProgressPopupPanelClose(); loader.waitOnClosed();/* w w w . ja va 2 s. com*/ projectExplorer.quickExpandWithJavaScript(); loader.waitOnClosed(); projectExplorer.openItemByPath(COMMON_PACKAGE + "/AppController.java"); //create java class in the different package with GreetingController.java projectExplorer.waitProjectExplorer(); projectExplorer.selectItem(COMMON_PACKAGE); menu.runCommand(TestMenuCommandsConstants.Project.PROJECT, TestMenuCommandsConstants.Project.New.NEW, TestMenuCommandsConstants.Project.New.JAVA_CLASS); askForValueDialog.createJavaFileByNameAndType("CodenvyTest", AskForValueDialog.JavaFiles.CLASS); editor.waitTabIsPresent("CodenvyTest"); loader.waitOnClosed(); projectExplorer.selectItem(COMMON_PACKAGE); menu.runCommand(TestMenuCommandsConstants.Project.PROJECT, TestMenuCommandsConstants.Project.New.NEW, TestMenuCommandsConstants.Project.New.JAVA_CLASS); askForValueDialog.createJavaFileByNameAndType("CodenvyTestInherite", AskForValueDialog.JavaFiles.CLASS); editor.waitTabIsPresent("CodenvyTestInherite"); loader.waitOnClosed(); editor.waitActiveEditor(); editor.setCursorToLine(3); editor.typeTextIntoEditor(Keys.END.toString()); editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString()); editor.typeTextIntoEditor("ex"); loader.waitOnClosed(); editor.launchAutocomplete(); editor.waitAutocompleteContainerIsClosed(); editor.waitTextIntoEditor("extends"); editor.typeTextIntoEditor(" Code"); loader.waitOnClosed(); editor.launchAutocompleteAndWaitContainer(); editor.waitTextIntoAutocompleteContainer("CodenvyTest - org.eclipse.qa.examples"); editor.enterAutocompleteProposal("CodenvyTest"); editor.waitAutocompleteContainerIsClosed(); editor.waitTextIntoEditor("CodenvyTestInherite extends CodenvyTest"); loader.waitOnClosed(); editor.waitActiveEditor(); editor.selectTabByName("AppController"); editor.waitActiveEditor(); editor.setCursorToLine(32); editor.typeTextIntoEditor("Code"); editor.launchAutocompleteAndWaitContainer(); editor.waitTextIntoAutocompleteContainer("CodenvyTest - org.eclipse.qa.examples"); editor.waitTextIntoAutocompleteContainer("CodenvyTestInherite - org.eclipse.qa.examples"); editor.enterAutocompleteProposal("CodenvyTest"); editor.waitAutocompleteContainerIsClosed(); editor.waitTextIntoEditor("CodenvyTest"); editor.typeTextIntoEditor(" codenvyTest = n"); editor.launchAutocompleteAndWaitContainer(); editor.waitAutocompleteContainer(); editor.waitTextIntoAutocompleteContainer("new"); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor(" Code"); editor.waitCodeAssistMarkers(ERROR_MARKER); editor.launchAutocompleteAndWaitContainer(); editor.waitTextIntoAutocompleteContainer("CodenvyTest - org.eclipse.qa.examples"); editor.waitTextIntoAutocompleteContainer("CodenvyTestInherite - org.eclipse.qa.examples"); editor.enterAutocompleteProposal("CodenvyTestInherite"); editor.waitAutocompleteContainerIsClosed(); editor.typeTextIntoEditor(";"); editor.waitTextIntoEditor("CodenvyTest codenvyTest = numGuessByUser CodenvyTestInherite; \n"); }
From source file:org.eclipse.che.selenium.editor.ContextMenuEditorTest.java
License:Open Source License
@Test(priority = 7) public void checkNaviFileStructure() { projectExplorer.waitItem(PROJECT_NAME_2); projectExplorer// w w w .j av a 2 s . c om .openItemByPath(PROJECT_NAME_2 + "/src/main/java/org/eclipse/qa/examples/AppController.java"); editor.openContextMenuInEditor(); editor.clickOnItemInContextMenu(NAVIGATE_FILE_STRUCTURE); editor.waitContextMenuIsNotPresent(); fileStructure.waitFileStructureFormIsOpen("AppController"); loader.waitOnClosed(); fileStructure.waitExpectedTextInFileStructure( "handleRequest(HttpServletRequest, HttpServletResponse) : ModelAndView"); loader.waitOnClosed(); fileStructure .selectItemInFileStructure("handleRequest(HttpServletRequest, HttpServletResponse) : ModelAndView"); fileStructure.selectItemInFileStructureByDoubleClick( "handleRequest(HttpServletRequest, HttpServletResponse) : ModelAndView"); fileStructure.waitFileStructureFormIsClosed(); editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString()); editor.waitTextElementsActiveLine("handleRequest"); editor.waitSpecifiedValueForLineAndChar(25, 25); }
From source file:org.eclipse.che.selenium.miscellaneous.FileStructureByKeyboardTest.java
License:Open Source License
@Test public void checkFileStructureByKeyboard() { projectExplorer.waitProjectExplorer(); projectExplorer.openItemByPath(PROJECT_NAME); expandTReeProjectAndOpenClass(JAVA_FILE_NAME); // check work nodes in the 'file structure' by keyboard fileStructure.launchFileStructureFormByKeyboard(); fileStructure.waitFileStructureFormIsOpen(JAVA_FILE_NAME); fileStructure.waitExpectedTextInFileStructure(ITEMS_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_CLASS_1); fileStructure.selectItemInFileStructure(INNER_CLASS_NAME); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_INNER_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_INNER_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_INNER_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_INNER_CLASS); fileStructure.selectItemInFileStructure(INTERFACE_NAME); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_INTERFACE); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_INTERFACE); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_INTERFACE); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_INTERFACE); // check go on the root node after 'double click arrow left' fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.clickOnIconNodeInFileStructure(INTERFACE_NAME); fileStructure.clickOnIconNodeInFileStructure(INNER_CLASS_NAME); fileStructure.waitExpectedTextInFileStructure(ITEMS_CLASS); // check scroll by keyboard fileStructure.selectItemInFileStructure(JAVA_FILE_NAME); fileStructure.waitExpectedTextInFileStructure(ITEMS_CLASS); fileStructure.moveDownToItemInFileStructure("TEN"); //TODO add code scroll up later }
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 . j ava 2 s .co 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.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();/*w ww . j a va 2s .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.preferences.CheckErrorsWarningsTabTest.java
License:Open Source License
private void changeAllSettingsInErrorsWarningsTab( Preferences.DropDownValueForErrorWaitingWidget valueOfRadioButton) { preferences.waitPreferencesForm();/*ww w. j a v a 2s . c om*/ preferences.waitMenuInCollapsedDropdown(Preferences.DropDownJavaCompilerMenu.ERRORS_WARNINGS); preferences.selectDroppedMenuByName(Preferences.DropDownJavaCompilerMenu.ERRORS_WARNINGS); preferences.setAllSettingsInErrorWaitingWidget(valueOfRadioButton); preferences.clickOnOkBtn(); preferences.clickOnCloseBtn(); loader.waitOnClosed(); projectExplorer.waitItem(PATH_TO_CLASS_IN_SPRING_PACKAGE); projectExplorer.openItemByPath(PATH_TO_CLASS_IN_SPRING_PACKAGE); loader.waitOnClosed(); editor.setCursorToLine(84); editor.typeTextIntoEditor(Keys.END.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditorWithoutDelayForSaving(Keys.ARROW_LEFT.toString()); editor.typeTextIntoEditorWithoutDelayForSaving(Keys.ENTER.toString()); editor.typeTextIntoEditor(Keys.DELETE.toString()); editor.typeTextIntoEditor(Keys.DELETE.toString()); WaitUtils.sleepQuietly(3); }