selenium_fury 0.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.5.1 Adding ability to name attributes in order of id, name, title.
1
2
  v0.5. Adding project files and connecting to a public facing site.
2
3
  v0.2. Adding Validator Code
3
4
  v0.1. Adding Generator Code
@@ -14,6 +14,19 @@
14
14
  # * limitations under the License.
15
15
  # */
16
16
  module PageGenerator
17
+ def get_name_and_value(html_element)
18
+ if html_element.get_attribute("id") != nil
19
+ attribute_name = html_element.get_attribute("id")
20
+ attribute_value = html_element.get_attribute("id")
21
+ elsif html_element.get_attribute("name") != nil
22
+ attribute_name = html_element.get_attribute("name")
23
+ attribute_value = html_element.get_attribute("name")
24
+ elsif html_element.get_attribute("title") != nil
25
+ attribute_name = html_element.get_attribute("title")
26
+ attribute_value = html_element.get_attribute("title")
27
+ end
28
+ return attribute_name, attribute_value
29
+ end
17
30
 
18
31
  def generate_instance_variables_from_html(options)
19
32
  if options.kind_of?(Hash)
@@ -25,8 +38,7 @@ module PageGenerator
25
38
  html_elements = {}
26
39
  if (@locator_type=="css")
27
40
  doc.css(@locator).each do |html_element|
28
- attribute_name = html_element.get_attribute("id")
29
- attribute_value = html_element.get_attribute("id")
41
+ attribute_name, attribute_value = get_name_and_value(html_element)
30
42
  if !attribute_name.nil?
31
43
  attribute_name.gsub!('input-', '')
32
44
  attribute_name.gsub!('select-', '')
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{selenium_fury}
5
- s.version = "0.5"
5
+ s.version = "0.5.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Scott Sims"]
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium_fury
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- version: "0.5"
9
+ - 1
10
+ version: 0.5.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Scott Sims