Hi,
Could anyone give me some feedback on this?
Each HTML objects exists in a module
<snip>
module Field
MAP_FIELD = Hash.new {|h,k| k}.update(
'username' => 'login', # gui name => HTML name
'password' => 'password'
)
def Field.set(name,args)
$ie.text_field(:name, MAP_FIELD[name]).set(args)
end
def Field.assert(name,args)
puts $ie.text_field(:name, MAP_FIELD[name]).verify_contains(args)
end
end
<snip>
At the top of each module is a hash map that acts as an object map for
each object.The gui name is mapped to the object name
<snip>
MAP_BUTTON = Hash.new {|h| k}.update(
'login' => 'Login'
)
<snip>
IE methods go here
<snip>
module Explorer
def Explorer.start(url)
$ie = IE.new
@url=url
$ie.goto(@url)
end
def Explorer.close
$ie.close
end
end
<snip>
Each test will be in a class
<snip>
class TestClass
def test_1
Explorer.start 'http://aidy_server.com/'
Field.set 'username', 'aidy'
Field.assert 'username', 'aidy'
Field.set 'password', 'password123'
A_Button.press 'login'
Explorer.close
end
end
TestClass.new.test_1
<snip>
Not so sure about logging, but will probably write to XML
Any opinions?
aidy
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general