watir_drops 0.5.7 → 0.5.8

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: 4bda07672a78823149ae29f73c36552e7b39c179
4
- data.tar.gz: 33006c2d09fe6ec7231743ceb70df5647f069d2f
3
+ metadata.gz: 3e1b03e9a9684d4250351bfefb2ab56a2351fc13
4
+ data.tar.gz: 0c4bc45059018b83d0baa6a09dbfcd4395bbee8b
5
5
  SHA512:
6
- metadata.gz: e75a316d7c33ef1a3cc5bbaadebae2c01f27095498d2a2ee80812ac1dbacc10959943ff7636c973cd64737c106a49979f2e274a7f2b0cd4209afcb9f79b2f737
7
- data.tar.gz: c729b0a41127dcdd3056e08790e5c557b6b9a0bddc04f89939228e08eac16780a3fe7797fb73f3c4370f88630a9bd81fc8601d253fd985a11117f450b84a2d8c
6
+ metadata.gz: 766bd79dd80b375a49ead4dde707d56cc7da14e173021862c492cb834848819b19e9cd6d7ffc7f8f9d28ae9c93f713963436eda78b28a9c4184b638b73f39f2a
7
+ data.tar.gz: 480979f6e590e8226b862c71d085ccff66308accd1f7b1e56e28ee161d43b53e7aaa67f680751a254a6e2be555aab1c8ad99098c433a0fd5c611f17939076dcd
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ *~
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
@@ -7,4 +8,4 @@
7
8
  /pkg/
8
9
  /spec/reports/
9
10
  /tmp/
10
- *.idea
11
+ *.idea
data/.travis.yml ADDED
@@ -0,0 +1,27 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.5
5
+ before_script:
6
+ - mkdir travis-drivers
7
+ - export PATH=$PWD/travis-drivers:$PATH
8
+ - sh -e /etc/init.d/xvfb start
9
+ script:
10
+ - |
11
+ # https://omahaproxy.appspot.com
12
+ # https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/
13
+ # CHROME_REVISION=`curl -s http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/LAST_CHANGE`
14
+
15
+ CHROME_REVISION=417841
16
+
17
+ curl -L -O "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CHROME_REVISION}/chrome-linux.zip"
18
+ unzip chrome-linux.zip
19
+
20
+ CHROMEDRIVER_VERSION=$(curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
21
+ curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
22
+ unzip chromedriver_linux64.zip
23
+
24
+ mv chromedriver travis-drivers/chromedriver
25
+ chmod +x travis-drivers/chromedriver
26
+
27
+ bundle exec rake
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.5.8 (2016-12-30)
2
+
3
+ * fix #fill_form issue for TextArea (thanks Tony Godwin!)
4
+
1
5
  ### 0.5.7 (2016-09-21)
2
6
 
3
7
  * add support for Watir 6.0.0.betas
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # WatirDrops
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/watir_drops.svg)](http://badge.fury.io/rb/watir_drops)
4
+ [![Travis Status](https://travis-ci.org/titusfortner/watir_drops.svg?branch=master)](https://travis-ci.org/titusfortner/watir_drops)
5
+
3
6
  This gem leverages the Watir test framework to allow for easy modeling of specific web application information,
4
7
  allowing it to be decoupled from the tests.
5
8
  The intention is to provide a solution that is easy to use and maintain, while still providing power and flexibility.
@@ -8,6 +11,38 @@ The intention is to provide a solution that is easy to use and maintain, while s
8
11
 
9
12
  Create a class that represents a unique page or modal on your site and have it inherit WatirDrops.
10
13
 
14
+ Please see [spec/test_page.rb](spec/test_page.rb) for an example.
15
+
16
+ Once you have created the representation of the page, your automated test can manipluate the page object.
17
+
18
+ Please see [spec/watir_drops_spec.rb](spec/watir_drops_spec.rb) for examples.
19
+
20
+ WatirDrops is written to accept several different ways to model test data.
21
+
22
+ Please see [spec/form_filling_spec.rb](spec/form_filling_spec.rb) for examples.
23
+
24
+ ## Installation
25
+
26
+ Add this line to your application's Gemfile:
27
+
28
+ ```ruby
29
+ gem 'watir_drops'
30
+ ```
31
+
32
+ And then execute:
33
+
34
+ $ bundle
35
+
36
+ Or install it yourself as:
37
+
38
+ $ gem install watir_drops
39
+
40
+ To use this library:
41
+
42
+ ```ruby
43
+ require 'watir_drops'
44
+ ```
45
+
11
46
 
12
47
  ## Contributing
13
48
 
@@ -17,4 +52,3 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/titusfo
17
52
  ## License
18
53
 
19
54
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
20
-
@@ -2,6 +2,7 @@ require 'active_support/inflector'
2
2
 
3
3
  module WatirDrops
4
4
  class PageObject
5
+ include Watir::Waitable
5
6
 
6
7
  class << self
7
8
 
@@ -40,7 +41,6 @@ module WatirDrops
40
41
 
41
42
  define_method("#{name}=") do |val|
42
43
  watir_element = self.instance_exec &block
43
- watir_element.wait_until_present
44
44
  case watir_element
45
45
  when Watir::Radio
46
46
  watir_element.set if val
@@ -50,10 +50,8 @@ module WatirDrops
50
50
  watir_element.select val
51
51
  when Watir::Button
52
52
  watir_element.click
53
- # TODO - Email & Password types are not set to UserEditable in Watir
54
- when Watir::Input
55
- watir_element.wd.clear
56
- watir_element.send_keys val
53
+ when Watir::TextField, Watir::TextArea
54
+ watir_element.set val if val
57
55
  else
58
56
  watir_element.click if val
59
57
  end
@@ -103,12 +101,21 @@ module WatirDrops
103
101
  end
104
102
  end
105
103
 
106
- def title
107
- browser.title
104
+ def inspect
105
+ '#<%s url=%s title=%s>' % [self.class, url.inspect, title.inspect]
108
106
  end
107
+ alias selector_string inspect
109
108
 
110
- def url
111
- browser.url
109
+ def method_missing(method, *args, &block)
110
+ if @browser.respond_to?(method)
111
+ @browser.send(method, *args, &block)
112
+ else
113
+ super
114
+ end
115
+ end
116
+
117
+ def respond_to_missing?(method, _include_all = false)
118
+ @browser.respond_to?(method) || super
112
119
  end
113
120
 
114
121
  end
data/watir_drops.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'watir_drops'
5
- spec.version = '0.5.7'
5
+ spec.version = '0.5.8'
6
6
  spec.authors = ['Titus Fortner']
7
7
  spec.email = ['titusfortner@gmail.com']
8
8
 
@@ -16,7 +16,7 @@ application information, allowing it to be decoupled from the tests}
16
16
  spec.require_paths = ['lib']
17
17
 
18
18
  spec.add_runtime_dependency 'activesupport'
19
- spec.add_runtime_dependency 'watir'
19
+ spec.add_runtime_dependency 'watir', '~> 6.0.0'
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.10'
22
22
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir_drops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: watir
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 6.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 6.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -132,6 +132,7 @@ extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
134
  - ".gitignore"
135
+ - ".travis.yml"
135
136
  - CHANGES.md
136
137
  - Gemfile
137
138
  - LICENSE.txt
@@ -161,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
162
  version: '0'
162
163
  requirements: []
163
164
  rubyforge_project:
164
- rubygems_version: 2.4.5.1
165
+ rubygems_version: 2.6.8
165
166
  signing_key:
166
167
  specification_version: 4
167
168
  summary: Page Object Framework for use with Watir