autopsy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/autopsy.rb +16 -18
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8649b99898e3ecd05259bdc630ac046ce8f89b1f
4
- data.tar.gz: 86dec6b0b39db427cecf838113e53c87c6a26e8d
3
+ metadata.gz: 3a6496477c5ec86e2d3aad4a56d02645e32eb4c5
4
+ data.tar.gz: 63da106d9b296983ca38892b988e75f2c93030e3
5
5
  SHA512:
6
- metadata.gz: 1de0af4b874e0a0bd0b5bc6a325d13d3e11fb146cc588382767513b3f6b90812deea26ca92f23bfeba7b5ededf015cddd79d8467dc3840b6f569a4c64396b727
7
- data.tar.gz: b43a5bc2b22a305aeaf29083ff0dcc4983b82efe237e89d8f966c105ecd7a99e7ef28737b81e8d8df70db705cbb8d054195e6c325b715a1c4e237a3131f1169b
6
+ metadata.gz: 15ea0486b451ce12fa96fd0a85a71df4ebd1e0ac4c093050cb6e847275309676bad60dbebbbc5664d0b7042c3c854ea77f61a3591d509439053b308d72003a04
7
+ data.tar.gz: 100a12552176a31d3491f5cf7ea025006ad9c3f96f758a2d8348f96b9218d5cbf2d3814fa2d56309bc7049ed25922adc421fa883eefb323863deda375768d44a
data/lib/autopsy.rb CHANGED
@@ -5,28 +5,26 @@ require 'awesome_print'
5
5
  class Autopsy
6
6
  class << self
7
7
  attr_accessor :artifacts_path
8
- end
9
- end
10
-
11
- Autopsy.artifacts_path = "./spec/artifacts" # default
12
8
 
13
- RSpec.configure do |config|
14
- config.after :each, type: :feature do
15
- example = RSpec.current_example
16
- if example.exception != nil
17
- file_base = "#{Autopsy.artifacts_path}/#{example.file_path.split("/").last.split(".").first}-#{example.metadata[:line_number]}"
18
- page.save_screenshot "#{file_base}.png"
19
- page.save_page "#{file_base}.html"
20
- msgs = page.driver.console_messages.ai(html: true)
21
- File.open("#{file_base}_msgs.html", 'w') {|f| f.write(msgs) }
22
- File.open("#{file_base}_error.log", 'w') do |f|
23
- f.write example.exception.message
24
- f.write "\n"
25
- example.exception.backtrace.each do |l|
26
- f.write l
9
+ def perform(capybara_page, test_base, exception)
10
+ file_base = "#{File.expand_path(Autopsy.artifacts_path)}/#{test_base}"
11
+ if exception != nil
12
+ capybara_page.save_screenshot "#{file_base}.png"
13
+ capybara_page.save_page "#{file_base}.html"
14
+ msgs = capybara_page.driver.console_messages.ai(html: true)
15
+ File.open("#{file_base}_msgs.html", 'w') {|f| f.write(msgs) }
16
+ File.open("#{file_base}_error.log", 'w') do |f|
17
+ f.write exception.message
27
18
  f.write "\n"
19
+ exception.backtrace.each do |l|
20
+ f.write l
21
+ f.write "\n"
22
+ end
28
23
  end
29
24
  end
30
25
  end
31
26
  end
32
27
  end
28
+
29
+ Autopsy.artifacts_path = "." # default
30
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autopsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Pleasant-Ryan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: See error messages, screenshots, current HTML, and current Javascript
14
14
  console messages on feature test failures.