Package net.thucydides.core.pages.components

Examples of net.thucydides.core.pages.components.FileToUpload


    public void should_leave_a_unix_java_path_alone_when_running_on_unix() {
        String unixPath = "/home/myuser/target/test-classes/documentUpload/somefile.pdf";
        if (!runningOnWindows()) {
            WebElement field = mock(WebElement.class);

            FileToUpload fileToUpload = new FileToUpload(unixPath);
            fileToUpload.to(field);

            verify(field).sendKeys(unixPath);
        }
    }
View Full Code Here


    public void should_leave_a_windows_java_path_alone_when_running_on_windows() {
        String windowsPath = "C:\\Users\\Joe Blogs\\Documents\\somefile.pdf";
        if (runningOnWindows()) {
            WebElement field = mock(WebElement.class);

            FileToUpload fileToUpload = new FileToUpload(windowsPath);
            fileToUpload.to(field);

            verify(field).sendKeys(windowsPath);
        }
    }
View Full Code Here

        return pages.getPage(pageObjectClass);
    }

    public FileToUpload upload(final String filename) {
        return new FileToUpload(filename).useRemoteDriver(isDefinedRemoteUrl());
    }
View Full Code Here

    }

    public FileToUpload uploadData(String data) throws IOException {
        Path datafile = Files.createTempFile("upload","data");
        Files.write(datafile, data.getBytes());
        return new FileToUpload(datafile.toAbsolutePath().toString()).useRemoteDriver(isDefinedRemoteUrl());
    }
View Full Code Here

    }

    public FileToUpload uploadData(byte[] data) throws IOException {
        Path datafile = Files.createTempFile("upload","data");
        Files.write(datafile, data);
        return new FileToUpload(datafile.toAbsolutePath().toString()).useRemoteDriver(isDefinedRemoteUrl());
    }
View Full Code Here

TOP

Related Classes of net.thucydides.core.pages.components.FileToUpload

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.