Class: CiHelper::CiProcedure

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

Defined Under Namespace

Classes: Result

Constant Summary collapse

CI_LOGIN_URL =

this class hardcoding the procedure to the result page

'http://ci.raamsys.co.uk/login?from=%2F'
CI_DOMAIN =
'http://ci.raamsys.co.uk/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account, password) ⇒ CiProcedure

Returns a new instance of CiProcedure.



16
17
18
19
20
# File 'lib/ci_helper/ci_procedure.rb', line 16

def initialize(, password)
  @account   = 
  @password  = password
  @mechanize = Mechanize.new
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



11
12
13
# File 'lib/ci_helper/ci_procedure.rb', line 11

def 
  @account
end

#console_pageObject

Returns the value of attribute console_page.



10
11
12
# File 'lib/ci_helper/ci_procedure.rb', line 10

def console_page
  @console_page
end

#issue_pageObject

Returns the value of attribute issue_page.



10
11
12
# File 'lib/ci_helper/ci_procedure.rb', line 10

def issue_page
  @issue_page
end

#main_pageObject (readonly)

Returns the value of attribute main_page.



11
12
13
# File 'lib/ci_helper/ci_procedure.rb', line 11

def main_page
  @main_page
end

#matching_strategyObject

Returns the value of attribute matching_strategy.



10
11
12
# File 'lib/ci_helper/ci_procedure.rb', line 10

def matching_strategy
  @matching_strategy
end

#mechanizeObject (readonly)

Returns the value of attribute mechanize.



11
12
13
# File 'lib/ci_helper/ci_procedure.rb', line 11

def mechanize
  @mechanize
end

#passwordObject (readonly)

Returns the value of attribute password.



11
12
13
# File 'lib/ci_helper/ci_procedure.rb', line 11

def password
  @password
end

#raam_pageObject

Returns the value of attribute raam_page.



10
11
12
# File 'lib/ci_helper/ci_procedure.rb', line 10

def raam_page
  @raam_page
end

#resultObject

Returns the value of attribute result.



10
11
12
# File 'lib/ci_helper/ci_procedure.rb', line 10

def result
  @result
end

Instance Method Details

#branch_nameObject



44
45
46
# File 'lib/ci_helper/ci_procedure.rb', line 44

def branch_name
  issue_link.text.split(' ')[1]
end

#commit_hashObject



48
49
50
# File 'lib/ci_helper/ci_procedure.rb', line 48

def commit_hash
  issue_link.text.split(' ')[2]
end

#get_console_outputObject



36
37
38
# File 'lib/ci_helper/ci_procedure.rb', line 36

def get_console_output
  console_page.search("pre.console-output").text
end

#issue_numberObject



40
41
42
# File 'lib/ci_helper/ci_procedure.rb', line 40

def issue_number
  branch_name[1..4]
end

#re_get_console_outputObject



29
30
31
32
33
34
# File 'lib/ci_helper/ci_procedure.rb', line 29

def re_get_console_output
  self.raam_page    = go_to_pull_request_page
  self.issue_page   = go_to_issue
  self.console_page = go_to_console_output
  get_console_output
end

#runObject



22
23
24
25
26
27
# File 'lib/ci_helper/ci_procedure.rb', line 22

def run
  @main_page    = 
  @raam_page    = go_to_pull_request_page
  @issue_page   = go_to_issue
  @console_page = go_to_console_output
end