Package org.zanata.page.administration

Examples of org.zanata.page.administration.TranslationMemoryPage


    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void createNewTranslationMemory() throws Exception {
        String newTMId = "newtmtest";
        String tmDescription = "A new test TM";

        TranslationMemoryPage translationMemoryPage =
                new TranslationMemoryWorkFlow()
                        .createTranslationMemory(newTMId, tmDescription);

        assertThat(translationMemoryPage
                .expectNotification("Successfully created"))
                .isTrue()
                .as("The success message is displayed");

        assertThat(translationMemoryPage.getListedTranslationMemorys())
                .contains(newTMId)
                .as("The new Translation Memory is listed");

        assertThat(translationMemoryPage.getDescription(newTMId))
                .isEqualTo(tmDescription)
                .as("The description is displayed correctly");
    }
View Full Code Here


    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void abortCreate() throws Exception {
        String abortName = "aborttmtest";
        String abortDescription = "abort tm description";

        TranslationMemoryPage translationMemoryPage = new BasicWorkFlow()
                .goToHome()
                .goToAdministration()
                .goToTranslationMemoryPage()
                .clickCreateNew()
                .enterMemoryID(abortName)
                .enterMemoryDescription(abortDescription)
                .cancelTM();

        assertThat(translationMemoryPage.getListedTranslationMemorys())
                .doesNotContain(abortName)
                .as("The Translation Memory was not created");
    }
View Full Code Here

            tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void translationMemoryIdsAreUnique() throws Exception {
        String nonUniqueTMId = "doubletmtest";

        TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
                .createTranslationMemory(nonUniqueTMId);

        assertThat(tmMemoryPage.getListedTranslationMemorys())
                .contains(nonUniqueTMId)
                .as("The new Translation Memory is listed");

        TranslationMemoryEditPage translationMemoryEditPage = tmMemoryPage
                .clickCreateNew()
                .enterMemoryID(nonUniqueTMId)
                .enterMemoryDescription("Meh")
                .clickSaveAndExpectFailure();
View Full Code Here

    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void importTranslationMemory() throws Exception {
        String importTMId = "importmtest";
        File importFile = testFileGenerator.openTestFile("test-tmx.xml");

        TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
                .createTranslationMemory(importTMId)
                .clickImport(importTMId)
                .enterImportFileName(importFile.getAbsolutePath())
                .clickUploadButtonAndAcknowledge();

        assertThat(tmMemoryPage.getNumberOfEntries(importTMId)).isEqualTo("1")
                .as("The Translation Memory has one entry");
    }
View Full Code Here

            tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void rejectEmptyTranslation() throws Exception {
        String rejectTMId = "rejectemptytmtest";

        TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
                .createTranslationMemory(rejectTMId)
                .clickImport(rejectTMId);
        Alert uploadError = tmMemoryPage.expectFailedUpload();

        assertThat(uploadError.getText()
                .startsWith(TranslationMemoryPage.UPLOAD_ERROR)).isTrue()
                .as("Error is displayed");

        tmMemoryPage = tmMemoryPage.dismissError();

        assertThat(tmMemoryPage.getNumberOfEntries(rejectTMId)).isEqualTo("0")
                .as("No change is recorded");
    }
View Full Code Here

            tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void deleteTranslationMemory() throws Exception {
        String deleteTMId = "deletetmtest";

        TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
                .createTranslationMemory(deleteTMId);

        assertThat(tmMemoryPage.getListedTranslationMemorys())
                .contains(deleteTMId)
                .as("The new Translation Memory is listed");

        tmMemoryPage = tmMemoryPage.clickDeleteTmAndAccept(deleteTMId);

        assertThat(tmMemoryPage.getListedTranslationMemorys())
                .doesNotContain(deleteTMId)
                .as("The new Translation Memory is no longer listed");
    }
View Full Code Here

            tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void dontDeleteTranslationMemory() throws Exception {
        String dontDeleteTMId = "dontdeletetmtest";

        TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
                .createTranslationMemory(dontDeleteTMId);

        assertThat(tmMemoryPage.getListedTranslationMemorys())
                .contains(dontDeleteTMId)
                .as("The new Translation Memory is listed");

        tmMemoryPage = tmMemoryPage.clickDeleteTmAndCancel(dontDeleteTMId);

        assertThat(tmMemoryPage.getListedTranslationMemorys())
                .contains(dontDeleteTMId)
                .as("The new Translation Memory is still listed");
    }
View Full Code Here

    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void clearTranslationMemory() throws Exception {
        String clearTMId = "cleartmtest";
        File importFile = testFileGenerator.openTestFile("test-tmx.xml");

        TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
                .createTranslationMemory(clearTMId)
                .clickImport(clearTMId)
                .enterImportFileName(importFile.getAbsolutePath())
                .clickUploadButtonAndAcknowledge();

        assertThat(tmMemoryPage.getNumberOfEntries(clearTMId)).isEqualTo("1")
                .as("The TM has one item");

        tmMemoryPage = tmMemoryPage.clickClearTMAndAccept(clearTMId);

        assertThat(tmMemoryPage.waitForExpectedNumberOfEntries(clearTMId, "0"))
                .isEqualTo("0")
                .as("The translation memory entries is empty");
    }
View Full Code Here

    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void dontClearTranslationMemory() throws Exception {
        String clearTMId = "dontcleartmtest";
        File importFile = testFileGenerator.openTestFile("test-tmx.xml");

        TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
                .createTranslationMemory(clearTMId)
                .clickImport(clearTMId)
                .enterImportFileName(importFile.getAbsolutePath())
                .clickUploadButtonAndAcknowledge();

        assertThat(tmMemoryPage.getNumberOfEntries(clearTMId)).isEqualTo("1")
                .as("The TM has one item");

        tmMemoryPage = tmMemoryPage.clickClearTMAndCancel(clearTMId);

        assertThat(tmMemoryPage.getNumberOfEntries(clearTMId)).isEqualTo("1")
                .as("The translation memory entries count is the same");
    }
View Full Code Here

    @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");
    }
View Full Code Here

TOP

Related Classes of org.zanata.page.administration.TranslationMemoryPage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.