[ptt-users] patch for TestGenForWeb.java

Lars Huttar lars_huttar at sil.org
Fri Sep 28 09:33:23 PDT 2007


Hello,
I'm not sure where to post this, but here's a proposed patch for 
TestGenForWeb.java 
(com/pushtotest/testmaker/XSTest/client/TestGenForWeb.java, rev=1.12)
The change is to produce more understandable console output when the 
tests are run.
Details:
- indentation of console output reflects the structure of the test run
- several wording changes to clarify for user what the test run is doing
- a couple of spelling typos fixed

My initial experience with using TM to run TG4W tests was somewhat 
confusing. I feel that with these clearer console output messages, a new 
user will have a better idea of what is going on, and will be better 
equipped to identify why tests might be failing.
Hope this can be put to use to make a useful tool even better.

Regards,
Lars


-------------- next part --------------
135c135
<                     System.out.println("oldXpath  "+xpath+": newXpath  " +normalizeXpath(xpath));
---
>                 	System.out.println("     Normalized xpath  \""+xpath+"\" to \"" +normalizeXpath(xpath)+"\"");
141c141
<                         System.out.println("Element "+elem.getNodeName()+" = "+elem.getValueAttribute());
---
>                         System.out.print("     Element "+elem.getNodeName()+" was '"+elem.getValueAttribute());
143c143
<                         System.out.println("Element "+elem.getNodeName()+" set to "+elem.getValueAttribute());
---
>                         System.out.println("'; set to "+elem.getValueAttribute());
153c153
<                      System.out.println("oldXpath  "+xpath+": newXpath \"" +NewPath+"\"");
---
>                      System.out.println("     Normalized xpath  \""+xpath+"\" to \"" +NewPath+"\"");
156c156,160
<                      System.out.println("Elem "+elem);
---
>                      System.out.println("     Selected elem '" + elem + "' for click.");
>                      if (elem == null) {
>                     	 System.out.println("     No clickable element; click aborted.");
>                     	 return;
>                      }
164,165c168,169
<                      String[] refresedPage = myAction.getRefresh().split(",");
<                      String pagename = refresedPage[refresedPage.length-1];
---
>                      String[] refreshedPage = myAction.getRefresh().split(",");
>                      String pagename = refreshedPage[refreshedPage.length-1];
172c176
<                     System.out.println("Error getting page "+ e.getMessage());
---
>                     System.out.println("     Error getting page "+ e.getMessage());
185,186c189,190
<                     System.out.println("Title \""+page.getTitleText()+"\" not equal to \""+value+"\"");
<                 	throw new Exception("Title \""+page.getTitleText()+"\" not equal to \""+value+"\"");
---
>                     System.out.println("     Actual title \""+page.getTitleText()+"\" != expected title \""+value+"\"");
>                 	throw new Exception("     Actual title \""+page.getTitleText()+"\" != expected title \""+value+"\"");
203c207
<         System.out.println("Test run successfull");
---
>         System.out.println("Test run successful.");


More information about the Users mailing list