vendredi 25 septembre 2015

I get an error when trying to run a testsuite

This is my test case class:

require "test/unit"

class TestMemberSignin < Test::Unit::TestCase 

def setup()
    @browser1 = startNewBrowser
end


def test_memberSigninPositive()
    assert_equal(true, true)
end


def teardown()
        closeBrowser(@browser1)
end
end

This is my test suite class:

require 'test/unit/testsuite'
require 'test/unit'
require 'test/unit/ui/console/testrunner'

 class TS_MyTests 

def self.suite
    suite = Test::Unit::TestSuite.new
    suite << (TestMemberSignin)
    suite
 end
end

Test::Unit::UI::Console::TestRunner.run(TS_MyTests)

I get this error when I run it:

TS_MyTests.rb:14:in `suite': uninitialized constant TS_MyTests::TestMemberSignin (NameError)
    from /clientdata/apps/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/test-unit-3.1.3/lib/test/unit/ui/testrunner.rb:12:in `initialize'
    from /clientdata/apps/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/test-unit-3.1.3/lib/test/unit/ui/console/testrunner.rb:38:in `initialize'
    from /clientdata/apps/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/test-unit-3.1.3/lib/test/unit/ui/testrunnerutilities.rb:24:in `new'
    from /clientdata/apps/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/test-unit-3.1.3/lib/test/unit/ui/testrunnerutilities.rb:24:in `run'
    from TS_MyTests.rb:22:in `<main>'

Can you please direct me to a solution?

Aucun commentaire:

Enregistrer un commentaire