A
aidy
Hi,
I have a class for each automated test, and each application window or
any other related group of functionality is in a class
Here is an example of a test class
class ST_LTD_6
def initialize
@browser=Browser.new
@app=Login.new
@territory = Territory.new
@window = Window.new
@generics = Generics.new #could we not use mixins here?
@verify = Verify.new #could we not use mixins here or unit tests?
end
def run
begin
p "TESTID: #{self.class}", "TEST DESCRIPTION: Change View Type"
@browser.start_browser
@app.login
@territory.goto_territory_list
@territory.search_territory("GREENLAND", "NUUK", :view => 'Past'
)
@generics.click_search
p "Do a past and set up an end date at least two days before the
test run"
@verify.verify_result("WHATEVER")
rescue => e
puts("TEST FAILED:" + e.message + "\n" + e.backtrace.join("\n"))
ensure
@app.log_out
@window.close_window
end
end
end
test=ST_LTD_6.new
test.run
Now the next test I have will we be exactly the same as this, but on
this method invocation
@territory.search_territory("GREENLAND", "NUUK", :view => 'Past' )
I need to change or in some cases add additional parameters
so
class ST_LTD_7 < ST_LTD_6
@territory.search_territory("GREENLAND", "NUUK", :stream=> 'Sales' )
end
Could someone please point me in the right direction?
Thank You
Aidy
I have a class for each automated test, and each application window or
any other related group of functionality is in a class
Here is an example of a test class
class ST_LTD_6
def initialize
@browser=Browser.new
@app=Login.new
@territory = Territory.new
@window = Window.new
@generics = Generics.new #could we not use mixins here?
@verify = Verify.new #could we not use mixins here or unit tests?
end
def run
begin
p "TESTID: #{self.class}", "TEST DESCRIPTION: Change View Type"
@browser.start_browser
@app.login
@territory.goto_territory_list
@territory.search_territory("GREENLAND", "NUUK", :view => 'Past'
)
@generics.click_search
p "Do a past and set up an end date at least two days before the
test run"
@verify.verify_result("WHATEVER")
rescue => e
puts("TEST FAILED:" + e.message + "\n" + e.backtrace.join("\n"))
ensure
@app.log_out
@window.close_window
end
end
end
test=ST_LTD_6.new
test.run
Now the next test I have will we be exactly the same as this, but on
this method invocation
@territory.search_territory("GREENLAND", "NUUK", :view => 'Past' )
I need to change or in some cases add additional parameters
so
class ST_LTD_7 < ST_LTD_6
@territory.search_territory("GREENLAND", "NUUK", :stream=> 'Sales' )
end
Could someone please point me in the right direction?
Thank You
Aidy