Hi,

I've Watir,Ruby,Nunit up and running. I've a Watir script that runs ok 
standalone so now I want to incorporate it into Nunit. 

*WatirTest.rb*
require 'watir'
require 'test/unit'
require 'test/unit/assertions'
include Watir

class WatirTest < Test::Unit::TestCase
    def setup
                @ie = IE.new
                @ie.goto("http://www.google.com";)
        end
        
        def test_Valid
                assert(@ie.contains_text('Google'), 'This unit test should 
always pass.')
        end
        
        def test_Invalid
                assert([EMAIL PROTECTED]('Google'), 'This unit test should 
always fail.')
        end
        
        def teardown
                @ie.close
        end
end

*TestWaitir.cs*
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;

namespace Rap.Web.Test
{
    [TestFixture]
    public class TestRubyWatir
    {
        [Test]
        [Category("Watir")]
        //Description="Verifies you may run standard NUnit-only tests."
        public void NUnitOnly_NoRubyAttrib()
        {
            Assert.IsTrue(true, "This NUnit-only test should always pass.");
        }

        [Test]
        public void WatirTest_Valid()
        {
            //RTE.ExecuteTest();
            WatirAssert.TestPassed("WatirTest.rb");
        }
    }
}

The first method "NunitOnly_NoRubyAttrib() works and shows up in Nunit. How do 
I get the second method to work "WatirTest_Valid" to take in my Watir script 
and run in Nunit.

Any help would be greatly appreciated. I'm new to these tools so apologies in 
advance if my question is general.
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to