webdrone 1.8.4 → 1.8.6

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: a7f12a7053f038ff4a6e4f1b3d3624eb26b78e72b3048eae567859d84ff7dcdb
4
- data.tar.gz: b0ff6fcf00b34183934c47a76a2e973cfe4a265c60005ef22d6ce336652a8dc8
3
+ metadata.gz: b4ef776ac6df81a126c8860c22324fc53ad9bb541961b2d119c0974ef219fd05
4
+ data.tar.gz: b20c033ba8eb047dfbca5811212911161221118b3a32ca9fe6aa76673994ee4b
5
5
  SHA512:
6
- metadata.gz: e2514fa76503edfff2e9c2eef590b0613c797237366dd3575ff27357e8b070b26372fe6088ad12f76e572e34b978271ce46bd42f6f3c0dc1c453732f08323b24
7
- data.tar.gz: 5b3a228a0f8c5b48ab279d937b12e42df5299e65d8af8067fed48b1137ba18a98c070f51ab6ca6115d3c84d5bb3f2f169fc6344418cf2dd48c650160f41e1186
6
+ metadata.gz: 498bf5d47c5cecbef992eee193d0df96bdec41a4c900bad2c3ea9ac1e0d6fbdcf30868bfce89a8d1b783e2b20798868ef22f455ffcbb7e20a15b5d7726cf85db
7
+ data.tar.gz: 0c499c5a5b4a2ff17e75ef625e6ace9c41e9adeb7129f28e976444fa139bdeca6b515dd6aafbe0c2feb137a4abc13fac8f640b55301c79dce992be60895df286
@@ -4,6 +4,12 @@ New features are summarized here.
4
4
 
5
5
 
6
6
 
7
+ ## v.1.8.6 - 2018-10-04
8
+ ### Changed
9
+ - 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.
10
+
11
+
12
+
7
13
  ## v.1.8.4 - 2018-09-28
8
14
  ### Changed
9
15
  - Added the method `a0.form.selected?` that returns if a checkbox is checked.
@@ -94,7 +94,15 @@ module Webdrone
94
94
  item = find_item(key, n: n, visible: visible, scroll: scroll, parent: parent)
95
95
  @a0.mark.mark_item item if mark
96
96
  if item.tag_name == 'select'
97
- option = item.find_element :xpath, Webdrone::XPath.option(val).to_s
97
+ options = item.find_elements :xpath, Webdrone::XPath.option(val).to_s
98
+ raise "option not found for value: #{val} " if options.empty?
99
+
100
+ # Take the exact match, or the first one
101
+ option = options.find do |elem|
102
+ elem.text == val
103
+ end
104
+ option ||= options.first
105
+
98
106
  option.click
99
107
  else
100
108
  item.clear
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Webdrone
4
- VERSION = "1.8.4"
4
+ VERSION = "1.8.6"
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.4
4
+ version: 1.8.6
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-09-28 00:00:00.000000000 Z
11
+ date: 2018-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler