@Test public void quickOutline() throws Exception { IDE.LOADER.waitClosed(); IDE.EXPLORER.waitOpened(); IDE.OPEN.openProject(projectName); IDE.LOADER.waitClosed(); IDE.PACKAGE_EXPLORER.waitPackageExplorerOpened(); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer(projectName); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("src/main/java"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("src/main/java"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("helloworld"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("helloworld"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer(FILE_NAME); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick(FILE_NAME); IDE.CODE_ASSISTANT_JAVA.waitForJavaToolingInitialized(FILE_NAME); IDE.GOTOLINE.goToLine(24); IDE.JAVAEDITOR.typeTextIntoJavaEditor(Keys.chord(Keys.CONTROL, "o")); waitForQuickOutlineOpened(); assertElementPresent("helloworld"); assertElementPresent("GreetingController"); assertElementPresent("handleRequest(HttpServletRequest, HttpServletResponse)"); selectItem("GreetingController"); waitForQuickOutlineClosed(); IDE.STATUSBAR.waitCursorPositionAt("12 : 1"); }
protected void expandMainItemsInPackageExplorer() { IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("src/main/java"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("sumcontroller"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("sumcontroller"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("SumController.java"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("src"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("src"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("main"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("main"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("webapp"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("webapp"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("calc.jsp"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("WEB-INF"); }
@Test public void checkNewPackageInExplorers() throws Exception { // step one run two browsers. In first browser (owner tenant) wait package explorer and expand // main items initSecondBrowser(); IDE.EXPLORER.waitOpened(); IDE.OPEN.openProject(PROJECT); IDE.PACKAGE_EXPLORER.waitPackageExplorerOpened(); IDE.MENU.runCommand( MenuCommands.Project.PROJECT, MenuCommands.Project.ENABLE_COLLABORATION_MODE); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("src/main/java"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("src"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("pom.xml"); expandMainItemsInPackageExplorer(); // step two In second (ivited user browser) wait project explorer and expand main nodes IDE2.EXPLORER.waitOpened(); IDE2.OPEN.openProject(PROJECT); IDE2.PACKAGE_EXPLORER.waitPackageExplorerOpened(); IDE2.MENU.waitForMenuItemPresent( MenuCommands.Project.PROJECT, MenuCommands.Project.DISABLE_COLLABORATION_MODE); IDE2.PACKAGE_EXPLORER.closePackageExplorer(); IDE2.PACKAGE_EXPLORER.waitPackageExplorerClosed(); IDE2.EXPLORER.waitForItem(PROJECT + "/src"); IDE2.EXPLORER.waitForItem(PROJECT + "/pom.xml"); expandProjectInInviteBrowser(); // step three, create new package in owner browser and check creation in two browsers IDE.PACKAGE_EXPLORER.selectItemInPackageExplorer("src/main/java"); IDE.MENU.runCommand(MenuCommands.File.FILE, MenuCommands.New.NEW, MenuCommands.New.PACKAGE); IDE.LOADER.waitClosed(); IDE.PACKAGE_EXPLORER.waitCreateNewPackageForm(); IDE.PACKAGE_EXPLORER.typeNewPackageName(PACKAGE_NAME); IDE.PACKAGE_EXPLORER.clickCreateNewPackageButton(); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer(PACKAGE_NAME); // checking creation in the browser by invited user IDE2.EXPLORER.waitForItem(PROJECT + "/src/main/java/org"); IDE2.EXPLORER.openItem(PROJECT + "/src/main/java/org"); IDE2.EXPLORER.waitForItem(PROJECT + "/src/main/java/org/ua"); IDE2.EXPLORER.openItem(PROJECT + "/src/main/java/org/ua"); IDE2.EXPLORER.waitForItem(PROJECT + "/src/main/java/org/ua/codenvy"); IDE2.EXPLORER.selectItem(PROJECT + "/src/main/java/org/ua/codenvy"); // step four create new class in the browser by invited use and check in the two browsers IDE2.TOOLBAR.runCommandFromNewPopupMenu(MenuCommands.New.JAVA_CLASS); IDE2.CREATE_NEW_CLASS.waitCreateFormIsPresent(); IDE2.CREATE_NEW_CLASS.waitItemIsPresentInKindList("Class"); IDE2.CREATE_NEW_CLASS.waitItemIsPresentInPackageList("sumcontroller"); IDE2.CREATE_NEW_CLASS.waitItemIsPresentInSourceFolderList("src/main/java"); IDE2.CREATE_NEW_CLASS.typeClassName(NEW_CLASS_NAME); IDE2.CREATE_NEW_CLASS.waitCreateButtonIsEnabled(); IDE2.CREATE_NEW_CLASS.clickCreateBtn(); IDE2.CREATE_NEW_CLASS.waitFormIsClosed(); IDE2.EXPLORER.waitForItem(PROJECT + "/src/main/java/org/ua/codenvy/" + "CollabCheck.java"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("org.ua.codenvy"); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer(NEW_CLASS_NAME + ".java"); // delete calc file by owner and check in two browsers IDE.PACKAGE_EXPLORER.selectItemInPackageExplorer("calc.jsp"); IDE.TOOLBAR.runCommand(ToolbarCommands.File.DELETE); IDE.DELETE.waitOpened(); IDE.DELETE.clickOkButton(); IDE.DELETE.waitClosed(); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorerIsNotPresent("calc.jsp"); IDE2.EXPLORER.waitItemNotPresent(PROJECT + "/src" + "/main" + "/webapp" + "/calc.jsp"); }
@Test public void сopyToMyWorkspaceWithChangesTest() throws Exception { IDE.EXPLORER.waitOpened(); IDE.OPEN.openProject(PROJECT); IDE.PACKAGE_EXPLORER.waitPackageExplorerOpened(); IDE.MENU.runCommand(MenuCommands.Share.SHARE, MenuCommands.Share.FACTORY_URL); IDE.FACTORY_URL.waitFactoryURLFormOpened(); IDE.FACTORY_URL.clickOnNextFactoryButton(); IDE.FACTORY_URL.waitForFinishCreationPage(); String factoryURL = IDE.FACTORY_URL.getDirectSharingURL(); IDE.FACTORY_URL.clickOnFinishButtonInFactoryURLForm(); IDE.LOGIN.logout(); driver.get(LOGIN_URL); Thread.sleep(1000); waitIdeLoginPage(); IDE.LOGIN.waitTenantAllLoginPage(); IDE.LOGIN.tenantLogin(NOT_ROOT_USER_NAME, USER_PASSWORD); if (IDE.SELECT_WORKSPACE.isSelectWorkspacePageOpened() == true) { IDE.SELECT_WORKSPACE.waitWorkspaceInSelectWorkspacePage(TENANT_NAME); IDE.SELECT_WORKSPACE.clickOnWorkspaceName(TENANT_NAME); } driver.get(factoryURL); IDE.LOADER.waitClosed(); IDE.FACTORY_URL.waitWelcomeIframe(); IDE.selectMainFrame(); // do some changes IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer(PROJECT); IDE.PACKAGE_EXPLORER.waitPackageExplorerOpened(); IDE.PACKAGE_EXPLORER.selectItemInPackageExplorer(PROJECT); IDE.RENAME.rename(NEW_PRJ_NAME); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer(NEW_PRJ_NAME); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("pom.xml"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("pom.xml"); IDE.EDITOR.waitActiveFile(); IDE.EDITOR.typeTextIntoEditor(Keys.CONTROL.toString() + Keys.END.toString()); IDE.EDITOR.typeTextIntoEditor("<!-- thisIsChange -->"); IDE.EDITOR.waitFileContentModificationMark("pom.xml"); // check copy to my WS with not saved files IDE.FACTORY_URL.waitCopyToMyWorkspaceButton(); IDE.FACTORY_URL.clickOnCopyToMyWorkspaceButton(); IDE.INFORMATION_DIALOG.waitOpened(); IDE.INFORMATION_DIALOG.waitMessage("Please, save all changes before copying projects."); IDE.INFORMATION_DIALOG.clickOk(); IDE.TOOLBAR.runCommand(ToolbarCommands.File.SAVE); IDE.LOADER.waitClosed(); IDE.EDITOR.waitNoContentModificationMark("pom.xml"); // deleting project on regular WS VirtualFileSystemUtils.delete(PROJECT); // check that project was deleted assertTrue( VirtualFileSystemUtils.get(REST_URL + "itembypath/" + PROJECT).getStatusCode() == 404); IDE.FACTORY_URL.waitCopyToMyWorkspaceButton(); IDE.FACTORY_URL.clickOnCopyToMyWorkspaceButton(); if (IDE.SELECT_WORKSPACE.isSelectWorkspacePageOpened() == true) { IDE.SELECT_WORKSPACE.waitWorkspaceInSelectWorkspacePage(TENANT_NAME); IDE.SELECT_WORKSPACE.clickOnWorkspaceName(TENANT_NAME); } IDE.PACKAGE_EXPLORER.waitPackageExplorerOpened(); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer(NEW_PRJ_NAME); Assert.assertTrue(driver.getCurrentUrl().equals(WORKSPACE_URL)); IDE.PACKAGE_EXPLORER.waitItemInPackageExplorer("pom.xml"); IDE.PACKAGE_EXPLORER.openItemWithDoubleClick("pom.xml"); IDE.EDITOR.waitActiveFile(); IDE.EDITOR.waitContentIsPresent("<!-- thisIsChange -->"); }