Class: EasyAutomation::Test

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/easy_automation/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test_methodname, path = ".") ⇒ Test

TODO figure out why we need to pass the path from a child class



16
17
18
19
# File 'lib/easy_automation/test.rb', line 16

def initialize(test_methodname, path = ".")
  @path = path
  super(test_methodname)
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



12
13
14
# File 'lib/easy_automation/test.rb', line 12

def data
  @data
end

Instance Method Details

#setupObject

Sets up the environment to run tests, decides whether build a new selenium client

or use a global one.


27
28
29
30
31
32
# File 'lib/easy_automation/test.rb', line 27

def setup
  Runner.configuration.execute :before, :each_test
  @webpage             = Server.rc.open(Runner.configuration.current_browser,
                                                        Runner.configuration.url)
  @data                = LoadData::load_test_data(self.class.to_s, @method_name, @path)
end

#teardownObject

Executed after all tests, normally to stop selenium client.



37
38
39
40
# File 'lib/easy_automation/test.rb', line 37

def teardown
  @webpage.close
  Runner.configuration.execute :after, :each_test
end