@Test public void testCodeOutlineJSP() throws Exception { IDE.EXPLORER.waitOpened(); IDE.OPEN.openProject(PROJECT); IDE.EXPLORER.waitForItem(PROJECT + "/" + FILE_NAME); IDE.LOADER.waitClosed(); IDE.EXPLORER.openItem(PROJECT + "/" + FILE_NAME); IDE.EDITOR.waitActiveFile(); // TODO Pause for build outline tree // after implementation method for check ready state, should be remove Thread.sleep(2000); IDE.TOOLBAR.runCommand(ToolbarCommands.View.SHOW_OUTLINE); IDE.OUTLINE.waitOpened(); IDE.OUTLINE.waitOutlineTreeVisible(); checkTreeCorrectlyCreated(); checkClickOnTreeElements(); IDE.EDITOR.closeFile(FILE_NAME); IDE.EDITOR.waitTabNotPresent(FILE_NAME); }
@Test public void testDeleteFileAndOpenFromOneFolder() throws Exception { // open project and check IDE.EXPLORER.waitOpened(); IDE.OPEN.openProject(PROJECT); IDE.LOADER.waitClosed(); IDE.EXPLORER.waitForItem(PROJECT + "/" + folderName); IDE.EXPLORER.selectItem(PROJECT + "/" + folderName); // close welcome tab for easy numbered tabs and editors IDE.EDITOR.clickCloseEditorButton(0); IDE.LOADER.waitClosed(); IDE.EDITOR.waitTabNotPresent(0); // create txt file. Change content IDE.TOOLBAR.runCommandFromNewPopupMenu(MenuCommands.New.TEXT_FILE); IDE.FILE.waitCreateNewFileWindow(); IDE.FILE.typeNewFileName(file1Name); IDE.FILE.clickCreateButton(); IDE.EDITOR.waitTabPresent(0); IDE.EDITOR.waitActiveFile(); IDE.EDITOR.typeTextIntoEditor(file1Content); IDE.TOOLBAR.runCommand(ToolbarCommands.File.SAVE); IDE.LOADER.waitClosed(); IDE.EXPLORER.waitForItem(PROJECT + "/" + folderName + "/" + file1Name); IDE.EDITOR.closeFile(file1Name); // create html file. Change content IDE.TOOLBAR.runCommandFromNewPopupMenu(MenuCommands.New.HTML_FILE); IDE.FILE.waitCreateNewFileWindow(); IDE.FILE.typeNewFileName(file2Name); IDE.FILE.clickCreateButton(); IDE.EDITOR.waitTabPresent(0); IDE.EXPLORER.waitForItem(PROJECT + "/" + folderName + "/" + file2Name); IDE.EDITOR.closeFile(0); // Delete second file and check IDE.EXPLORER.selectItem(PROJECT + "/" + folderName + "/" + file2Name); IDE.TOOLBAR.runCommand("Delete Item(s)..."); IDE.DELETE.waitOpened(); IDE.DELETE.clickOkButton(); IDE.DELETE.waitClosed(); IDE.EXPLORER.waitForItemNotPresent(PROJECT + "/" + folderName + "/" + file2Name); // open first file and check the saved content IDE.EXPLORER.openItem(PROJECT + "/" + folderName + "/" + file1Name); IDE.EDITOR.waitActiveFile(); assertEquals(file1Content, IDE.EDITOR.getTextFromCodeEditor()); IDE.EDITOR.closeFile(0); // delete first file, delete folder and check deleting IDE.EXPLORER.selectItem(PROJECT + "/" + folderName); IDE.TOOLBAR.runCommand("Delete Item(s)..."); IDE.DELETE.waitOpened(); IDE.DELETE.clickOkButton(); IDE.DELETE.waitClosed(); IDE.EXPLORER.waitForItemNotPresent(PROJECT + "/" + folderName); IDE.EXPLORER.waitItemPresent(PROJECT); }
@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 -->"); }