tapestry 0.6.0 → 0.7.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
- SHA1:
3
- metadata.gz: 68b465baaf9d831d1f067031f5999deee3439f20
4
- data.tar.gz: 211309e2dbcc81525ea8e944881cfa1a9e978636
2
+ SHA256:
3
+ metadata.gz: 4a72d53e4153b9852b2d2f8fe522133136d954b8c387cc9345cec06c406f8c74
4
+ data.tar.gz: d2d17436e64ce67d94f35c3dd3838645aeae9e4a9dee4ce6077861b230c5b413
5
5
  SHA512:
6
- metadata.gz: 47bbf673a52f8dff464ee2400a4ba409cde5c3df0673f5b2d48c0ed466c59361379da8fde85a290a633bfbf7b8becf6ddac09f5529bbf57c78b337842a5c66e4
7
- data.tar.gz: c2eda1d93599f92dedea535b456712773d0407fc2656113c9dec240fafda9a5875bee50df70c444d15a6b5c67ff58644fcbf0a10cb007b108cb9be0f1d3eb2ac
6
+ metadata.gz: a2af79c9f6f1fb8e74e9516ccf6077684fdaf3c3c76bffe23e8e60e762a59be5c2dea814413778f894c36ec5aa376daa5d84c00548c8ec501d6d5292b3d27228
7
+ data.tar.gz: 6bb58a0741a4fe7ac006eacbef52ee4481ca5dd8d31471a8988295b5335cbe687990bfef9a951b9647798da657ae1314ecd04b3b3ab4bb35e915d5b8829311b7
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+ $: << "./lib"
3
+
4
+ require "rspec"
5
+ include RSpec::Matchers
6
+
7
+ require "tapestry"
8
+
9
+ class PageReady
10
+ include Tapestry
11
+
12
+ url_is "https://veilus.herokuapp.com"
13
+
14
+ element :logo, id: 'site-'
15
+ element :login_form, id: 'openski'
16
+
17
+ page_ready { [logo.exists?, "Test Gorilla logo is not present"] }
18
+ end
19
+
20
+ Tapestry.start_browser
21
+
22
+ page = PageReady.new
23
+
24
+ page.visit
25
+
26
+ # Uncomment one of these at a time to see that the page_ready part
27
+ # is working. The element definitions above are purposely incorrect.
28
+
29
+ # page.when_ready { page.login_form.click }
30
+ # page.login_form.click
31
+
32
+ Tapestry.quit_browser
@@ -5,6 +5,7 @@ require "tapestry/interface"
5
5
  require "tapestry/attribute"
6
6
  require "tapestry/ready"
7
7
 
8
+ require "tapestry/extensions/core_ruby"
8
9
  require "tapestry/extensions/dom_observer"
9
10
  require "tapestry/extensions/data_setter"
10
11
  require "tapestry/extensions/watir_elements"
@@ -228,6 +228,11 @@ module Tapestry
228
228
  else
229
229
  @browser.__send__(element, locators)
230
230
  end
231
+ rescue Watir::Exception::UnknownObjectException
232
+ return false if caller_locations.any? do |str|
233
+ str.to_s.match?("ready_validations_pass?")
234
+ end
235
+ raise
231
236
  end
232
237
  end
233
238
  end
@@ -0,0 +1,5 @@
1
+ class FalseClass
2
+ def exists?
3
+ false
4
+ end
5
+ end
@@ -52,19 +52,24 @@ module Tapestry
52
52
  # here being that when a page has confirmed that it is ready, meaning that
53
53
  # no ready validations have failed, that information is stored so that any
54
54
  # subsequent calls to `ready?` do not query the ready validations again.
55
- def when_ready(&_block)
55
+ def when_ready(simple_check = false, &_block)
56
56
  already_marked_ready = ready
57
57
 
58
- # no_ready_check_possible unless block_given?
58
+ unless simple_check
59
+ no_ready_check_possible unless block_given?
60
+ end
59
61
 
60
62
  self.ready = ready?
63
+
61
64
  not_ready_validation(ready_error || 'NO REASON PROVIDED') unless ready
62
65
  yield self if block_given?
63
66
  ensure
64
67
  self.ready = already_marked_ready
65
68
  end
66
69
 
67
- alias check_if_ready when_ready
70
+ def check_if_ready
71
+ when_ready(true)
72
+ end
68
73
 
69
74
  # The `ready?` method is used to check if the page has been loaded
70
75
  # successfully, which means that none of the ready validations have
@@ -1,7 +1,7 @@
1
1
  module Tapestry
2
2
  module_function
3
3
 
4
- VERSION = "0.6.0".freeze
4
+ VERSION = "0.7.0".freeze
5
5
 
6
6
  def version
7
7
  """
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapestry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Nyman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-15 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,11 +131,13 @@ files:
131
131
  - examples/tapestry-data-set.rb
132
132
  - examples/tapestry-events.rb
133
133
  - examples/tapestry-factory.rb
134
+ - examples/tapestry-ready.rb
134
135
  - examples/tapestry-simple.rb
135
136
  - lib/tapestry.rb
136
137
  - lib/tapestry/attribute.rb
137
138
  - lib/tapestry/element.rb
138
139
  - lib/tapestry/errors.rb
140
+ - lib/tapestry/extensions/core_ruby.rb
139
141
  - lib/tapestry/extensions/data_setter.rb
140
142
  - lib/tapestry/extensions/dom_observer.js
141
143
  - lib/tapestry/extensions/dom_observer.rb
@@ -151,7 +153,7 @@ licenses:
151
153
  - MIT
152
154
  metadata: {}
153
155
  post_install_message: "\n(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n
154
- \ Tapestry 0.6.0 has been installed.\n(::) (::) (::) (::) (::) (::) (::) (::) (::)
156
+ \ Tapestry 0.7.0 has been installed.\n(::) (::) (::) (::) (::) (::) (::) (::) (::)
155
157
  (::) (::) (::)\n "
156
158
  rdoc_options: []
157
159
  require_paths:
@@ -168,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
170
  version: '0'
169
171
  requirements: []
170
172
  rubyforge_project:
171
- rubygems_version: 2.6.11
173
+ rubygems_version: 2.7.3
172
174
  signing_key:
173
175
  specification_version: 4
174
176
  summary: Weaving a semantic DSL to construct fluent interfaces for test execution