Package net.sourceforge.jwebunit

Examples of net.sourceforge.jwebunit.HttpUnitDialog


    private void updateUI(InvocationTargetException exception, Method method, Object[] args)
        throws IOException {
        String url = "";
        String htmlResponse = "";
        HttpUnitDialog dialog = tester.getDialog();
        if (dialog != null) {
            url = dialog.getResponse().getURL().toString();
            htmlResponse = dialog.getResponse().getText();
        }
        Throwable cause = exception==null?null:exception.getCause();
        updateUI(getTestName(), url, htmlResponse, getMethodCall(method, args), cause);
    }
View Full Code Here


        UploadFileSpec[] testUploads = {
            new UploadFileSpec(filename.substring(filename.lastIndexOf("/")),
                    this.getClass().getClassLoader().getResourceAsStream(filename),
                    "text/plain")
        };
        HttpUnitDialog dialog = getDialog();
        WebForm form = dialog.getForm();
        form.setParameter("formFile", testUploads);
    }
View Full Code Here

        clickImageLinkInTableForRowWithText(imageName, tableId, text);
    }

    public void clickEditTimeImage() {
        assertOnTaskPage();
        HttpUnitDialog dialog = getDialog();
        WebResponse taskPage = dialog.getResponse();
        WebTable timeTable;
        try {
            timeTable = taskPage.getTableWithID("time_entries");
            int lastRowIndex = timeTable.getRowCount() - 1;
            TableCell lastRowCell = timeTable.getTableCell(lastRowIndex, 0);
View Full Code Here

    }

    public void clickImageLinkInNoteWithSubject(String imageName, String subject) {
        int linkRowInNoteTable = 2;
        HttpUnitDialog dialog = getDialog();
        WebResponse storyPage = dialog.getResponse();
        try {
            WebTable noteTable = storyPage.getFirstMatchingTable(new TextInTablePredicate(), subject);
            TableCell linkCell = noteTable.getTableCell(linkRowInNoteTable, 0);
            WebLink deleteLink = linkCell.getFirstMatchingLink(new LinkImagePredicate(), imageName);
            clickLink(deleteLink);
View Full Code Here

    public void clickImageLinkInTableForRowWithText(String imageName,
                                                     String tableId,
                                                     String text) {
        boolean foundLink = false;
        HttpUnitDialog dialog = getDialog();
        WebResponse editPage = dialog.getResponse();
        try {
            WebTable objectTable = editPage.getTableWithID(tableId);
            if (objectTable == null)
                throw new RuntimeException("Acceptance tests require table with id = " + tableId);
            int rowToSearchForLink = getFirstRowNumberWithText(objectTable, text);
View Full Code Here

TOP

Related Classes of net.sourceforge.jwebunit.HttpUnitDialog

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.