aipim-rails 0.0.181 → 0.0.182
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webdriver/screenshot.rb +19 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21980d351873eb61fd8aa54cbd499c5e252ac676
|
4
|
+
data.tar.gz: 0fa4a324a7f54f558d69d6a9846f2ecc03969aba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec68b9c87eb637845b0f86e00d85186868bd27f1e90a0805af6804b0aa0bc6cabeb08452cd7074b5ce1ec6e2fbe7c4dd76cb2c55b03ee2a6216646f3c717a5ba
|
7
|
+
data.tar.gz: e817270b79a0dec23230f717f4e43602628c6c6c66b17f052e6c032f098bd36f4cbd6245716bda449e53591e4d60d03758fb38c8faa1c5869dcd5c0410fe7216
|
data/lib/webdriver/screenshot.rb
CHANGED
@@ -3,26 +3,29 @@ require 'selenium-webdriver'
|
|
3
3
|
%x[rm -fr aipim/screenshots/*]
|
4
4
|
|
5
5
|
Before do |scenario|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
if page.driver.browser.respond_to?(:manage)
|
7
|
+
@ScenarioTitle = scenario.title
|
8
|
+
@ScenarioDescription = scenario.description
|
9
|
+
@FeatureFile = scenario.file.to_s.split('/')
|
10
|
+
@FeatureFile.delete_at(0)
|
11
|
+
@FeatureFile = @FeatureFile.join('/')
|
12
|
+
@FeatureName = scenario.feature.title
|
13
|
+
@ScenarioTags = scenario.source_tag_names
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
page.driver.browser.manage.window.maximize
|
16
|
+
page.driver.browser.manage.window.resize_to(SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT)
|
17
|
+
end
|
16
18
|
end
|
17
19
|
|
18
20
|
After do
|
19
|
-
|
21
|
+
if page.driver.browser.respond_to?(:manage)
|
22
|
+
config = YAML.load_file("config/aipim.yml")
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
if (@ScenarioTags.include?('@screenshot') && @ScenarioTags.include?('@javascript') && !page.driver.browser.nil? && config['screenshot'])
|
25
|
+
path = "aipim/screenshots/#{@FeatureFile}"
|
26
|
+
system("mkdir -p #{path}")
|
27
|
+
sleep(1.0)
|
28
|
+
page.driver.save_screenshot("#{path}/#{Time.now.to_i}.png")
|
29
|
+
end
|
27
30
|
end
|
28
31
|
end
|