aipim-rails 0.0.11 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/aipim +9 -1
  3. data/lib/screenshot.rb +20 -0
  4. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b10424c88993b450af48af662e85c96bad5ba717
4
- data.tar.gz: 724cff931c1a10d2f94a3e7d2061f0396eb4309f
3
+ metadata.gz: 5f2f3a0b21538279581718c392a246f01a2b576d
4
+ data.tar.gz: 7e86c4f1c413f40670d7af20db8365ed298b3c01
5
5
  SHA512:
6
- metadata.gz: a9ef43b7471d5a28ab931b03dd0e54ebfe49e19fe385d6171794bbe36ba5a551a44c3e63b22decb90e1b734193568de40edc1fe3b19fc748d4c6ea89484bbad9
7
- data.tar.gz: bba9b2b939f1017b92b3754187a921f9bd675f84f116f2e1004340b46d1f29dcfc661f4371c3f3fd0e3470359a7c5375534bbf34ca81903b33f12614cd90f32b
6
+ metadata.gz: f9b29f1f83ddd006d346052fb6306ab53e4baeb75ec5dcfc1bcc67fa9b8113e9cbf3e8ffe37cf8a6ac247603ed5b042179d1168cd8deec10919e9643c6b260c4
7
+ data.tar.gz: 4f7c701570b233394bb08f5ba685c8c050e93ba3d93da9314639892de0aa9de1b4079f2837574088bd3845b3c77f5655fbb2450d1682ab1995c2bf1405b79eb6
data/bin/aipim CHANGED
@@ -2,4 +2,12 @@
2
2
 
3
3
  require 'aipim-rails'
4
4
 
5
- Parser.init("features/usuario.feature")
5
+ path = File.expand_path(File.dirname(__FILE__))+"/../"
6
+
7
+ if ARGV[0] == 'generate'
8
+ system('mkdir -p aipim')
9
+ system('mkdir -p aipim/screenshots')
10
+ system('cp '+path+'lib/screenshot.rb features/support/')
11
+ else
12
+ Parser.init("features/usuario.feature")
13
+ end
data/lib/screenshot.rb ADDED
@@ -0,0 +1,20 @@
1
+ require 'selenium-webdriver'
2
+
3
+ Capybara.register_driver :selenium do |app|
4
+ Capybara::Selenium::Driver.new(app, :browser => :firefox)
5
+ end
6
+
7
+ %x[rm ../aipim/screenshots/*]
8
+
9
+ # Other drivers are available as well http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/WebDriver.html#for-class_method
10
+ #driver = WebDriver.new()
11
+
12
+ Before('@javascript') do |scenario|
13
+ page.driver.browser.manage.window.maximize
14
+ end
15
+
16
+ After('@screenshot') do
17
+ return unless page.driver.browser
18
+ sleep(1.0)
19
+ page.driver.save_screenshot("../aipim/screenshots/#{Time.now.to_i}.png")
20
+ end
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.11
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facta TI
@@ -20,6 +20,7 @@ files:
20
20
  - lib/aipim-rails.rb
21
21
  - lib/aipim-rails/parser.rb
22
22
  - lib/aipim-rails/parser_helper.rb
23
+ - lib/screenshot.rb
23
24
  - bin/aipim
24
25
  homepage: http://rubygems.org/gems/aipim
25
26
  licenses: