Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlTextArea


        HtmlTextInput maxAttachmentSize = page.getElementByName("ext_mailer_max_attachment_size");
        assertNotNull("Max attachment size should be present", maxAttachmentSize);
        assertEquals("Max attachment size should be blank by default",
                "", maxAttachmentSize.getText());
       
        HtmlTextArea defaultContent = page.getElementByName("ext_mailer_default_body");
        assertNotNull("Default content should be present", defaultContent);
        assertEquals("Default content should be set by default",
                "$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:\n\nCheck console output at $BUILD_URL to view the results.",
                defaultContent.getText());
       
        HtmlCheckBoxInput debugMode = page.getElementByName("ext_mailer_debug_mode");
        assertNotNull("Debug mode should be present", debugMode);
        assertFalse("Debug mode should not be checked by default", debugMode.isChecked());
       
View Full Code Here


      // Exit Code
      HtmlTextInput exitCodeInput = resultsTable.getFirstRowContainingText("Exit Code").getCellByColumnName("Value").getFirstByXPath(".//input");
      assertEquals("Exit Code should be 0", "0", exitCodeInput.getValueAttribute().trim() );

      String expectedOutputPart = "usage";
      HtmlTextArea outputTA = resultsTable.getFirstRowContainingText("Output").getCellByColumnName("Value").getFirstByXPath(".//textarea");
      String taText = outputTA.getText();
      DebugUtils.writeFile("target/scriptsWithoutParam-output.html", taText);
      assertTrue("classpath.sh parameter-less run output should contain '"+expectedOutputPart+"'; is:\n"+taText,  taText.toLowerCase().contains(expectedOutputPart));

    }
    finally {
View Full Code Here

        ContentTableRow row = resultsTable.getFirstRowContainingText("Command Line Arguments");
        assertNotNull("'Command Line Arguments' row not found.", row);
        HtmlCheckBoxInput unsetCheckbox = row./*getCellByColumnName("Unset").*/ getElement().getFirstByXPath(".//input[@type='checkbox']");
        unsetCheckbox.setChecked(false);
        HtmlTextArea argsTA = row./*getCellByColumnName("Value").*/ getElement().getFirstByXPath(".//textarea"); // [@ondblclick='commandLineArguments']
        argsTA.setText("-c");
        DebugUtils.writeFile("target/scriptsWithParam-settingParams.html", client.getPageAsText());

        ejtt.sleep(2000);

        // Run.
        ((HtmlSubmitInput) client.getElement("parametersForm:okButton")).click();
      }


      // Wait for the operation to succesfuly finish.
      ejtt.operations.waitActivelyForOperationToFinish(EXECUTE_OP_NAME, 5000, 5);
      assertTrue(EXECUTE_OP_NAME+" operation wasn't successful.", ejtt.tabMenu.getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );

      ejtt.sleep(2000);

      // Get the results table.
      //client.getElement("historyDetailsPanel_body");
      HtmlDivision resultsDiv = (HtmlDivision) client.getElement("operationResults");
      if( null == resultsDiv )
        throw new HtmlElementNotFoundException("#operationResults - a div around a results table.");

      HtmlTable resultsTableElm = resultsDiv.getFirstByXPath(".//table[@class='properties-table']");
      if( null == resultsTableElm )
        throw new HtmlElementNotFoundException(".//table[@class='properties-table'] - a results table.");
      ContentTable resultsTable = ejtt.getTabMenu().getTabContentBox().getTable(resultsTableElm);

      // Process the results table.

      // Exit Code
      HtmlTextInput exitCodeInput = resultsTable.getFirstRowContainingText("Exit Code").getCellByColumnName("Value").getFirstByXPath(".//input");
      assertEquals("Exit Code should be 0", "0", exitCodeInput.getValueAttribute().trim() );

      String expectedOutputPart = "/client";
      HtmlTextArea outputTA = resultsTable.getFirstRowContainingText("Output").getCellByColumnName("Value").getFirstByXPath(".//textarea");
      String taText = outputTA.getText().trim();
      DebugUtils.writeFile("target/scriptsWithParam-output.html", client.getPageAsText());
      assertTrue("`classpath.sh -c` run output should contain '"+expectedOutputPart+"'; is:\n"+taText, taText.toLowerCase().contains(expectedOutputPart));

    }
    finally {
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.HtmlTextArea

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.