@Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void mustClearBeforeDelete() throws Exception {
String forceClear = "forcecleartodelete";
File importFile = testFileGenerator.openTestFile("test-tmx.xml");
TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
.createTranslationMemory(forceClear)
.clickImport(forceClear)
.enterImportFileName(importFile.getAbsolutePath())
.clickUploadButtonAndAcknowledge();
assertThat(tmMemoryPage.getNumberOfEntries(forceClear)).isEqualTo("1")
.as("The TM has one item");
assertThat(tmMemoryPage.canDelete(forceClear)).isFalse()
.as("The item cannot yet be deleted");
tmMemoryPage = tmMemoryPage.clickClearTMAndAccept(forceClear);
tmMemoryPage.waitForExpectedNumberOfEntries(forceClear, "0");
assertThat(tmMemoryPage.canDelete(forceClear)).isTrue()
.as("The item can be deleted");
tmMemoryPage = tmMemoryPage.clickDeleteTmAndAccept(forceClear);
assertThat(tmMemoryPage.getListedTranslationMemorys())
.doesNotContain(forceClear)
.as("The item is deleted");
}