Class: AutomationObject::Framework

Inherits:
Proxy::Proxy show all
Defined in:
lib/automation_object/framework.rb

Overview

Framework class, the core A Proxy class that will become the DSL Framework

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Proxy::Proxy

#method_missing

Constructor Details

#initialize(driver, blue_prints) ⇒ Framework

Will assume nil or :nokogiri is XML based and AutomationObject can also automate XML

Parameters:

  • driver (Selenium::WebDriver::Driver, Appium::Driver, nil)

    selenium type driver or nil

  • blue_prints (Hash)

    arguments for Framework



31
32
33
34
35
36
37
38
39
# File 'lib/automation_object/framework.rb', line 31

def initialize(driver, blue_prints)
  self.driver = driver
  self.blue_prints = blue_prints

  self.state = State.create(self.driver, self.blue_prints)
  @subject = Dsl.create(self.blue_prints, state)

  AutomationObject::Framework.singleton = self
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AutomationObject::Proxy::Proxy

Class Attribute Details

.singletonObject

Returns the value of attribute singleton



92
93
94
# File 'lib/automation_object/framework.rb', line 92

def singleton
  @singleton
end

Instance Attribute Details

#blue_printsAutomationObject::BluePrint::Composite::Top



16
17
18
# File 'lib/automation_object/framework.rb', line 16

def blue_prints
  @blue_prints
end

#driverAutomationObject::Driver::Driver



19
20
21
# File 'lib/automation_object/framework.rb', line 19

def driver
  @driver
end

#dslDsl

Returns workable dsl composite object

Returns:

  • (Dsl)

    workable dsl composite object



25
26
27
# File 'lib/automation_object/framework.rb', line 25

def dsl
  @dsl
end

#stateAutomationObject::State::Session

Returns:

  • (AutomationObject::State::Session)


22
23
24
# File 'lib/automation_object/framework.rb', line 22

def state
  @state
end

Class Method Details

.getAutomationObject::Framework

Singleton method if using Cucumber

Returns:



96
97
98
# File 'lib/automation_object/framework.rb', line 96

def get
  singleton
end

Instance Method Details

#current_screenAutomationObject::Dsl::ScreenProxy

Current Screen



51
52
53
# File 'lib/automation_object/framework.rb', line 51

def current_screen
  @subject.current_screen
end

#quitvoid

This method returns an undefined value.

Reset the entire state, remove any values Leave the driver alone here, can be done elsewhere



83
84
85
86
# File 'lib/automation_object/framework.rb', line 83

def quit
  state.quit # Quit the state.  That way it knows to kill threads if operational
  self.dsl, self.state, self.blue_prints, self.driver = nil
end

#screen(name) ⇒ AutomationObject::Dsl::ScreenProxy

Retrieve screen from composite

Parameters:

  • name (String, Symbol)

    name of screen

Returns:

Raises:



45
46
47
# File 'lib/automation_object/framework.rb', line 45

def screen(name)
  @subject.screen(name)
end