webdrone 1.7.4 → 1.7.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
  SHA1:
3
- metadata.gz: ec4152b49a70aecac23d87cd4481194eeea6288c
4
- data.tar.gz: 1655eb6697f840afe8bfa5a3548d3109e0feb1e9
3
+ metadata.gz: 79f6baed6b1b3a6dfa49139033fcf90ca441455f
4
+ data.tar.gz: e6db81816ea558f73cb6345fcb21e4f35f6cc880
5
5
  SHA512:
6
- metadata.gz: 7fb2ad2557e549c7fc5859816e18ccfd82ff5ebc9d68faf100704b6e9ea0be65e56a003667f9f62e8fc6ff265028af511ef9fa6a2c330109ed62c8d1910dfc66
7
- data.tar.gz: 5f61954e2a14dd13e5f66b0ee460cecf1ff584c7ca2be8e4bea749f06dee6dc51462be9132ed7af87f585488e9b3202b9b47d878e0a8884cdad4cbaf6829ff1b
6
+ metadata.gz: 5dae707651daccdae02d26ebe4f8322c9eddac50049bce86f21a15bc085df3ca18146f2c5426a35ec4d60ae105b3e0317f69e600c7d4bda127b7b78754a1b64d
7
+ data.tar.gz: aa2ba3f30b3c52ce3d62d0183397c93a64930e354f2f18ce1bbaad2a9d0ee44d67bd75e57e021e6f5dbaf571800b286ed328110ec5d5bc476e5c92f4f045ddf5
data/CHANGELOG.md CHANGED
@@ -4,6 +4,36 @@ New features are summarized here.
4
4
 
5
5
 
6
6
 
7
+ ## v.1.7.8 - 2017-12-06
8
+ ### Added
9
+ - new `headless` option when creating a Webdrone, currently works only for Chrome
10
+ ```ruby
11
+ a0 = Webdrone.create browser: :chrome, headless: true
12
+ ```
13
+
14
+ ### Changed
15
+ - Webdrone now is using `Selenium::WebDriver::Chrome::Options` instead of old prefs hash; default options object can be retrieved at `Browser.chrome_options`.
16
+ - The old `Browser.chrome_prefs` has been removed.
17
+ - You can pass an Options object while creating a new Webdrone:
18
+ ```ruby
19
+ chrome_options = Selenium::Webdrive::Chrome::Options.new
20
+ # set options here…
21
+ chrome_options.add_argument '--headless'
22
+
23
+ a0 = Webdrone.create browser: :chrome, chrome_options: chrome_options
24
+ ```
25
+
26
+ ### Fixed
27
+ - This changelog 🙄
28
+
29
+
30
+
31
+ ## v.1.7.4 - 2017-08-13
32
+ ### Fixed
33
+ - Typo in `a0.html.find_html` method.
34
+
35
+
36
+
7
37
  ## v.1.7.2 - 2017-08-13
8
38
  ### Added
9
39
  - New option to clear the mark outline. Enable with `a0.mark.clear = true` or setting the environment variable `WEBDRONE_MARK_CLEAR` to `true`
@@ -1,6 +1,6 @@
1
1
  module Webdrone
2
2
  class Browser
3
- @@firefox_profile = @@chrome_prefs = nil
3
+ @@firefox_profile = @@chrome_options = nil
4
4
  attr_accessor :driver
5
5
 
6
6
  def self.firefox_profile
@@ -18,11 +18,13 @@ module Webdrone
18
18
  @@firefox_profile = firefox_profile
19
19
  end
20
20
 
21
- def self.chrome_prefs
22
- if @@chrome_prefs == nil
23
- @@chrome_prefs = { download: { prompt_for_download: false }, credentials_enable_service: false }
21
+ def self.chrome_options
22
+ if @@chrome_options == nil
23
+ @@chrome_options = Selenium::WebDriver::Chrome::Options.new
24
+ @@chrome_options.add_preference 'download.prompt_for_download', false
25
+ @@chrome_options.add_preference 'credentials_enable_service:', false
24
26
  end
25
- @@chrome_prefs
27
+ @@chrome_options
26
28
  end
27
29
 
28
30
  def env_update(binding)
@@ -58,7 +60,7 @@ module Webdrone
58
60
  end
59
61
  end
60
62
 
61
- 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_prefs: nil, firefox_profile: nil, remote_url: nil)
63
+ 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)
62
64
  env_update(Kernel.binding) if use_env
63
65
  if create_outdir or outdir
64
66
  outdir ||= File.join("webdrone_output", Time.new.strftime('%Y%m%d_%H%M%S'))
@@ -68,9 +70,11 @@ module Webdrone
68
70
  if remote_url
69
71
  @driver = Selenium::WebDriver.for :remote, url: remote_url, desired_capabilities: browser.to_sym
70
72
  elsif outdir != nil and browser.to_sym == :chrome
71
- chrome_prefs = Browser.chrome_prefs if chrome_prefs == nil
72
- chrome_prefs[:download][:default_directory] = outdir
73
- @driver = Selenium::WebDriver.for browser.to_sym, prefs: chrome_prefs, args: ['--disable-popup-blocking']
73
+ chrome_options = Browser.chrome_options if chrome_options == nil
74
+ chrome_options.add_preference 'download.default_directory', outdir
75
+ chrome_options.add_argument '--disable-popup-blocking'
76
+ chrome_options.add_argument '--headless' if headless
77
+ @driver = Selenium::WebDriver.for browser.to_sym, options: chrome_options
74
78
  elsif outdir != nil and browser.to_sym == :firefox
75
79
  firefox_profile = Browser.firefox_profile if firefox_profile == nil
76
80
  downdir = OS.windows? ? outdir.gsub("/", "\\") : outdir
@@ -1,3 +1,3 @@
1
1
  module Webdrone
2
- VERSION = "1.7.4"
2
+ VERSION = "1.7.8"
3
3
  end
data/lib/webdrone/vrfy.rb CHANGED
@@ -16,7 +16,7 @@ module Webdrone
16
16
  item = @a0.find.send __callee__, text, n: n, all: all, visible: visible, scroll: scroll, parent: parent
17
17
  if item.is_a? Array
18
18
  @a0.mark.mark_item item if mark
19
- item.each { |x| vrfy_item x, text: text, callee: __callee__, attr: attr, eq: eq, contains: contains, mark: mark }
19
+ item.each { |x| vrfy_item x, text: text, callee: __callee__, attr: attr, eq: eq, contains: contains }
20
20
  else
21
21
  @a0.mark.mark_item item if mark
22
22
  vrfy_item item, text: text, callee: __callee__, attr: attr, eq: eq, contains: contains
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.7.4
4
+ version: 1.7.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: 2017-08-14 00:00:00.000000000 Z
11
+ date: 2017-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.6.11
241
+ rubygems_version: 2.6.13
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: A simple selenium webdriver wrapper, ruby version.