Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to aggregate all assertion in testunit?
    text
    copied!<p>I am new into watir and I am using testunit for assertion. My script looks like this: Script1 -- has a test method which calls Script2 Script2 -- does all the work and validation. This has all assertion</p> <p>When i run my test case I have to run Script1, it runs successfully but result shows 1 tests, 0 assertions, 0 failures, 0 errors, 0 skips.</p> <p>Here is my code:</p> <p>This is in my first file</p> <pre><code>require_relative 'RubyDriver' require 'test/unit' class RubyTest &lt; Test::Unit::TestCase def test_method driver = RubyDriver.new("/home/pratik/study/UIAutomation/WatirScript.xlsx") driver.call_driver end end </code></pre> <p>And this is part of anotner file</p> <pre><code>require_relative 'ExcelReader' require_relative 'RubyUtility' require "watir-webdriver" require 'test/unit' class RubyDriver &lt; Test::Unit::TestCase def take_action value_property = @rubyutil.get_property("#{value}") if value_property value_prop = value_property.first.strip value_value = value_property.last.strip end case "#{@rubyutil.get_string_upcase("#{keyword}")}" when "VERIFY" puts "verifying" puts value_prop puts value_value object.wait_until_present object.flash if value_prop == "text" assert_equal(object.text, value_value,"Text does not match") # puts object.text.should == value_value elsif value_prop == "exist" value_boolean = value_value == "true" ? true : false assert_equal(object.exists?,value_boolean,"Object does not exist") # puts object.exists?.should == value_value end </code></pre> <p>Everything is working fine except report which shows as </p> <pre><code>1 tests, 0 assertions, 0 failures, 0 errors, 0 skips. </code></pre> <p>Where is my number of assertions.</p> <p>Any help please.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload