page-objectify 0.0.6 → 0.0.7

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: 27b019b4792a400a13d6d7356b3f30baa32d1bdc
4
- data.tar.gz: d27150057d0d9c302230501d439cd2874e80cf5f
3
+ metadata.gz: 75b5c3e40feb126c619601465b81c38026abb6d3
4
+ data.tar.gz: e6acab09e7bfb778c4991773412df933088dcaea
5
5
  SHA512:
6
- metadata.gz: c421161615a170a01c336305efc5d2ab73895e26058bb9533c570029371027dfed4d851d314e4296fc3274bdc9b27c17ea48a2fd29aa13181c6c3969d477482b
7
- data.tar.gz: e1bc48f582cead0364858f553e75a20181fed70e0a284b2f975566cbf7762db914d0afc1c38484fb6dfb2fbbf73083b5c2deadc7eac099b3d1f8508b1958f92c
6
+ metadata.gz: c5373b0b3fbe7a50e9f313d34e15c75cec2bcb7ff3e0e20e0b208d82cafc0bf64d9c1030dcf7f572ed48e275ffd85d4611efa16040bd39262542c1efdc13c520
7
+ data.tar.gz: dbe4d112b801d104edc34956267c3671b699b1eacd92258d1e79d2bd0007361bfa35bf6a7b9f562f354d23afc491d6a30c140ee48b348953630324807d562204
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.0.6](https://github.com/smoll/page-objectify/tree/v0.0.6) (2015-11-11)
4
+ [Full Changelog](https://github.com/smoll/page-objectify/compare/v0.0.5...v0.0.6)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - Allow user to configure mapping of HTML ids to PO accessor names [\#11](https://github.com/smoll/page-objectify/issues/11)
9
+
10
+ **Merged pull requests:**
11
+
12
+ - Allow configurable HTML id to PO method name mapping [\#12](https://github.com/smoll/page-objectify/pull/12) ([smoll](https://github.com/smoll))
13
+
3
14
  ## [v0.0.5](https://github.com/smoll/page-objectify/tree/v0.0.5) (2015-11-10)
4
15
  [Full Changelog](https://github.com/smoll/page-objectify/compare/v0.0.4...v0.0.5)
5
16
 
@@ -1,3 +1,4 @@
1
+ require "nokogiri"
1
2
  require "page-object"
2
3
  require "page-objectify/logging"
3
4
 
@@ -5,13 +6,14 @@ module PageObjectify
5
6
  class DOM
6
7
  include Logging
7
8
 
8
- def initialize(doc)
9
- @doc = doc
9
+ def initialize(html)
10
+ @html = html
11
+ @doc = Nokogiri::HTML(@html)
10
12
  @accessors = []
11
13
  @tags_to_accessors = {}
12
14
  @input_types_to_accessors = {}
13
15
  @types = %i(text password checkbox button image reset submit radio hidden file)
14
- @ignored_tags = %i(meta style body) # that could possibly have an HTML id
16
+ @ignored_tags = %i(meta style body script) # that could possibly have an HTML id
15
17
 
16
18
  generate_mapping
17
19
  end
@@ -72,6 +74,12 @@ module PageObjectify
72
74
 
73
75
  # Fix for <input type="button"> and <button> duping each other
74
76
  @tags_to_accessors[:button] = "button"
77
+
78
+ # Fix for https://github.com/smoll/page-objectify/issues/13
79
+ [:h1, :h2, :h3, :h4, :h5].each { |k| @tags_to_accessors[k] = k.to_s }
80
+
81
+ logger.debug "TAGS_TO_ACCESSORS = #{@tags_to_accessors}"
82
+ logger.debug "TYPES_TO_ACCESSORS = #{@input_types_to_accessors}"
75
83
  end
76
84
  end
77
85
  end
@@ -1,4 +1,3 @@
1
- require "nokogiri"
2
1
  require "page-objectify/config"
3
2
  require "page-objectify/dom"
4
3
  require "page-objectify/dom_to_ruby"
@@ -24,8 +23,7 @@ module PageObjectify
24
23
  @url_at_generation = @browser.url
25
24
  logger.info "About to parse HTML! Current URL: #{@url_at_generation}"
26
25
 
27
- doc = Nokogiri::HTML(@browser.html)
28
- @code = DOMToRuby.new(DOM.new(doc), @config).unparse
26
+ @code = DOMToRuby.new(DOM.new(@browser.html), @config).unparse
29
27
 
30
28
  logger.debug "** BEGIN GENERATED CODE **"
31
29
  @code.each_line { |line| logger.debug line.chomp }
@@ -1,3 +1,3 @@
1
1
  module PageObjectify
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page-objectify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shujon Mollah