Author: ozizka(a)redhat.com
Date: 2009-06-19 10:11:59 -0400 (Fri, 19 Jun 2009)
New Revision: 542
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/scripts/ScriptsTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
Scripts tests updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/scripts/ScriptsTest.java
===================================================================
---
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/scripts/ScriptsTest.java 2009-06-18
18:10:13 UTC (rev 541)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/scripts/ScriptsTest.java 2009-06-19
14:11:59 UTC (rev 542)
@@ -3,6 +3,7 @@
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput;
import com.gargoylesoftware.htmlunit.html.HtmlDivision;
+import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import com.gargoylesoftware.htmlunit.html.HtmlTable;
@@ -261,13 +262,18 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel(EXECUTE_OP_NAME).click();
// Command Line Arguments: "-c"
- ContentTableRow row =
ejtt.tabMenu.getTabContentBox().getFirstTable().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");
+ {
+ HtmlTable resultsTableElm =
((HtmlForm)client.getElement("parametersForm")).getFirstByXPath("table[@class='properties-table']");
+ ContentTable resultsTable = ejtt.getTable(resultsTableElm);
+ ContentTableRow row =
ejtt.tabMenu.getTabContentBox().getFirstTable().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");
+ }
+
// Run.
//ejtt.tabMenu.getTabContentBox().getSubmitButtonByLabel("OK").click();
((HtmlSubmitInput) client.getElement("parametersForm:okButton")).click();
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
---
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-06-18
18:10:13 UTC (rev 541)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-06-19
14:11:59 UTC (rev 542)
@@ -1039,7 +1039,8 @@
/**/ // Give it another chance, JavaScript could change it.
// Get all TH from the first THEAD row that contains TH.
- String xPath = "./thead/tr[th and position()=1]/th";
+ //String xPath = "./thead/tr[th and position()=1]/th";
+ String xPath = ".//tr[th and position()=1]/th";
List<HtmlTableHeaderCell> colHeaders = (List<HtmlTableHeaderCell>)
this.element.getByXPath(xPath);
if( 0 == colHeaders.size() ){
@@ -1538,6 +1539,17 @@
/**
+ * Some of the tables are outside tab menu content box.
+ */
+ public ContentTable getTable(HtmlTable table)
+ {
+ return new ContentTable(table);
+ }
+
+
+
+
+ /**
* Finds a <a> tag inside a form that has a particular label.
*
* TODO: Create Form wrapper.
Show replies by date