@Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void translateBasicOdsFile() {
File testfile = testFileGenerator.openTestFile("test-ods.ods");
zanataRestCaller.createProjectAndVersion("ods-translate", "ods", "file");
EditorPage editorPage = new ProjectWorkFlow()
.goToProjectByName("ods-translate")
.gotoVersion("ods")
.gotoSettingsTab()
.gotoSettingsDocumentsTab()
.pressUploadFileButton()
.enterFilePath(testfile.getAbsolutePath())
.submitUpload()
.clickUploadDone()
.gotoLanguageTab()
.translate("fr", testfile.getName());
assertThat(editorPage.getMessageSourceAtRowIndex(0))
.isEqualTo("TestODS")
.as("Item 1 shows TestODS (the sheet name)");
assertThat(editorPage.getMessageSourceAtRowIndex(1))
.isEqualTo("First")
.as("Item 2 shows First (the page name)");
assertThat(editorPage.getMessageSourceAtRowIndex(2))
.isEqualTo("Line One")
.as("Item 3 shows Line One");
assertThat(editorPage.getMessageSourceAtRowIndex(3))
.isEqualTo("Line Two")
.as("Item 4 shows Line Two");
assertThat(editorPage.getMessageSourceAtRowIndex(4))
.isEqualTo("Line Three")
.as("Item 5 shows Line Three");
editorPage = editorPage
.translateTargetAtRowIndex(0, "TestODS")
.approveTranslationAtRow(0)
.translateTargetAtRowIndex(1, "Début")
.approveTranslationAtRow(1)
.translateTargetAtRowIndex(2, "Une Ligne")
.approveTranslationAtRow(2)
.translateTargetAtRowIndex(3, "Deux Ligne")
.approveTranslationAtRow(3)
.translateTargetAtRowIndex(4, "Ligne Trois")
.approveTranslationAtRow(4);
assertTranslations(editorPage);
// Close and reopen the editor to test save, switches to CodeMirror
editorPage.reload();
assertTranslations(editorPage);
}