Package org.zanata.page.projectversion.versionsettings

Examples of org.zanata.page.projectversion.versionsettings.VersionDocumentsTab


                testFileGenerator.generateTestFileWithContent(
                        "uploadedDocumentIsInFilesystem", ".txt",
                        "This is a test file");
        String testFileName = originalFile.getName();

        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("uploadtest")
                .gotoVersion("txt-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(originalFile.getAbsolutePath())
                .submitUpload()
                .clickUploadDone();

        assertThat(new File(documentStorageDirectory).list().length)
                .isEqualTo(1)
                .as("There is only one uploaded source file");

        File newlyCreatedFile = new File(documentStorageDirectory,
                testFileGenerator
                        .getFirstFileNameInDirectory(documentStorageDirectory));

        assertThat(testFileGenerator.getTestFileContent(newlyCreatedFile))
                .isEqualTo("This is a test file")
                .as("The contents of the file were also uploaded");
        VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
                .gotoDocumentTab()
                .waitForSourceDocsContains(testFileName);

        assertThat(versionDocumentsPage.sourceDocumentsContains(testFileName))
                .isTrue()
View Full Code Here


    public void cancelFileUpload() {
        File cancelUploadFile =
                testFileGenerator.generateTestFileWithContent(
                        "cancelFileUpload", ".txt", "Cancel File Upload Test");

        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("uploadtest")
                .gotoVersion("txt-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(cancelUploadFile.getAbsolutePath())
                .cancelUpload();

        assertThat(versionDocumentsTab.sourceDocumentsContains("cancelFileUpload.txt"))
            .isFalse()
            .as("Document does not show in table");
    }
View Full Code Here

            .as("Document does not show in table");
    }

    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void emptyFilenameUpload() {
        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("uploadtest")
                .gotoVersion("txt-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton();

        assertThat(versionDocumentsTab.canSubmitDocument())
                .isFalse()
                .as("The upload button is not available");
    }
View Full Code Here

        testFileGenerator.forceFileSize(bigFile, fileSizeInMB);

        assumeTrue("Data file " + bigFile.getName() + " is big",
                bigFile.length() == fileSizeInMB);

        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("uploadtest")
                .gotoVersion("txt-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(bigFile.getAbsolutePath())
                .submitUpload()
                .clickUploadDone();

        versionDocumentsTab.assertNoCriticalErrors();
        // TODO: Verify graceful handling of scenario
    }
View Full Code Here

                testFileGenerator.generateTestFileWithContent("thereIsNoSpoon",
                        ".txt", "This file will be deleted");
        String successfullyUploaded =
                "Document " + noFile.getName() + " uploaded.";

        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("uploadtest")
                .gotoVersion("txt-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(noFile.getAbsolutePath());

        assertThat(noFile.delete() && !noFile.exists())
                .as("Data file " + noFile.getName() + " does not exist");

        versionDocumentsTab = versionDocumentsTab
                .submitUpload()
                .clickUploadDone();

        versionDocumentsTab.assertNoCriticalErrors();
    }
View Full Code Here

    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void handleVeryLongFileNames() {
        File longFile = testFileGenerator.generateTestFileWithContent(
                testFileGenerator.longFileName(), ".txt",
                "This filename is long");
        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("uploadtest")
                .gotoVersion("txt-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(longFile.getAbsolutePath())
                .submitUpload()
                .clickUploadDone();

        VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
                .gotoDocumentTab()
                .waitForSourceDocsContains(longFile.getName());

        assertThat(versionDocumentsPage.sourceDocumentsContains(longFile.getName()))
                .isTrue()
View Full Code Here

    public void emptyFile() {
        File emptyFile = testFileGenerator
                .generateTestFileWithContent("emptyFile", ".txt", "");
        assumeTrue("File is empty", emptyFile.length() == 0);

        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("uploadtest")
                .gotoVersion("txt-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(emptyFile.getAbsolutePath())
                .submitUpload()
                .clickUploadDone();

        assertThat(emptyFile.exists())
                .isTrue()
                .as("Data file emptyFile.txt still exists");

        VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
                .gotoDocumentTab()
                .waitForSourceDocsContains(emptyFile.getName());

        assertThat(versionDocumentsPage.sourceDocumentsContains(emptyFile.getName()))
                .isTrue()
View Full Code Here

    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void rejectUnsupportedValidFiletype() {
        File unsupportedFile = testFileGenerator
                .generateTestFileWithContent("testfodt", ".fodt", "<xml></xml>");

        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("uploadtest")
                .gotoVersion("txt-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(unsupportedFile.getAbsolutePath());

        assertThat(versionDocumentsTab.getUploadError())
                .contains(VersionDocumentsTab.UNSUPPORTED_FILETYPE)
                .as("Unsupported file type error is shown");
    }
View Full Code Here

        File secondFile = testFileGenerator.generateTestFileWithContent(
                "multiuploadInFilesystem2", ".txt",
                "This is another test file");
        String testFileName = firstFile.getName();

        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("multi-upload")
                .gotoVersion("multi-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(firstFile.getAbsolutePath())
                .enterFilePath(secondFile.getAbsolutePath())
                .submitUpload()
                .clickUploadDone();

        assertThat(new File(documentStorageDirectory).list().length)
                .isEqualTo(2)
                .as("There are two uploaded source files");

        VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
                .gotoDocumentTab()
                .waitForSourceDocsContains(testFileName);

        assertThat(versionDocumentsPage.getSourceDocumentNames())
                .contains(firstFile.getName())
View Full Code Here

    @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
    public void removeFileFromUploadList() {
        File keptUploadFile = testFileGenerator.generateTestFileWithContent(
                "removeFileFromUploadList", ".txt", "Remove File Upload Test");

        VersionDocumentsTab versionDocumentsTab = new ProjectWorkFlow()
                .goToProjectByName("multi-upload")
                .gotoVersion("multi-upload")
                .gotoSettingsTab()
                .gotoSettingsDocumentsTab()
                .pressUploadFileButton()
                .enterFilePath(keptUploadFile.getAbsolutePath())
                .enterFilePath("/tmp/fakefile.txt");

        assertThat(versionDocumentsTab.getUploadList())
                .contains(keptUploadFile.getName())
                .contains("fakefile.txt")
                .as("The intended files are listed");

        versionDocumentsTab = versionDocumentsTab.clickRemoveOn("fakefile.txt");

        assertThat(versionDocumentsTab.getUploadList())
                .contains(keptUploadFile.getName())
                .doesNotContain("fakefile.txt")
                .as("The fakefile has been removed");

        VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
                .submitUpload()
                .clickUploadDone()
                .gotoDocumentTab();

        assertThat(versionDocumentsPage.getSourceDocumentNames())
View Full Code Here

TOP

Related Classes of org.zanata.page.projectversion.versionsettings.VersionDocumentsTab

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.