List of usage examples for org.openqa.selenium Keys ENTER
Keys ENTER
To view the source code for org.openqa.selenium Keys ENTER.
Click Source Link
From source file:org.eclipse.che.selenium.filewatcher.EditFilesWithTabsTest.java
License:Open Source License
@Test public void checkEditingFilesFromIde() throws Exception { String textForValidation = "//check test message for java file"; String textForValidationTxt1 = "//check test message for file1.txt file"; String expectedNotificationMess1 = "File 'AppController.java' is updated"; String expectedNotificationMess2 = "File 'file1.txt' is updated"; String nameReadmeFile = "README.md"; String nameFiletxt1 = "file1.txt"; editor1.setCursorToLine(1);// ww w . j a va 2 s. c o m editor1.typeTextIntoEditor(textForValidation); editor1.typeTextIntoEditor(Keys.ENTER.toString()); eventsTab2.waitExpectedMessage(expectedNotificationMess1); editor2.waitTextIntoEditor(textForValidation); projectExplorer1.openItemByPath(projectName + "/" + nameReadmeFile); projectExplorer1.openItemByPath(projectName + "/" + nameFiletxt1); projectExplorer2.openItemByPath(projectName + "/" + nameReadmeFile); projectExplorer2.openItemByPath(projectName + "/" + nameFiletxt1); editor2.typeTextIntoEditor(textForValidationTxt1); eventsTab1.waitExpectedMessage(expectedNotificationMess2); eventsTab1.clearAllMessages(); editor1.closeFileByNameWithSaving(nameFiletxt1); editor2.typeTextIntoEditor(Keys.BACK_SPACE.toString()); editor2.typeTextIntoEditor(Keys.BACK_SPACE.toString()); checkThatNotificationIsNotAppear(8, 500, expectedNotificationMess1); }
From source file:org.eclipse.che.selenium.filewatcher.RefactoringFeatureTest.java
License:Open Source License
private void doRenameRefactor() { menu1.runCommand(TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.Refactoring.REFACTORING, TestMenuCommandsConstants.Assistant.Refactoring.RENAME); editor1.typeTextIntoEditor(renamedClassName.replace(".java", "")); sleepQuietly(1);//from ww w . j a v a 2 s . c o m editor1.typeTextIntoEditor(Keys.ENTER.toString()); projectExplorer1.waitItem(PATH_TO_GREETING_FILE.replace(originClassName, renamedClassName), 10); }
From source file:org.eclipse.che.selenium.git.AddFilesToIndexTest.java
License:Open Source License
@Test public void addFilesTest() throws InterruptedException { projectExplorer.waitProjectExplorer(); projectExplorer.openItemByPath(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.INITIALIZE_REPOSITORY); askDialog.waitFormToOpen();/*from ww w. j a v a 2s . co m*/ askDialog.clickOkBtn(); askDialog.waitFormToClose(); git.waitGitStatusBarWithMess(TestGitConstants.GIT_INITIALIZED_SUCCESS); events.clickProjectEventsTab(); events.waitExpectedMessage(TestGitConstants.GIT_INITIALIZED_SUCCESS); // perform init commit projectExplorer.quickExpandWithJavaScript(); projectExplorer.selectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.COMMIT); git.waitAndRunCommit("init"); loader.waitOnClosed(); // check state of the index projectExplorer.selectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitGitStatusBarWithMess(TestGitConstants.GIT_NOTHING_TO_ADD); events.clickProjectEventsTab(); events.waitExpectedMessage(TestGitConstants.GIT_NOTHING_TO_ADD); //Edit index.jsp projectExplorer.openItemByVisibleNameInExplorer("index.jsp"); editor.waitActiveEditor(); editor.typeTextIntoEditor(Keys.PAGE_DOWN.toString()); editor.typeTextIntoEditor(Keys.END.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor("<!-- Testing add to index-->"); loader.waitOnClosed(); //Add this file to index projectExplorer.selectItem(PROJECT_NAME + "/src/main/webapp/index.jsp"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); events.clickProjectEventsTab(); events.waitExpectedMessage(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); //Check status menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); loader.waitOnClosed(); git.waitGitStatusBarWithMess(STATUS_MESSAGE_ONE_FILE); //Edit GreetingController.java projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/org/eclipse/qa/examples/AppController.java"); editor.waitActiveEditor(); editor.setCursorToLine(16); editor.typeTextIntoEditor("//Testing add to index"); loader.waitOnClosed(); //Create new.css file projectExplorer.selectItem(PROJECT_NAME + "/src/main/webapp"); menu.runCommand(TestMenuCommandsConstants.Project.PROJECT, TestMenuCommandsConstants.Project.New.NEW, TestMenuCommandsConstants.Project.New.CSS_FILE); askForValueDialog.waitFormToOpen(); askForValueDialog.typeAndWaitText("new"); askForValueDialog.clickOkBtn(); //Add all files to index projectExplorer.selectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitAddToIndexFormToOpen(); git.waitAddToIndexFileName("Add content of folder " + PROJECT_NAME + " to index?"); git.confirmAddToIndexForm(); git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); events.clickProjectEventsTab(); events.waitExpectedMessage(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); //Check status menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_MESSAGE_ALL_FILES); //Edit GreetingController.java editor.selectTabByName("AppController"); editor.waitActiveEditor(); editor.typeTextIntoEditor(Keys.DOWN.toString()); editor.typeTextIntoEditor(Keys.DOWN.toString()); editor.typeTextIntoEditor(Keys.DOWN.toString()); editor.typeTextIntoEditor("//Testing add to index"); loader.waitOnClosed(); //Edit index.jsp editor.selectTabByName("index.jsp"); editor.waitActiveEditor(); editor.typeTextIntoEditor(Keys.PAGE_DOWN.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor("<!-- Testing add to index-->"); loader.waitOnClosed(); //Edit new.css editor.selectTabByName("new.css"); editor.waitActiveEditor(); editor.typeTextIntoEditor(Keys.PAGE_DOWN.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor("/* Testing add to index */"); loader.waitOnClosed(); //Check status and add to index all files menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_MESSAGE_AFTER_EDIT); projectExplorer.selectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); // delete README file and add to index deleteFromMenuFile(); projectExplorer.selectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_AFTER_DELETE_FILE); }
From source file:org.eclipse.che.selenium.git.BranchTest.java
License:Open Source License
@Test public void checkoutBranchTest() throws Exception { // perform init commit projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.waitAndSelectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.INITIALIZE_REPOSITORY); loader.waitOnClosed();/* w ww .ja v a2s . c o m*/ askDialog.confirmAndWaitClosed(); git.waitGitStatusBarWithMess(TestGitConstants.GIT_INITIALIZED_SUCCESS); events.clickEventLogBtn(); events.waitExpectedMessage(TestGitConstants.GIT_INITIALIZED_SUCCESS); projectExplorer.waitAndSelectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.COMMIT); git.waitAndRunCommit("init"); loader.waitOnClosed(); createBranch(); switchOnTestBranch(); // create change in AppController.java projectExplorer.quickExpandWithJavaScript(); projectExplorer.openItemByPath(PROJECT_NAME + APP_JAVA_PATH); editor.setCursorToLine(16); editor.typeTextIntoEditor("\n" + "//some change"); editor.waitTextIntoEditor("\n" + "//some change"); loader.waitOnClosed(); // Create change in index.jsp projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/webapp/index.jsp"); editor.waitActive(); editor.typeTextIntoEditor(Keys.PAGE_DOWN.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor(CHANGE_CONTENT_1); editor.waitTextIntoEditor(CHANGE_CONTENT_1); loader.waitOnClosed(); // Create Hello.java class projectExplorer.waitAndSelectItem(PROJECT_NAME + "/src/main/java/org/eclipse/qa/examples"); menu.runCommand(TestMenuCommandsConstants.Project.PROJECT, TestMenuCommandsConstants.Project.New.NEW, TestMenuCommandsConstants.Project.New.JAVA_CLASS); askForValueDialog.waitNewJavaClassOpen(); askForValueDialog.typeTextInFieldName("Hello"); askForValueDialog.clickOkBtnNewJavaClass(); askForValueDialog.waitNewJavaClassClose(); projectExplorer.waitVisibilityByName("Hello.java"); projectExplorer.openItemByVisibleNameInExplorer("Hello.java"); loader.waitOnClosed(); editor.closeFileByNameWithSaving("Hello"); editor.waitWhileFileIsClosed("Hello"); // Create script.js file projectExplorer.waitAndSelectItem(PROJECT_NAME + "/src/main/webapp"); menu.runCommand(TestMenuCommandsConstants.Project.PROJECT, TestMenuCommandsConstants.Project.New.NEW, TestMenuCommandsConstants.Project.New.JAVASCRIPT_FILE); askForValueDialog.waitFormToOpen(); askForValueDialog.typeAndWaitText("script"); askForValueDialog.clickOkBtn(); askForValueDialog.waitFormToClose(); // Check status projectExplorer.waitAndSelectItem(PROJECT_NAME + "/src/main"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); loader.waitOnClosed(); git.waitGitStatusBarWithMess(STATUS_MESSAGE_BEFORE_ADD); // add all files to index and check status projectExplorer.waitAndSelectItem(PROJECT_NAME + "/src/main"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitAddToIndexFormToOpen(); git.confirmAddToIndexForm(); git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); events.clickEventLogBtn(); events.waitExpectedMessage(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_MESSAGE_AFTER_ADD); // commit to repository and check status menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.COMMIT); git.waitAndRunCommit("first commit"); git.waitGitStatusBarWithMess(TestGitConstants.COMMIT_MESSAGE_SUCCESS); events.clickEventLogBtn(); events.waitExpectedMessage(TestGitConstants.COMMIT_MESSAGE_SUCCESS); loader.waitOnClosed(); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_MESSAGE_AFTER_COMMIT); // checkout in main branch and check changed files switchOnMasterBranch(); loader.waitOnClosed(); projectExplorer.openItemByVisibleNameInExplorer("AppController.java"); editor.waitTextNotPresentIntoEditor("\n" + "//some change"); projectExplorer.openItemByVisibleNameInExplorer("index.jsp"); editor.waitTextNotPresentIntoEditor(CHANGE_CONTENT_1); projectExplorer.waitDisappearItemByPath(PROJECT_NAME + HELLO_JAVA_PATH); projectExplorer.waitDisappearItemByPath(PROJECT_NAME + SCRIPT_FILE_PATH); projectExplorer.waitAndSelectItem(PROJECT_NAME + "/src/main"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_MASTER_BRANCH); loader.waitOnClosed(); // switch to test branch again and check earlier changes switchOnTestBranch(); projectExplorer.openItemByVisibleNameInExplorer("AppController.java"); loader.waitOnClosed(); editor.waitTextIntoEditor("\n" + "//some change"); projectExplorer.openItemByVisibleNameInExplorer("index.jsp"); editor.waitTextIntoEditor(CHANGE_CONTENT_1); projectExplorer.openItemByVisibleNameInExplorer("Hello.java"); loader.waitOnClosed(); editor.closeFileByNameWithSaving("Hello"); editor.waitWhileFileIsClosed("Hello"); projectExplorer.openItemByVisibleNameInExplorer("script.js"); loader.waitOnClosed(); editor.closeFileByNameWithSaving("script.js"); editor.waitWhileFileIsClosed("script.js"); // Checkout in main branch, change files in master branch (this creates conflict) and check // message with conflict switchOnMasterBranch(); projectExplorer.waitProjectExplorer(); loader.waitOnClosed(); // create change in GreetingController.java projectExplorer.openItemByPath(PROJECT_NAME + APP_JAVA_PATH); editor.setCursorToLine(2); editor.typeTextIntoEditor("\n" + "//change in master branch"); editor.waitTextIntoEditor("\n" + "//change in master branch"); editor.waitTabFileWithSavedStatus("AppController"); loader.waitOnClosed(); // create change in index.jsp projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/webapp/index.jsp"); editor.waitTextNotPresentIntoEditor(CHANGE_CONTENT_2); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor(Keys.PAGE_UP.toString()); editor.typeTextIntoEditor(CHANGE_CONTENT_2); editor.waitTextIntoEditor(CHANGE_CONTENT_2); editor.waitTabFileWithSavedStatus("index.jsp"); loader.waitOnClosed(); // Add all files to index and check status projectExplorer.waitAndSelectItem(PROJECT_NAME + "/src/main"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); events.clickEventLogBtn(); events.waitExpectedMessage(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); checkShwithConflict(); }
From source file:org.eclipse.che.selenium.git.CheckoutBranchTest.java
License:Open Source License
@Test public void checkoutBranchTest() throws Exception { // perform init commit projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.selectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.INITIALIZE_REPOSITORY); loader.waitOnClosed();//from ww w .j a va 2 s . co m askDialog.confirmAndWaitClosed(); git.waitGitStatusBarWithMess(TestGitConstants.GIT_INITIALIZED_SUCCESS); events.clickProjectEventsTab(); events.waitExpectedMessage(TestGitConstants.GIT_INITIALIZED_SUCCESS); projectExplorer.selectItem(PROJECT_NAME); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.COMMIT); git.waitAndRunCommit("init"); loader.waitOnClosed(); createBranch(); switchOnTestBranch(); // create change in AppController.java projectExplorer.quickExpandWithJavaScript(); projectExplorer.openItemByPath(PROJECT_NAME + APP_JAVA_PATH); editor.setCursorToLine(16); editor.typeTextIntoEditor("\n" + "//some change"); editor.waitTextIntoEditor("\n" + "//some change"); loader.waitOnClosed(); // Create change in index.jsp projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/webapp/index.jsp"); editor.waitActiveEditor(); editor.typeTextIntoEditor(Keys.PAGE_DOWN.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor(CHANGE_CONTENT_1); editor.waitTextIntoEditor(CHANGE_CONTENT_1); loader.waitOnClosed(); // Create Hello.java class projectExplorer.selectItem(PROJECT_NAME + "/src/main/java/org/eclipse/qa/examples"); menu.runCommand(TestMenuCommandsConstants.Project.PROJECT, TestMenuCommandsConstants.Project.New.NEW, TestMenuCommandsConstants.Project.New.JAVA_CLASS); askForValueDialog.waitNewJavaClassOpen(); askForValueDialog.typeTextInFieldName("Hello"); askForValueDialog.clickOkBtnNewJavaClass(); askForValueDialog.waitNewJavaClassClose(); projectExplorer.waitItemInVisibleArea("Hello.java"); projectExplorer.openItemByVisibleNameInExplorer("Hello.java"); loader.waitOnClosed(); editor.closeFileByNameWithSaving("Hello"); editor.waitWhileFileIsClosed("Hello"); // Create script.js file projectExplorer.selectItem(PROJECT_NAME + "/src/main/webapp"); menu.runCommand(TestMenuCommandsConstants.Project.PROJECT, TestMenuCommandsConstants.Project.New.NEW, TestMenuCommandsConstants.Project.New.JAVASCRIPT_FILE); askForValueDialog.waitFormToOpen(); askForValueDialog.typeAndWaitText("script"); askForValueDialog.clickOkBtn(); askForValueDialog.waitFormToClose(); // Check status projectExplorer.selectItem(PROJECT_NAME + "/src/main"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); loader.waitOnClosed(); git.waitGitStatusBarWithMess(STATUS_MESSAGE_BEFORE_ADD); // add all files to index and check status projectExplorer.selectItem(PROJECT_NAME + "/src/main"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitAddToIndexFormToOpen(); git.confirmAddToIndexForm(); git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); events.clickProjectEventsTab(); events.waitExpectedMessage(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_MESSAGE_AFTER_ADD); // commit to repository and check status menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.COMMIT); git.waitAndRunCommit("first commit"); git.waitGitStatusBarWithMess(TestGitConstants.COMMIT_MESSAGE_SUCCESS); events.clickProjectEventsTab(); events.waitExpectedMessage(TestGitConstants.COMMIT_MESSAGE_SUCCESS); loader.waitOnClosed(); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_MESSAGE_AFTER_COMMIT); // checkout in main branch and check changed files switchOnMasterBranch(); loader.waitOnClosed(); projectExplorer.openItemByVisibleNameInExplorer("AppController.java"); editor.waitTextNotPresentIntoEditor("\n" + "//some change"); projectExplorer.openItemByVisibleNameInExplorer("index.jsp"); editor.waitTextNotPresentIntoEditor(CHANGE_CONTENT_1); projectExplorer.waitDisappearItemByPath(PROJECT_NAME + HELLO_JAVA_PATH); projectExplorer.waitDisappearItemByPath(PROJECT_NAME + SCRIPT_FILE_PATH); projectExplorer.selectItem(PROJECT_NAME + "/src/main"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.STATUS); git.waitGitStatusBarWithMess(STATUS_MASTER_BRANCH); loader.waitOnClosed(); // switch to test branch again and check earlier changes switchOnTestBranch(); projectExplorer.openItemByVisibleNameInExplorer("AppController.java"); loader.waitOnClosed(); editor.waitTextIntoEditor("\n" + "//some change"); projectExplorer.openItemByVisibleNameInExplorer("index.jsp"); editor.waitTextIntoEditor(CHANGE_CONTENT_1); projectExplorer.openItemByVisibleNameInExplorer("Hello.java"); loader.waitOnClosed(); editor.closeFileByNameWithSaving("Hello"); editor.waitWhileFileIsClosed("Hello"); projectExplorer.openItemByVisibleNameInExplorer("script.js"); loader.waitOnClosed(); editor.closeFileByNameWithSaving("script.js"); editor.waitWhileFileIsClosed("script.js"); // Checkout in main branch, change files in master branch (this creates conflict) and check message with conflict switchOnMasterBranch(); projectExplorer.waitProjectExplorer(); loader.waitOnClosed(); // create change in GreetingController.java projectExplorer.openItemByPath(PROJECT_NAME + APP_JAVA_PATH); editor.setCursorToLine(2); editor.typeTextIntoEditor("\n" + "//change in master branch"); editor.waitTextIntoEditor("\n" + "//change in master branch"); editor.waitTabFileWithSavedStatus("AppController"); loader.waitOnClosed(); // create change in index.jsp projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/webapp/index.jsp"); editor.waitTextNotPresentIntoEditor(CHANGE_CONTENT_2); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor(Keys.PAGE_UP.toString()); editor.typeTextIntoEditor(CHANGE_CONTENT_2); editor.waitTextIntoEditor(CHANGE_CONTENT_2); editor.waitTabFileWithSavedStatus("index.jsp"); loader.waitOnClosed(); // Add all files to index and check status projectExplorer.selectItem(PROJECT_NAME + "/src/main"); menu.runCommand(TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.ADD_TO_INDEX); git.waitGitStatusBarWithMess(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); events.clickProjectEventsTab(); events.waitExpectedMessage(TestGitConstants.GIT_ADD_TO_INDEX_SUCCESS); checkShwithConflict(); }
From source file:org.eclipse.che.selenium.git.GitChangeMarkersTest.java
License:Open Source License
@Test public void testModificationMarker() { projectExplorer.waitProjectExplorer(); projectExplorer.openItemByPath(PROJECT_NAME); projectExplorer.quickExpandWithJavaScript(); menu.runCommand(GIT, INITIALIZE_REPOSITORY); askDialog.waitFormToOpen();/*from w w w .ja v a2 s. c o m*/ askDialog.clickOkBtn(); askDialog.waitFormToClose(); git.waitGitStatusBarWithMess(GIT_INITIALIZED_SUCCESS); events.clickEventLogBtn(); events.waitExpectedMessage(GIT_INITIALIZED_SUCCESS); // perform init commit projectExplorer.waitAndSelectItem(PROJECT_NAME); menu.runCommand(GIT, TestMenuCommandsConstants.Git.COMMIT); git.waitAndRunCommit("init"); loader.waitOnClosed(); projectExplorer.openItemByPath(PROJECT_NAME + "/src/com/company/Main.java"); editor.waitActive(); editor.waitNoGitChangeMarkers(); editor.typeTextIntoEditor("//", 11); editor.typeTextIntoEditor(Keys.END.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.waitGitModificationMarkerInPosition(11, 13); }
From source file:org.eclipse.che.selenium.git.GitChangeMarkersTest.java
License:Open Source License
@Test(priority = 1) public void testInsertionMarker() { editor.setCursorToLine(16);/* w ww . ja v a 2 s.c o m*/ editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.waitGitInsertionMarkerInPosition(17, 18); }
From source file:org.eclipse.che.selenium.git.GitChangeMarkersTest.java
License:Open Source License
@Test(priority = 4) public void testChangeMarkersAfterCommitFromTerminal() { // Make a change editor.selectTabByName("Main"); editor.typeTextIntoEditor("//", 12); editor.waitGitModificationMarkerInPosition(12, 12); terminal.selectTerminalTab();//from w ww . j av a2 s. c o m 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("1 file changed, 1 insertion(+), 1 deletion(-)"); editor.waitNoGitChangeMarkers(); }
From source file:org.eclipse.che.selenium.git.GitChangeMarkersTest.java
License:Open Source License
@Test(priority = 6) public void testChangeMarkersOnAddedToIndexAndUntrackedFileFromTerminal() { // Add file to index terminal.selectTerminalTab();//from w w w .j av a2s . c o m terminal.typeIntoTerminal("git add src/com/company/Main.java" + Keys.ENTER); editor.waitGitModificationMarkerInPosition(13, 13); // Remove file from index terminal.typeIntoTerminal("git rm --cached src/com/company/Main.java" + Keys.ENTER); editor.waitNoGitChangeMarkers(); }
From source file:org.eclipse.che.selenium.git.GitChangeMarkersTest.java
License:Open Source License
@Test(priority = 7) public void testChangeMarkersOnAddedFile() { // Create new file projectExplorer.waitAndSelectItem(PROJECT_NAME); menu.runCommand(PROJECT, NEW, FILE); askForValueDialog.waitFormToOpen();/* w w w .j ava 2 s. c o m*/ askForValueDialog.typeAndWaitText("newFile"); askForValueDialog.clickOkBtn(); askForValueDialog.waitFormToClose(); editor.closeFileByNameWithSaving("Main"); // Add file to index menu.runCommand(GIT, ADD_TO_INDEX); git.waitAddToIndexFormToOpen(); git.confirmAddToIndexForm(); // Make a change editor.selectTabByName("newFile"); editor.typeTextIntoEditor("change", 1); editor.typeTextIntoEditor(Keys.ENTER.toString()); editor.waitNoGitChangeMarkers(); }