page-objectify 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/page-objectify/dom.rb +11 -3
- data/lib/page-objectify/generator.rb +1 -3
- data/lib/page-objectify/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75b5c3e40feb126c619601465b81c38026abb6d3
|
4
|
+
data.tar.gz: e6acab09e7bfb778c4991773412df933088dcaea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/page-objectify/dom.rb
CHANGED
@@ -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(
|
9
|
-
@
|
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
|
-
|
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 }
|