aipim-rails 0.0.174 → 0.0.179
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/aipim +31 -22
- data/config/aipim.yml +2 -0
- data/lib/webdriver/screenshot.rb +3 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0991c1067e6306ba73f5c37bd2491e0ce6279f47
|
4
|
+
data.tar.gz: fd8616584a22eb61e9938d2e49f1d51ef2a58610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fcc6d76752d03effbed8958845c2a7404cfd8b2c37b8784668600515ea50c481c00458d2026cfacfb35c0e61d1d9914c7f387d9f840e68470777798fd22a3e0
|
7
|
+
data.tar.gz: 4aa9f107d2627533cd3780d27ccebf7d6429ccee5d1e363d4ba2f87fd49807f91f844c12f43bf21f4f768c54c9d5a5e099c7fa2590d5afa20c3dd2c61e3a3e45
|
data/bin/aipim
CHANGED
@@ -33,10 +33,13 @@ if ARGV[0] == 'generate'
|
|
33
33
|
# jQuery
|
34
34
|
system('cp '+path+'lib/assets/jquery-1.9.1.js aipim/html')
|
35
35
|
|
36
|
+
#Copia o arquivo de configuracao
|
37
|
+
system('cp -n '+path+'config/aipim.yml config')
|
38
|
+
|
36
39
|
# resolucao padrão
|
37
40
|
width = "1366"
|
38
41
|
height = "768"
|
39
|
-
|
42
|
+
|
40
43
|
|
41
44
|
# argumentos
|
42
45
|
ARGV.each_with_index do |arg, i|
|
@@ -45,30 +48,24 @@ if ARGV[0] == 'generate'
|
|
45
48
|
if ARGV[i] == '--resolution'
|
46
49
|
width = ARGV[i+1].split("x")[0]
|
47
50
|
height = ARGV[i+1].split("x")[1]
|
48
|
-
# argumento do screenshot
|
49
|
-
elsif ARGV[i] == '--no-screenshot'
|
50
|
-
screenshot = false
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
else
|
70
|
-
system('rm -f features/support/screenshot.rb')
|
71
|
-
end
|
55
|
+
# le o arquivo de configuracao do screenshot
|
56
|
+
f = File.open(path+'lib/webdriver/screenshot.rb', "r")
|
57
|
+
# salva tudo numa string
|
58
|
+
f_str = ""
|
59
|
+
f.each_line {|line| f_str = f_str + line}
|
60
|
+
# substitui os valores da resolucao
|
61
|
+
f_str = f_str.gsub("SCREENSHOT_HEIGHT", height).gsub("SCREENSHOT_WIDTH", width)
|
62
|
+
f.close
|
63
|
+
# abre o arquivo de configuracao do screenshot na pasta do cucumber
|
64
|
+
f = File.open("features/support/screenshot.rb", "w")
|
65
|
+
# coloca a string nesse arquivo
|
66
|
+
f.puts f_str
|
67
|
+
f.close
|
68
|
+
|
72
69
|
|
73
70
|
elsif ARGV[0] == 'html'
|
74
71
|
# remove os htmls antigos
|
@@ -86,4 +83,16 @@ elsif ARGV[0] == 'html'
|
|
86
83
|
# geara o html das features
|
87
84
|
Html.features(features)
|
88
85
|
|
89
|
-
|
86
|
+
|
87
|
+
elsif ARGV[0] == '--screenshot'
|
88
|
+
config = YAML.load_file("config/aipim.yml")
|
89
|
+
config['screenshot'] = true
|
90
|
+
File.open("config/aipim.yml", 'w') {|file| file.write config.to_yaml } #Store
|
91
|
+
|
92
|
+
|
93
|
+
elsif ARGV[0] == '--no-screenshot'
|
94
|
+
config = YAML.load_file("config/aipim.yml")
|
95
|
+
config['screenshot'] = false
|
96
|
+
File.open("config/aipim.yml", 'w') {|file| file.write config.to_yaml } #Store
|
97
|
+
|
98
|
+
end
|
data/config/aipim.yml
ADDED
data/lib/webdriver/screenshot.rb
CHANGED
@@ -16,7 +16,9 @@ Before do |scenario|
|
|
16
16
|
end
|
17
17
|
|
18
18
|
After do
|
19
|
-
|
19
|
+
config = YAML.load_file("config/aipim.yml")
|
20
|
+
|
21
|
+
if (@ScenarioTags.include?('@screenshot') && @ScenarioTags.include?('@javascript') && !page.driver.browser.nil? && config['screenshot'])
|
20
22
|
path = "aipim/screenshots/#{@FeatureFile}"
|
21
23
|
system("mkdir -p #{path}")
|
22
24
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aipim-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.179
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Facta TI
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- lib/assets/costum.css
|
56
56
|
- lib/assets/costum.js
|
57
57
|
- lib/assets/header.html
|
58
|
+
- config/aipim.yml
|
58
59
|
- bin/aipim
|
59
60
|
homepage: http://rubygems.org/gems/aipim
|
60
61
|
licenses:
|
@@ -76,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
77
|
version: '0'
|
77
78
|
requirements: []
|
78
79
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.0.
|
80
|
+
rubygems_version: 2.0.3
|
80
81
|
signing_key:
|
81
82
|
specification_version: 4
|
82
83
|
summary: Teste aipim
|