Class: TestCentricity::PageManager

Inherits:
Object
  • Object
show all
Defined in:
lib/testcentricity_web.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#current_pageObject

Returns the value of attribute current_page.



21
22
23
# File 'lib/testcentricity_web.rb', line 21

def current_page
  @current_page
end

Class Method Details

.current_pageObject



46
47
48
# File 'lib/testcentricity_web.rb', line 46

def self.current_page
  @current_page
end

.find_page(page_name) ⇒ Object



41
42
43
44
# File 'lib/testcentricity_web.rb', line 41

def self.find_page(page_name)
  (page_name.is_a? String) ? page_id = page_name.gsub(/\s+/, "").downcase.to_sym : page_id = page_name
  @page_objects[page_id]
end

.loaded?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/testcentricity_web.rb', line 33

def self.loaded?
  not @page_objects.empty?
end

.pagesObject



37
38
39
# File 'lib/testcentricity_web.rb', line 37

def self.pages
  @page_objects
end

.register_page_object(page_ref, page_object) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/testcentricity_web.rb', line 25

def self.register_page_object(page_ref, page_object)
  @page_objects[page_ref] = page_object unless @page_objects.has_key?(page_ref)
  page_key = page_object.page_name.gsub(/\s+/, "").downcase.to_sym
  if page_key != page_ref
    @page_objects[page_key] = page_object unless @page_objects.has_key?(page_key)
  end
end

.set_current_page(page) ⇒ Object



50
51
52
# File 'lib/testcentricity_web.rb', line 50

def self.set_current_page(page)
  @current_page = page
end