Hi guys I have basic tests than run with ant and log4j and I would like to
have an output like this:
test_modify_staff_phone: Ok
test_modify_staff_phone: Failed
nothing else. How could I achieve this?
f(t)
my test has assertions like:
assert @browser.div(:class, "z-window-modal").text_field(:name,
"phone_number_textbox").exist?, "Cannot Find {Number} text-field."
assert_equal phone_number, @browser.div(:class,
"z-window-modal").text_field(:name, "phone_number_textbox").value.strip
I am running ANT and Log4j with these properties:
log4j.rootLogger=ERROR, LogFile
log4j.logger.org.apache.tools.ant.Project=INFO
log4j.logger.org.apache.tools.ant.Target=INFO
log4j.logger.org.apache.tools.ant.taskdefs=INFO
log4j.logger.org.apache.tools.ant.taskdefs.Echo=WARN
log4j.appender.LogFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout
og4j.appender.LogFile.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.LogFile.layout.ConversionPattern=[%6r] %8c{1} : %m%n
log4j.appender.LogFile.file=dev-monitor.log
My Output Looks like this:
[ 0] Project : Build started.
[ 355] Target : Target "test-filters" started.
[ 999] ExecTask : Loaded suite ../../hco-at/lib/dev_suite
[ 1001] ExecTask : Started
[ 55105] ExecTask : Launching Test for Filters in Incoming Faxes and Orders
[ 55105] ExecTask : Testing Login and Typing Login Credentials
[100046] ExecTask : .Launching Test for Modifying Phone Numbers
[100047] ExecTask : Testing Login and Typing Login Credentials
[120673] ExecTask : FLaunching Test for Sending A Fax
[120673] ExecTask : Testing Login and Typing Login Credentials
[121712] ExecTask : E
[121712] ExecTask : Sending A Fax Test has concluded
[121712] ExecTask :
[121712] ExecTask : Finished in 120.715 seconds.
[121713] ExecTask :
[121713] ExecTask : 1) Failure:
[121713] ExecTask : test_modify_staff_phone(ModifyPhone)
[121714] ExecTask : [../../hco-at/lib/./dev/modify_phone.rb:147:in
`validate_number_has_chaged'
[121715] ExecTask : ../../hco-at/lib/./dev/modify_phone.rb:45:in
`test_modify_staff_phone']:
[121717] ExecTask : Could not find number {123-456-9878} which has been set
to temporarily modify previous phone number {555-257-4109}.
[121717] ExecTask : <false> is not true.
[121718] ExecTask :
[121718] ExecTask : 2) Error:
[121719] ExecTask : test_send_a_fax(SendAFax):
[121720] ExecTask : Watir::Exception::UnknownObjectException: unable to
locate element, using {:tag_name=>"div", :text=>"Smith, Susan J 03/11/1909"}
[121721] ExecTask :
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.2.3/lib/watir-webdriver/elements/element.rb:241:in
`assert_exists'
[121722] ExecTask :
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.2.3/lib/watir-webdriver/elements/element.rb:69:in
`click'
[121723] ExecTask : ../../hco-at/lib/./dev/send_a_fax.rb:40:in
`test_send_a_fax'
[121723] ExecTask :
[121727] ExecTask : 3 tests, 57 assertions, 1 failures, 1 errors
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]