watir-customize_elements 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/watir-customize_elements.rb +1 -17
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 583d6d753c6e1a32280fb82d93798b51801a3183
|
4
|
+
data.tar.gz: d6a7300470bd10f030ad5e8286f959e32d2a30e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bdef1cf0b719bdc3e5ad99d8539d4ab4a4da46d00ab493dd6b59d9912a156907c101ed38eaf730256e81215c067126ecb30ca8ba6ee27a590b3149c0d513fb8
|
7
|
+
data.tar.gz: 75b9b2053b5e4c6688292065ca728008eae79e979a9b0424987df5e1bc7bf7b7ff1fffdbac43a13eb7015ddc0224bd1006806558182ab8a144eae8b2b9abe7b0
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# watir-customize_elements
|
2
|
-
The purpose of this gem is to enable Watir
|
2
|
+
The purpose of this gem is to enable Watir and page-object gem to work with custom, non-standard HTML element tag names.
|
3
3
|
|
4
|
-
While Watir
|
4
|
+
While Watir and the page-object gem do not support non-standard HTML tags, we encountered many cases in our testing when we needed to use such elements.
|
5
5
|
Although it's possible to register custom elements with PageObject via [widgets](https://github.com/cheezy/page-object/wiki/Widgets-%28registering-custom-elements-with-PageObject%29), and to add support for it in Watir, the process of doing so for each custom element got tedious.
|
6
|
-
That's why we created this gem. It automatically instantiates custom HTML tag names into watir
|
6
|
+
That's why we created this gem. It automatically instantiates custom HTML tag names into watir and/or page-object gem from a few lines in a simple yml file.
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
Add this line to your application's Gemfile:
|
@@ -25,10 +25,10 @@ $ gem install watir-customize_elements
|
|
25
25
|
|
26
26
|
## Usage
|
27
27
|
- Create a yml file (call it whatever you like), and include the name and path as an env argument named `CUSTOM_ELEMENTS_CONFIG_PATH`. See explanation at the end of this section
|
28
|
-
- Require watir-customize_elements **after** requiring watir
|
28
|
+
- Require watir-customize_elements **after** requiring watir and/or page-object.
|
29
29
|
- If you don't want to pass `ENV[CUSTOM_ELEMENTS_CONFIG_PATH]` from the command line, set it **before** requiring watir-customize_elements
|
30
30
|
```ruby
|
31
|
-
require 'watir
|
31
|
+
require 'watir'
|
32
32
|
require 'page-object'
|
33
33
|
ENV['CUSTOM_ELEMENTS_CONFIG_PATH'] = 'path\to\custom_elements_file.yml'
|
34
34
|
require 'watir-customize_elements'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'watir
|
1
|
+
require 'watir'
|
2
2
|
require 'page-object'
|
3
3
|
require 'yaml'
|
4
4
|
|
@@ -59,21 +59,6 @@ unless WatirCustomizeElements.custom_elements.nil?
|
|
59
59
|
module Watir
|
60
60
|
# Expanding the case statement in the normalize_selector method to include custom attributes,
|
61
61
|
# since the custom element does not recognize all attributes by default.
|
62
|
-
if Gem.loaded_specs["watir-webdriver"].version <= Gem::Version.create('0.9.1')
|
63
|
-
class ElementLocator
|
64
|
-
alias :old_normalize_selector :normalize_selector
|
65
|
-
|
66
|
-
def normalize_selector(how, what)
|
67
|
-
case how
|
68
|
-
# supporting "name" attribute
|
69
|
-
when :name
|
70
|
-
[how, what]
|
71
|
-
else
|
72
|
-
old_normalize_selector(how, what)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
else
|
77
62
|
module Locators
|
78
63
|
class Element
|
79
64
|
|
@@ -94,7 +79,6 @@ unless WatirCustomizeElements.custom_elements.nil?
|
|
94
79
|
end
|
95
80
|
end
|
96
81
|
end
|
97
|
-
end
|
98
82
|
end
|
99
83
|
|
100
84
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir-customize_elements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yehuda Miller, Shani Raby, Matan Goren, Ronnie Harpaz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: watir
|
14
|
+
name: watir
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: page-object
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.6.7
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Gem for adding custom elements to Watir-webdriver and page-object gem
|