site_prism 1.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +33 -1
- data/lib/site_prism/element_checker.rb +1 -1
- data/lib/site_prism/element_container.rb +2 -1
- data/lib/site_prism/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -233,7 +233,22 @@ aren't limited to one environment but can verify that they are on the
|
|
233
233
|
correct page regardless of the environment the tests are being executed
|
234
234
|
against.
|
235
235
|
|
236
|
-
|
236
|
+
### Getting the Current Page's URL
|
237
|
+
|
238
|
+
SitePrism allows you to get the current page's URL. Here's how it's
|
239
|
+
done:
|
240
|
+
|
241
|
+
```ruby
|
242
|
+
class Account < SitePrism::Page
|
243
|
+
end
|
244
|
+
|
245
|
+
@account = Account.new
|
246
|
+
#...
|
247
|
+
@account.current_url #=> "http://www.example.com/account/123"
|
248
|
+
@account.current_url.should include "example.com/account/"
|
249
|
+
```
|
250
|
+
|
251
|
+
### Page Title
|
237
252
|
|
238
253
|
Getting a page's title isn't hard:
|
239
254
|
|
@@ -246,6 +261,23 @@ end
|
|
246
261
|
@account.title #=> "Welcome to Your Account"
|
247
262
|
```
|
248
263
|
|
264
|
+
### HTTP vs. HTTPS
|
265
|
+
|
266
|
+
You can easily tell if the page is secure or not by checking to see if
|
267
|
+
the current URL begins with 'https' or not. SitePrism provides the
|
268
|
+
`secure?` method that will return true if the current url begins with
|
269
|
+
'https' and false if it doesn't. For example:
|
270
|
+
|
271
|
+
```ruby
|
272
|
+
class Account < SitePrism::Page
|
273
|
+
end
|
274
|
+
|
275
|
+
@account = Account.new
|
276
|
+
#...
|
277
|
+
@account.secure? #=> true/false
|
278
|
+
@account.should be_secure
|
279
|
+
```
|
280
|
+
|
249
281
|
## Elements
|
250
282
|
|
251
283
|
Pages are made up of elements (text fields, buttons, combo boxes, etc),
|
@@ -84,7 +84,8 @@ module SitePrism::ElementContainer
|
|
84
84
|
raise SitePrism::NoLocatorForElement.new("#{self.class.name} => :#{element_name} needs a locator")
|
85
85
|
end
|
86
86
|
else
|
87
|
-
define_method method_name do |
|
87
|
+
define_method method_name do |*args|
|
88
|
+
timeout = args.shift || Capybara.default_wait_time
|
88
89
|
Capybara.using_wait_time timeout do
|
89
90
|
element_waiter element_locator
|
90
91
|
end
|
data/lib/site_prism/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: site_prism
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version:
|
5
|
+
version: 1.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nat Ritmeyer
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-06-
|
13
|
+
date: 2012-06-17 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capybara
|