class AutomationObject::Framework

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

Attributes

singleton[RW]
blue_prints[RW]

@return [AutomationObject::BluePrint::Composite::Top]

driver[RW]

@return [AutomationObject::Driver::Driver]

dsl[RW]

@return [Dsl] workable dsl composite object

state[RW]

@return [AutomationObject::State::Session]

Public Class Methods

get() click to toggle source

Singleton method if using Cucumber @return [AutomationObject::Framework] singleton of self

# File lib/automation_object/framework.rb, line 96
def get
  singleton
end
new(driver, blue_prints) click to toggle source

Will assume nil or :nokogiri is XML based and AutomationObject can also automate XML @param driver [Selenium::WebDriver::Driver,Appium::Driver,nil] selenium type driver or nil @param blue_prints [Hash] arguments for Framework

# 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

Public Instance Methods

blue_prints=(value) click to toggle source
# File lib/automation_object/framework.rb, line 60
def blue_prints=(value)
  @blue_prints = BluePrint.create(value)
end
current_screen() click to toggle source

Current Screen @return [AutomationObject::Dsl::ScreenProxy]

# File lib/automation_object/framework.rb, line 51
def current_screen
  @subject.current_screen
end
driver=(value) click to toggle source
# File lib/automation_object/framework.rb, line 67
def driver=(value)
  Driver.adapter = case value
                   when Selenium::WebDriver::Driver
                     :selenium
                   when Appium::Driver
                     :appium
                   else
                     :nokogiri
                   end

  @driver = Driver.create(value)
end
quit() click to toggle source

Reset the entire state, remove any values Leave the driver alone here, can be done elsewhere @return [void]

# 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) click to toggle source

Retrieve screen from composite @param name [String, Symbol] name of screen @raise [AutomationObject::Dsl::Error::ScreenDoesNotExistError] @return [AutomationObject::Dsl::ScreenProxy]

# File lib/automation_object/framework.rb, line 45
def screen(name)
  @subject.screen(name)
end