webdrone 1.8.6 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4ef776ac6df81a126c8860c22324fc53ad9bb541961b2d119c0974ef219fd05
4
- data.tar.gz: b20c033ba8eb047dfbca5811212911161221118b3a32ca9fe6aa76673994ee4b
3
+ metadata.gz: 9d57e52d42a7643c2a91f6f4d620711f96983641de5efaa9d21b748a3f15c429
4
+ data.tar.gz: f9dcb09b5c5d3b6f54cc16c5c89d4e7937aeef1c453e0b5730fb4df8114f49ac
5
5
  SHA512:
6
- metadata.gz: 498bf5d47c5cecbef992eee193d0df96bdec41a4c900bad2c3ea9ac1e0d6fbdcf30868bfce89a8d1b783e2b20798868ef22f455ffcbb7e20a15b5d7726cf85db
7
- data.tar.gz: 0c499c5a5b4a2ff17e75ef625e6ace9c41e9adeb7129f28e976444fa139bdeca6b515dd6aafbe0c2feb137a4abc13fac8f640b55301c79dce992be60895df286
6
+ metadata.gz: be902f2b60e97d6c2d34993a551732d5968d3dedd723d3dc8f175c7c2ff9d3eb964d46b9643fa42164df7a2996842ba0b3d53abbd832a1bf94d293fec5d2136a
7
+ data.tar.gz: 54f43b819a135d2c3e5f82ebced30f376682e648b77dfadd943560d32816d9356bcb2b113581458d692e249263da26409e404855f8a5ff6a18e20f4028817e60
@@ -4,6 +4,16 @@ New features are summarized here.
4
4
 
5
5
 
6
6
 
7
+ ## v.1.8.8 - 2018-10-26
8
+ ### Fixed
9
+ - Fixing `a0.clic` wasn't taking screenshots when passed both `mark: true` and `shot: true`.
10
+
11
+ ### Changed
12
+ - Added new firefox_options (firefox_profile will be removed soon).
13
+ - Added headless support for firefox.
14
+
15
+
16
+
7
17
  ## v.1.8.6 - 2018-10-04
8
18
  ### Changed
9
19
  - In the method `a0.form.set`, when it's being used in a select, it will click preferably the exact text match first, if not then the first option that contains the value.
@@ -19,6 +19,14 @@ module Webdrone
19
19
  @firefox_profile
20
20
  end
21
21
 
22
+ def firefox_options
23
+ return @firefox_options if defined? @firefox_options
24
+
25
+ @firefox_options = Selenium::WebDriver::Firefox::Options.new
26
+
27
+ @firefox_options
28
+ end
29
+
22
30
  def chrome_options
23
31
  return @chrome_options if defined? @chrome_options
24
32
 
@@ -30,7 +38,7 @@ module Webdrone
30
38
  end
31
39
  end
32
40
 
33
- def initialize(browser: 'firefox', create_outdir: true, outdir: nil, timeout: 30, developer: false, logger: true, quit_at_exit: true, maximize: true, error: :raise_report, win_x: nil, win_y: nil, win_w: nil, win_h: nil, use_env: true, chrome_options: nil, firefox_profile: nil, remote_url: nil, headless: false)
41
+ def initialize(browser: 'firefox', create_outdir: true, outdir: nil, timeout: 30, developer: false, logger: true, quit_at_exit: true, maximize: true, error: :raise_report, win_x: nil, win_y: nil, win_w: nil, win_h: nil, use_env: true, chrome_options: nil, firefox_options: nil, firefox_profile: nil, remote_url: nil, headless: false)
34
42
  env_update(Kernel.binding) if use_env
35
43
 
36
44
  if create_outdir || outdir
@@ -46,12 +54,15 @@ module Webdrone
46
54
  chrome_options.add_preference 'download.default_directory', outdir
47
55
  chrome_options.add_argument '--disable-popup-blocking'
48
56
  chrome_options.add_argument '--headless' if headless
49
- @driver = Selenium::WebDriver.for browser.to_sym, options: chrome_options
57
+ @driver = Selenium::WebDriver.for browser.to_sym, options: chrome_options, driver_opts: { log_path: "/tmp/chromedriver.#{$$}.log", verbose: true }
50
58
  elsif !outdir.nil? && browser.to_sym == :firefox
59
+ firefox_options ||= Browser.firefox_options
51
60
  firefox_profile ||= Browser.firefox_profile
61
+
62
+ firefox_options.add_argument '-headless' if headless
52
63
  downdir = OS.windows? ? outdir.tr("/", "\\") : outdir
53
64
  firefox_profile['browser.download.dir'] = downdir
54
- @driver = Selenium::WebDriver.for browser.to_sym, profile: firefox_profile
65
+ @driver = Selenium::WebDriver.for browser.to_sym, profile: firefox_profile, options: firefox_options
55
66
  else
56
67
  @driver = Selenium::WebDriver.for browser.to_sym
57
68
  end
@@ -16,11 +16,8 @@ module Webdrone
16
16
 
17
17
  def clic(text, n: 1, all: false, visible: true, scroll: false, parent: nil, color: '#af1616', times: nil, delay: nil, shot: nil, mark: false)
18
18
  item = @a0.find.send __callee__, text, n: n, all: all, visible: visible, scroll: scroll, parent: parent
19
- if mark
20
- @a0.mark.mark_item(item, color: color, times: times, delay: delay, shot: shot, text: text)
21
- elsif shot
22
- @a0.shot.screen shot.is_a?(String) ? shot : text
23
- end
19
+ @a0.mark.mark_item(item, color: color, times: times, delay: delay, shot: shot, text: text) if mark
20
+ @a0.shot.screen shot.is_a?(String) ? shot : text if shot
24
21
  if item.is_a? Array
25
22
  item.each(&:click)
26
23
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Webdrone
4
- VERSION = "1.8.6"
4
+ VERSION = "1.8.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdrone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 1.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldrin Martoq
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-05 00:00:00.000000000 Z
11
+ date: 2018-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler