watir_angular 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b88af5a1527779734181b1cdd1e8c5df74c59121
4
- data.tar.gz: 0a058924f1d6a54ef8a59be0e569f85be65a7b06
3
+ metadata.gz: 4e019786d3a45abfef1cd132d84311e9e19ebe7f
4
+ data.tar.gz: c19d55702a8681c2fa17dc8ae24828424a734932
5
5
  SHA512:
6
- metadata.gz: c8b3b29efc77708b7d4fc051c652a1b4ffbc1eebc3783e648680158a6bce4876ec22e478d58a7e975490a4d4f1160c4e5ee85900c04ee9d2d07e8de892772d7a
7
- data.tar.gz: 61c71af4e3a6bcfbe298ccd24e1511c6b2bb8b7d91e06e2dc262ed5a5fbec330f5bab0dd713fcab6c93d9778c9a69b26a7086e1484e6ba886a23b65242c1032b
6
+ metadata.gz: 6e3578f7a70423f0286df7d0bf0459acf49f7025996a8a22322571a8a68576ad9169585775a12a64afad11735b3b349b21dee8de6b20c71ce83d99c8e68c7fe7
7
+ data.tar.gz: e50bda2128b5bc1980a58042e078e23bd313bee521b747a0cbdb7cf7a6570ec07b757078b1f1d1085cbba55b9590daa4350abf2762f7ab24548cbfe8ad222b22
@@ -2,6 +2,8 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.4.1
5
+ addons:
6
+ chrome: stable
5
7
  before_install:
6
8
  - export DISPLAY=:99
7
9
  - sh -e /etc/init.d/xvfb start
data/README.md CHANGED
@@ -26,6 +26,12 @@ Or install it yourself as:
26
26
 
27
27
  $ gem install watir_angular
28
28
 
29
+ ## Usage
30
+
31
+ ```ruby
32
+ require "watir_angular"
33
+ ```
34
+
29
35
  ## Contributing
30
36
 
31
37
  Bug reports and pull requests are welcome on GitHub at https://github.com/titusfortner/watir_angular.
@@ -2,10 +2,7 @@
2
2
  # From https://github.com/watir/watir/pull/387
3
3
 
4
4
  require "watir"
5
-
6
- require 'watir_angular/locators/element/locator'
7
5
  require 'watir_angular/locators/element/selector_builder'
8
- require 'watir_angular/locators/element/validator'
9
6
 
10
7
  module WatirAngular
11
8
  def wait_for_angular(timeout: Watir.default_timeout)
@@ -28,3 +25,16 @@ end
28
25
 
29
26
  require 'extensions/watir/browser'
30
27
  Watir.locator_namespace = WatirAngular::Locators
28
+
29
+ WatirAngular::Locators::Element::Locator = Watir::Locators::Element::Locator
30
+ WatirAngular::Locators::Element::Validator = Watir::Locators::Element::Validator
31
+
32
+ # Behaviors for element subclasses to come from Watir rather than WatirAngular superclass element
33
+ WatirAngular::Locators::Button::Locator = Watir::Locators::Button::Locator
34
+ WatirAngular::Locators::Button::Validator = Watir::Locators::Button::Validator
35
+ WatirAngular::Locators::Cell::Locator = Watir::Locators::Cell::Locator
36
+ WatirAngular::Locators::Row::Locator = Watir::Locators::Row::Locator
37
+ WatirAngular::Locators::TextArea::Locator = Watir::Locators::TextArea::Locator
38
+ WatirAngular::Locators::TextField::Locator = Watir::Locators::TextField::Locator
39
+ WatirAngular::Locators::TextField::Validator = Watir::Locators::TextField::Validator
40
+
@@ -1,28 +1,61 @@
1
1
  module WatirAngular
2
2
  module Locators
3
- class Element
4
- class SelectorBuilder < Watir::Locators::Element::SelectorBuilder
5
3
 
6
- private
7
-
8
- def assert_valid_as_attribute(attribute)
9
- return if ng_attribute?(attribute)
10
- super
11
- end
4
+ module SelectorHelpers
5
+ def assert_valid_as_attribute(attribute)
6
+ return if ng_attribute?(attribute)
7
+ super
8
+ end
12
9
 
13
- def ng_attribute?(attribute)
14
- ng_attributes.include? attribute[/^ng_(.+)$/, 1]
15
- end
10
+ def ng_attribute?(attribute)
11
+ ng_attributes.include? attribute[/^ng_(.+)$/, 1]
12
+ end
16
13
 
17
- def ng_attributes
18
- %w[app bind bind_html bind_template blur change checked class
14
+ def ng_attributes
15
+ %w[app bind bind_html bind_template blur change checked class
19
16
  class_even class_odd click cloak controller copy csp cut dblclick disabled focus
20
17
  form hide href if include init jq keydown keypress keyup list maxlength
21
18
  minlength model model_options mousedown mouseenter mouseleave mousemove mouseover
22
19
  mouseup non_bindable open options paste pluralize readonly repeat required selected
23
20
  show src srcset style submit switch transclude value]
24
- end
25
21
  end
26
22
  end
23
+
24
+ class Element
25
+ class SelectorBuilder < Watir::Locators::Element::SelectorBuilder
26
+ include SelectorHelpers
27
+ end
28
+ end
29
+
30
+ class Button
31
+ class SelectorBuilder < Watir::Locators::Button::SelectorBuilder
32
+ include SelectorHelpers
33
+ end
34
+ end
35
+
36
+ class Cell
37
+ class SelectorBuilder < Watir::Locators::Cell::SelectorBuilder
38
+ include SelectorHelpers
39
+ end
40
+ end
41
+
42
+ class Row
43
+ class SelectorBuilder < Watir::Locators::Row::SelectorBuilder
44
+ include SelectorHelpers
45
+ end
46
+ end
47
+
48
+ class TextArea
49
+ class SelectorBuilder < Watir::Locators::TextArea::SelectorBuilder
50
+ include SelectorHelpers
51
+ end
52
+ end
53
+
54
+ class TextField
55
+ class SelectorBuilder < Watir::Locators::TextField::SelectorBuilder
56
+ include SelectorHelpers
57
+ end
58
+ end
59
+
27
60
  end
28
61
  end
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+ set -x
5
+
6
+ sh -e /etc/init.d/xvfb start
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "watir_angular"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.2.0"
8
8
  spec.authors = ["Titus Fortner"]
9
9
  spec.email = ["titusfortner@gmail.com"]
10
10
 
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_runtime_dependency "watir", "~> 6.8"
23
+ spec.add_runtime_dependency "watir", "~> 6.8", ">= 6.8.2"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.15"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir_angular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-05 00:00:00.000000000 Z
11
+ date: 2017-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: watir
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '6.8'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 6.8.2
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '6.8'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 6.8.2
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -97,9 +103,8 @@ files:
97
103
  - Rakefile
98
104
  - lib/extensions/watir/browser.rb
99
105
  - lib/watir_angular.rb
100
- - lib/watir_angular/locators/element/locator.rb
101
106
  - lib/watir_angular/locators/element/selector_builder.rb
102
- - lib/watir_angular/locators/element/validator.rb
107
+ - support/travis.sh
103
108
  - watir_angular.gemspec
104
109
  homepage: http://github.com/titusfortner/watir_angular
105
110
  licenses:
@@ -1,8 +0,0 @@
1
- module WatirAngular
2
- module Locators
3
- class Element
4
- class Locator < Watir::Locators::Element::Locator
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module WatirAngular
2
- module Locators
3
- class Element
4
- class Validator < Watir::Locators::Element::Validator
5
- end
6
- end
7
- end
8
- end