site_prism 2.7 → 2.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: 5cecd18603e2b752a61108228d5d0977ebbd8117
4
- data.tar.gz: cdbd3e91b71ce10e2f1fa210c76f7e0abe47307a
3
+ metadata.gz: 55a6ce7e56d5856c12b9e656a157e69a23d88fb1
4
+ data.tar.gz: 3394ad1adb32985236d96080bcc181610538c5f7
5
5
  SHA512:
6
- metadata.gz: bf99da3a4830b9bda41b26f548dbd8694e05e14122464c72503790cc00ff32bfc20c29c8d118726df5a9e264bdcfff33345068141b9e982ff95064c879ddee8d
7
- data.tar.gz: c21eca71f43629070428a85bf7e7b1661b6a1af2e7d426490ffc4e20dd61ff9355e633a80140795f3296aaad6e0994ad4ff586e28b3e26cad683f8b0355f8013
6
+ metadata.gz: 29a2257b42cb9eb23e552706b0dfdc2a92ee4ef07cf6e41aa42bf3ea4638bfe2880828e23a8aea95e0c8bb8fc2efdc7c671891d9c50bd473415fedf4fe0b05b8
7
+ data.tar.gz: 825df856fa2537ba9f7019eb9d03c65a42793966ec218507ce132d761a6a9c92c96d1429f757ff7540a9ab0cb3c10d2ab792efeae1542c594a786b6cbc61ffc3
data/README.md CHANGED
@@ -7,6 +7,8 @@ Find the pretty documentation here: http://rdoc.info/gems/site_prism/frames
7
7
 
8
8
  [![Build Status](https://travis-ci.org/natritmeyer/site_prism.png)](https://travis-ci.org/natritmeyer/site_prism)
9
9
 
10
+ Make sure to add your project/company to https://github.com/natritmeyer/site_prism/wiki/Who-is-using-SitePrism
11
+
10
12
  ## Synopsis
11
13
 
12
14
  Here's an overview of how SitePrism is designed to be used:
@@ -1385,8 +1387,8 @@ SitePrism::Page that represents the iframe's contents. For example:
1385
1387
  ```ruby
1386
1388
  # SitePrism::Page representing the iframe
1387
1389
  class Login < SitePrism::Page
1388
- element :username "input.username"
1389
- element :password "input.password"
1390
+ element :username, "input.username"
1391
+ element :password, "input.password"
1390
1392
  end
1391
1393
 
1392
1394
  # SitePrism::Page representing the page that contains the iframe
@@ -2,10 +2,10 @@ require 'site_prism/exceptions'
2
2
  require 'addressable/template'
3
3
 
4
4
  module SitePrism
5
- autoload :ElementContainer, 'site_prism/element_container'
6
- autoload :ElementChecker, 'site_prism/element_checker'
7
- autoload :Page, 'site_prism/page'
8
- autoload :Section, 'site_prism/section'
5
+ autoload :ElementContainer, 'site_prism/element_container'
6
+ autoload :ElementChecker, 'site_prism/element_checker'
7
+ autoload :Page, 'site_prism/page'
8
+ autoload :Section, 'site_prism/section'
9
9
  autoload :Waiter, 'site_prism/waiter'
10
10
  autoload :AddressableUrlMatcher, 'site_prism/addressable_url_matcher'
11
11
 
@@ -99,7 +99,7 @@ module SitePrism
99
99
  method_name = "has_#{element_name}?"
100
100
  create_helper_method method_name, *find_args do
101
101
  define_method method_name do |*runtime_args|
102
- wait_time = SitePrism.use_implicit_waits ? Capybara.default_wait_time : 0
102
+ wait_time = SitePrism.use_implicit_waits ? Waiter.default_wait_time : 0
103
103
  Capybara.using_wait_time wait_time do
104
104
  element_exists?(*find_args, *runtime_args)
105
105
  end
@@ -111,7 +111,7 @@ module SitePrism
111
111
  method_name = "has_no_#{element_name}?"
112
112
  create_helper_method method_name, *find_args do
113
113
  define_method method_name do |*runtime_args|
114
- wait_time = SitePrism.use_implicit_waits ? Capybara.default_wait_time : 0
114
+ wait_time = SitePrism.use_implicit_waits ? Waiter.default_wait_time : 0
115
115
  Capybara.using_wait_time wait_time do
116
116
  element_does_not_exist?(*find_args, *runtime_args)
117
117
  end
@@ -123,7 +123,7 @@ module SitePrism
123
123
  method_name = "wait_for_#{element_name}"
124
124
  create_helper_method method_name, *find_args do
125
125
  define_method method_name do |timeout = nil, *runtime_args|
126
- timeout = timeout.nil? ? Capybara.default_wait_time : timeout
126
+ timeout = timeout.nil? ? Waiter.default_wait_time : timeout
127
127
  Capybara.using_wait_time timeout do
128
128
  element_exists?(*find_args, *runtime_args)
129
129
  end
@@ -134,7 +134,7 @@ module SitePrism
134
134
  def create_visibility_waiter(element_name, *find_args)
135
135
  method_name = "wait_until_#{element_name}_visible"
136
136
  create_helper_method method_name, *find_args do
137
- define_method method_name do |timeout = Capybara.default_wait_time, *runtime_args|
137
+ define_method method_name do |timeout = Waiter.default_wait_time, *runtime_args|
138
138
  Timeout.timeout timeout, SitePrism::TimeOutWaitingForElementVisibility do
139
139
  Capybara.using_wait_time 0 do
140
140
  sleep 0.05 until element_exists?(*find_args, *runtime_args, visible: true)
@@ -147,7 +147,7 @@ module SitePrism
147
147
  def create_invisibility_waiter(element_name, *find_args)
148
148
  method_name = "wait_until_#{element_name}_invisible"
149
149
  create_helper_method method_name, *find_args do
150
- define_method method_name do |timeout = Capybara.default_wait_time, *runtime_args|
150
+ define_method method_name do |timeout = Waiter.default_wait_time, *runtime_args|
151
151
  Timeout.timeout timeout, SitePrism::TimeOutWaitingForElementInvisibility do
152
152
  Capybara.using_wait_time 0 do
153
153
  sleep 0.05 while element_exists?(*find_args, *runtime_args, visible: true)
@@ -6,5 +6,5 @@ module SitePrism
6
6
  class TimeoutException < StandardError; end
7
7
  class TimeOutWaitingForElementVisibility < StandardError; end
8
8
  class TimeOutWaitingForElementInvisibility < StandardError; end
9
- class UnsupportedBlock < StandardError; end
9
+ class UnsupportedBlock < StandardError; end
10
10
  end
@@ -73,7 +73,7 @@ module SitePrism
73
73
  end
74
74
 
75
75
  def secure?
76
- !current_url.match(/^https/).nil?
76
+ current_url.start_with? 'https'
77
77
  end
78
78
 
79
79
  private
@@ -7,7 +7,8 @@ module SitePrism
7
7
  attr_reader :root_element, :parent
8
8
 
9
9
  def initialize(parent, root_element)
10
- @parent, @root_element = parent, root_element
10
+ @parent = parent
11
+ @root_element = root_element
11
12
  end
12
13
 
13
14
  def visible?
@@ -1,3 +1,3 @@
1
1
  module SitePrism
2
- VERSION = '2.7'
2
+ VERSION = '2.8'
3
3
  end
@@ -11,7 +11,7 @@ module SitePrism
11
11
  end
12
12
 
13
13
  def self.default_wait_time
14
- Capybara.default_wait_time
14
+ Capybara.respond_to?(:default_max_wait_time) ? Capybara.default_max_wait_time : Capybara.default_wait_time
15
15
  end
16
16
  end
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_prism
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.7'
4
+ version: '2.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Ritmeyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-23 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -86,7 +86,7 @@ homepage: http://github.com/natritmeyer/site_prism
86
86
  licenses:
87
87
  - BSD3
88
88
  metadata: {}
89
- post_install_message: Make sure to add your project/company to https://github.com/natritmeyer/site_prism/wiki/Who-is-using-SitePrism
89
+ post_install_message:
90
90
  rdoc_options: []
91
91
  require_paths:
92
92
  - lib