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 +5 -5
- data/examples/tapestry-ready.rb +32 -0
- data/lib/tapestry.rb +1 -0
- data/lib/tapestry/element.rb +5 -0
- data/lib/tapestry/extensions/core_ruby.rb +5 -0
- data/lib/tapestry/ready.rb +8 -3
- data/lib/tapestry/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4a72d53e4153b9852b2d2f8fe522133136d954b8c387cc9345cec06c406f8c74
|
4
|
+
data.tar.gz: d2d17436e64ce67d94f35c3dd3838645aeae9e4a9dee4ce6077861b230c5b413
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/tapestry.rb
CHANGED
data/lib/tapestry/element.rb
CHANGED
@@ -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
|
data/lib/tapestry/ready.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
data/lib/tapestry/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
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
|