Package org.zanata.page.webtrans

Examples of org.zanata.page.webtrans.EditorPage


        assertThat(clientWorkFlow.isPushSuccessful(result))
                .isTrue()
                .as("The glossary push was successful");

        EditorPage editorPage = new LoginWorkFlow()
                .signIn("admin", "admin")
                .goToProjects()
                .goToProject("about fedora")
                .gotoVersion("master")
                .translate("fr", "About_Fedora");

        editorPage.searchGlossary("filesystem");

        assertThat(editorPage.getGlossaryResultTable().get(1).get(1))
                .isEqualTo("système de fichiers")
                .as("The first glossary result is correct");
    }
View Full Code Here


    public void translateBasicOpenOfficeFile(String extension) {
        File testfile = testFileGenerator
                .openTestFile("test-" + extension + "." + extension);
        zanataRestCaller.createProjectAndVersion(extension+"-translate",
                extension, "file");
        EditorPage editorPage = new ProjectWorkFlow()
                .goToProjectByName(extension+"-translate")
                .gotoVersion(extension)
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(testfile.getAbsolutePath())
                .submitUpload()
                .clickUploadDone()
                .gotoLanguageTab()
                .translate("fr", testfile.getName());

        assertThat(editorPage.getMessageSourceAtRowIndex(0))
                .isEqualTo("Line One")
                .as("Item 1 shows Line One");
        assertThat(editorPage.getMessageSourceAtRowIndex(1))
                .isEqualTo("Line Two")
                .as("Item 2 shows Line Two");
        assertThat(editorPage.getMessageSourceAtRowIndex(2))
                .isEqualTo("Line Three")
                .as("Item 3 shows Line Three");

        editorPage = editorPage
                .translateTargetAtRowIndex(0, "Une Ligne")
                .approveTranslationAtRow(0)
                .translateTargetAtRowIndex(1, "Deux Ligne")
                .approveTranslationAtRow(1)
                .translateTargetAtRowIndex(2, "Ligne Trois")
                .approveTranslationAtRow(2);

        assertTranslations(editorPage);

        // Close and reopen the editor to test save, switches to CodeMirror
        editorPage.reload();

        assertTranslations(editorPage);
    }
View Full Code Here

        restCaller.postSourceDocResource("obsolete-test", "master", resource2,
                false);

        // edit first entry and save
        new LoginWorkFlow().signIn("admin", "admin");
        final EditorPage editorPage = openEditor();
        editorPage.translateTargetAtRowIndex(0, "message one translated")
                .approveTranslationAtRow(0);

        // delete resource 2
        resource2.getTextFlows().clear();
        restCaller.deleteSourceDoc("obsolete-test", "master", "message2");
        // remove last entry from resource 1
        resource1.getTextFlows().remove(3);
        restCaller.putSourceDocResource("obsolete-test", "master", "message1",
                resource1, true);

        final EditorPage editorPageFinal =
                openEditor()
                        .translateTargetAtRowIndex(1, "message two translated")
                        .approveTranslationAtRow(1)
                        .translateTargetAtRowIndex(2, "translated")
                        .approveTranslationAtRow(2);

        editorPageFinal.waitFor(new Callable<String>() {
            @Override
            public String call() throws Exception {
                return editorPageFinal.getStatistics();
            }
        }, Matchers.containsString("100%"));

        VersionLanguagesPage versionPage =
                new BasicWorkFlow().goToPage(String.format(
View Full Code Here

    public void translateBasicTextFile() {
        File testfile = testFileGenerator.generateTestFileWithContent(
                "basictext",".txt",
                "Line One\nLine Two\nLine Three");
        zanataRestCaller.createProjectAndVersion("txt-translate", "txt", "file");
        EditorPage editorPage = new ProjectWorkFlow()
                .goToProjectByName("txt-translate")
                .gotoVersion("txt")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(testfile.getAbsolutePath())
                .submitUpload()
                .clickUploadDone()
                .gotoLanguageTab()
                .translate("fr", testfile.getName());

        assertThat(editorPage.getMessageSourceAtRowIndex(0))
                .isEqualTo("Line One")
                .as("Item 1 shows Line One");
        assertThat(editorPage.getMessageSourceAtRowIndex(1))
                .isEqualTo("Line Two")
                .as("Item 2 shows Line Two");
        assertThat(editorPage.getMessageSourceAtRowIndex(2))
                .isEqualTo("Line Three")
                .as("Item 3 shows Line Three");

        editorPage = editorPage.translateTargetAtRowIndex(0, "Une Ligne")
                .approveTranslationAtRow(0)
                .translateTargetAtRowIndex(1, "Deux Ligne")
                .approveTranslationAtRow(1)
                .translateTargetAtRowIndex(2, "Ligne Trois")
                .approveTranslationAtRow(2);

        assertTranslations(editorPage);

        // Close and reopen the editor to test save, switches to CodeMirror
        editorPage.reload();

        assertTranslations(editorPage);
    }
View Full Code Here

                        }
                        return null;
                    }
                });
        clickLinkAfterAnimation(document);
        return new EditorPage(getDriver());
    }
View Full Code Here

    @Feature(summary = "The user can filter translation entries using more " +
            "than one search term",
            tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void canFilterByMultipleFields() {
        EditorPage editorPage = new BasicWorkFlow()
                .goToEditor("about-fedora", "master", "fr", document);

        assertThat(editorPage.getMessageSources()).containsExactly(
                "hello world", "greetings", "hey");

        final EditorPage page = editorPage.inputFilterQuery("resource-id:res2");

        editorPage.waitFor(new Callable<Iterable<? extends String>>() {
            @Override
            public List<String> call() throws Exception {
                return page.getMessageSources();
            }
        }, Matchers.contains("greetings"));
    }
View Full Code Here

        String urlForEditor =
                String.format(BasicWorkFlow.EDITOR_TEMPLATE, "about-fedora",
                        "master", "fr", document);
        String urlWithFilterCondition =
                urlForEditor + ";search:hello%20w;resid:res1";
        EditorPage editorPage =
                new BasicWorkFlow().goToPage(urlWithFilterCondition,
                        EditorPage.class);

        assertThat(editorPage.getMessageSources()).containsExactly("hello world");
        assertThat(editorPage.getFilterQuery().trim()).isEqualTo("text:hello w resource-id:res1");
    }
View Full Code Here

    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void translateBasicIdmlFile() {
        zanataRestCaller.createProjectAndVersion("idml-translate", "idml", "file");
        File testfile = testFileGenerator.openTestFile("test-idml.idml");

        EditorPage editorPage = new ProjectWorkFlow()
                .goToProjectByName("idml-translate")
                .gotoVersion("idml")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(testfile.getAbsolutePath())
                .submitUpload()
                .clickUploadDone()
                .gotoLanguageTab()
                .translate("fr", testfile.getName());

        assertThat(editorPage.getMessageSourceAtRowIndex(0))
                .isEqualTo("Line One")
                .as("Item 1 shows Line One");
        assertThat(editorPage.getMessageSourceAtRowIndex(1))
                .isEqualTo("Line Two")
                .as("Item 2 shows Line Two");
        assertThat(editorPage.getMessageSourceAtRowIndex(2))
                .isEqualTo("Line Three")
                .as("Item 3 shows Line Three");

        editorPage = editorPage.translateTargetAtRowIndex(0, "Une Ligne")
                .approveTranslationAtRow(0)
                .translateTargetAtRowIndex(1, "Deux Ligne")
                .approveTranslationAtRow(1)
                .translateTargetAtRowIndex(2, "Ligne Trois")
                .approveTranslationAtRow(2);

        assertTranslations(editorPage);

        // Close and reopen the editor to test save
        editorPage.reload();

        assertTranslations(editorPage);
    }
View Full Code Here

    public SampleProjectRule sampleProjectRule = new SampleProjectRule();

    @Test
    public void showTranslationHistory() {
        new LoginWorkFlow().signIn("admin", "admin");
        EditorPage editorPage = new ProjectWorkFlow()
                .goToProjectByName("about fedora")
                .gotoVersion("master")
                .translate("pl", "About_Fedora")
                .translateTargetAtRowIndex(0, "historytest")
                .saveAsFuzzyAtRow(0)
                .clickShowHistoryForRow(0);

        assertThat(editorPage.getHistoryEntryAuthor(0))
                .startsWith("Administrator")
                .as("The user is displayed");
        assertThat(editorPage.getHistoryEntryContent(0))
                .contains("historytest")
                .as("The content change is displayed");
    }
View Full Code Here

    }

    @Test
    public void compareTranslationHistory() {
        new LoginWorkFlow().signIn("admin", "admin");
        EditorPage editorPage = new ProjectWorkFlow()
                .goToProjectByName("about fedora")
                .gotoVersion("master")
                .translate("pl", "About_Fedora")
                .translateTargetAtRowIndex(0, "historytest")
                .saveAsFuzzyAtRow(0)
                .translateTargetAtRowIndex(0, "historytest2")
                .approveTranslationAtRow(0)
                .clickShowHistoryForRow(0)
                .clickCompareOn(0)
                .clickCompareOn(1);

        assertThat(editorPage.getTranslationHistoryCompareTabtext())
                .isEqualTo("Compare ver. 2 and 1")
                .as("The tab displays compared versions");

        editorPage = editorPage.clickCompareVersionsTab();

        assertThat(editorPage.getComparisonTextInRow(0))
                .isEqualTo("historytest2")
                .as("The new text is displayed");
        assertThat(editorPage.getComparisonTextInRow(1))
                .isEqualTo("historytest2")
                .as("The old text is also displayed");
        assertThat(editorPage.getComparisonTextDiff())
                .contains("--2")
                .as("The diff is displayed");
    }
View Full Code Here

TOP

Related Classes of org.zanata.page.webtrans.EditorPage

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.