results_keeper_rspec 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/results_keeper_rspec.rb +12 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21ddda9f43b3cb4709785f361b631b29bb4024d5
|
4
|
+
data.tar.gz: e8760a9fd23404b7022ddda4a5dd28a8e1b87cd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f111e527660fc379db52318053772ab955d7ce8447b777ab4d3b886f75d617ae5b7a57e4999db48cb3498bb2f98a2c4215b5f7854c0d87b44b2429cc1cb5cc7d
|
7
|
+
data.tar.gz: 2224cbcc2f95bd7abd93d3d147c7c46caf0228ce4588a82cb018af4663ecfe2a68e5cf33ce5b2ac3b3705d009c004df8c738ab92a837bae929ea9114fedfca3b
|
data/lib/results_keeper_rspec.rb
CHANGED
@@ -27,7 +27,8 @@ class ResultsKeeperRspec
|
|
27
27
|
send_json(data, 'revisions')
|
28
28
|
end
|
29
29
|
|
30
|
-
def send_test(scenario
|
30
|
+
def send_test(scenario)
|
31
|
+
@screenshot_path = save_screenshot(scenario) if ENV['SEND_SCREENSHOT']
|
31
32
|
status = scenario.exception ? 'failed' : 'passed'
|
32
33
|
scenario_error = scenario.exception.message if scenario.exception
|
33
34
|
run_path = "rspec #{scenario.location}"
|
@@ -40,7 +41,16 @@ class ResultsKeeperRspec
|
|
40
41
|
revision_id: @revision['revision_id']
|
41
42
|
}
|
42
43
|
@test = send_json(data, 'tests')
|
43
|
-
send_screenshot(screenshot_path) if screenshot_path
|
44
|
+
send_screenshot(@screenshot_path) if @screenshot_path
|
45
|
+
end
|
46
|
+
|
47
|
+
def save_screenshot(scenario)
|
48
|
+
if scenario.exception
|
49
|
+
screenshot_name = "#{Time.now.to_i}_#{rand(1000..9999)}.png"
|
50
|
+
@file_path = "tmp/screenshots/#{screenshot_name}"
|
51
|
+
Capybara.page.save_screenshot(@file_path)
|
52
|
+
@file_path
|
53
|
+
end
|
44
54
|
end
|
45
55
|
|
46
56
|
def send_json(body, path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: results_keeper_rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Kozakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flickraw
|