Exemple #1
0
  @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);
  }