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
# File 'lib/easy_automation/test.rb', line 27

def setup
  @webpage             = Server.rc.open(Runner.configuration.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.



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

def teardown
  @webpage.close
end