Unable to use Jira-Ruby gem in "After" hook in test code

102 views Asked by At

I am integrating jira-ruby gem in my testing framework(Ruby, BDD[using cucumber]) to report a bug on failing testcase using rest api. When i used below mentioned code in 'After' hook getting error : SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (OpenSSL::SSL::SSLError)

Code:

After do 
  options ={
    :username     => 'xyzsingh',
    :password     => 'abcsingh',
    :site         => 'https://xyzsingh.atlassian.net/',
    :context_path => '',
    :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE, 
    :auth_type => :basic, 
    :read_timeout => 120
  }

  client = JIRA::Client.new(options)
  issue = client.Issue.build
  issue.save({
    "fields"=>{
      "summary"=>"****",
      "description"=> "Not able to  report bug",
      "project"=>{"key"=>"****"},
      "issuetype"=>{"name"=>"Bug"}
    }
  })
end

Also when i used same code some where else in framework it works and it creates bug in my jira account. It seems that some kind of restriction are there in 'After' hook.Can anyone help me on this?? Thanks in advance!

0

There are 0 answers