Class: PerfectoExecutionContext::PerfectoExecutionContextBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/perfecto-reporting/model/PerfectoExecutionContext.rb

Overview

PerfectoExecutionContext

This class used to create PerfectoExecutionContext instance

example: perfectoExecutionContext::perfectoExecutionContextBuilder .withJob(“job name” , job number ) .withProject(“project name” , project version) .withWebDriver(driver) .build()

Constant Summary collapse

@@job =
nil
@@project =
nil
@@webdriver =
nil
@@contextTags =
nil
@@customFields =
Hash.new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.buildObject

building a new builder instance



85
86
87
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 85

def self.build
  return self.new
end

.withContextTags(*args) ⇒ Object

define contextTags



69
70
71
72
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 69

def self.withContextTags *args
  @@contextTags = args
  return self
end

.withCustomFields(*args) ⇒ Object

define the custom fields, overriding any existing definition



75
76
77
78
79
80
81
82
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 75

def self.withCustomFields *args
	unless args.nil?
		args.each do |cf| 
			@@customFields[cf.key] = cf.value
		end
	end
	return self
end

.withJob(job) ⇒ Object

define a job



51
52
53
54
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 51

def self.withJob job
  @@job = job
  return self
end

.withProject(project) ⇒ Object

define a project



57
58
59
60
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 57

def self.withProject project
  @@project = project
  return self
end

.withWebDriver(webdriver) ⇒ Object

define webdriver



63
64
65
66
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 63

def self.withWebDriver webdriver
  @@webdriver = webdriver
  return self
end

Instance Method Details

#contextTagsObject



97
98
99
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 97

def contextTags
  @@contextTags
end

#customFieldsObject



101
102
103
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 101

def customFields
  @@customFields
end

#jobObject



89
90
91
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 89

def job
  @@job
end

#projectObject



93
94
95
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 93

def project
  @@project
end

#webdriverObject



105
106
107
# File 'lib/perfecto-reporting/model/PerfectoExecutionContext.rb', line 105

def webdriver
  @@webdriver
end