ae_page_objects 5.0.0 → 6.0.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
2
  SHA256:
3
- metadata.gz: 9ac141566f7fa0ef821de7597f5ca1c52d8e20a2a73a772c186631ea9340b3ba
4
- data.tar.gz: e43b377ece706710f77792e4e7a4540160bd94ee4d81f0f5e6e8b360df452a49
3
+ metadata.gz: 821e62b026f7ce8c826470730f1e4f582ca4f2e5a253730204288b282c4dec7b
4
+ data.tar.gz: fd777245e7db9fb50691bfbd0a4ccf2ae153bf055178615afbe77cf5896c66cd
5
5
  SHA512:
6
- metadata.gz: 67411eea6351ede5cf53ba6944b5ab15ee1066208df1afb7d493dbe6a99de623881d8742fbb764ef04a92103f6432af9dbc597ffb6e0d0fad02b0ad3842ae4d2
7
- data.tar.gz: 83146923f3c423858fbaddafd47f0532bfd5c6b7658e256766d6bbb697c1228eb3f57c4776526694278b0b75dc7946dda8bf4f809d280b447081d36a9793c920
6
+ metadata.gz: 3243021458e14158adb012befea9abc50ba39f4ef470f274535e685168a79049f99e35341105a1a1dd721bda3e1bdb02b31e035720811760f2186e1144a9fb68
7
+ data.tar.gz: 58dfab715e70b7f65059931b207b7faee6aa4f653ccd78d4a5dc10def861df46c29c5b284cea566c6372111a0cb60b3f6be6c2c9f14e265252a5ad58561cc696
@@ -0,0 +1,23 @@
1
+
2
+ # frozen_string_literal: true
3
+
4
+ require_relative 'lib/ae_page_objects/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'ae_page_objects'
8
+ spec.version = AePageObjects::VERSION
9
+ spec.platform = Gem::Platform::RUBY
10
+ spec.author = 'AppFolio'
11
+ spec.email = 'opensource@appfolio.com'
12
+ spec.description = 'Capybara Page Objects pattern.'
13
+ spec.summary = spec.description
14
+ spec.homepage = 'https://github.com/appfolio/ae_page_objects'
15
+ spec.license = 'MIT'
16
+ spec.files = Dir['**/*'].select { |f| f[%r{^(lib/|LICENSE.txt|.*gemspec)}] }
17
+ spec.require_paths = ['lib']
18
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7.5')
19
+
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
+
22
+ spec.add_dependency('capybara', ['>= 3', '< 4'])
23
+ end
@@ -122,10 +122,13 @@ module AePageObjects
122
122
  locator.push(default_options)
123
123
  end
124
124
 
125
+ locator_copy = locator.dup
126
+ options = locator_copy.pop
127
+
125
128
  if @wait
126
- node = AePageObjects.wait_until { parent.node.first(*locator) }
129
+ node = AePageObjects.wait_until { parent.node.first(*locator_copy, **options) }
127
130
  else
128
- node = parent.node.first(*locator)
131
+ node = parent.node.first(*locator_copy, **options)
129
132
  raise LoadingElementFailed, 'Element Not Found' unless node
130
133
  end
131
134
  node.allow_reload!
@@ -52,7 +52,7 @@ module AePageObjects
52
52
  # wait time set to 0.
53
53
  #
54
54
  Capybara.using_wait_time(0) do
55
- node.all(:xpath, item_xpath, options).size
55
+ node.all(:xpath, item_xpath, **options).size
56
56
  end
57
57
  end
58
58
 
@@ -90,7 +90,6 @@ module AePageObjects
90
90
  }
91
91
 
92
92
  if query_args[1].is_a?(XPath::Expression)
93
- #
94
93
  # Use the { exact: true } setting for XPath selectors that use "XPath.is". For example, given the XPath
95
94
  # XPath.descendant(:div)[XPath.text.is('Example Text')]
96
95
  # the resulting path will be
@@ -98,17 +97,14 @@ module AePageObjects
98
97
  # instead of
99
98
  # .//div[contains(./text(), 'Example Text')]
100
99
  # See https://github.com/jnicklas/capybara#exactness for more information.
101
- #
102
100
  default_options[:exact] = true
103
101
  end
104
102
 
105
103
  if query_args.last.is_a?(::Hash)
106
- query_args[-1] = default_options.merge(query_args.last)
107
- else
108
- query_args.push(default_options)
104
+ default_options.merge!(query_args.pop)
109
105
  end
110
106
 
111
- query = Capybara::Queries::SelectorQuery.new(*query_args)
107
+ query = Capybara::Queries::SelectorQuery.new(*query_args, **default_options)
112
108
 
113
109
  result = query.xpath
114
110
 
@@ -27,7 +27,10 @@ module AePageObjects
27
27
  locator.push(default_options)
28
28
  end
29
29
 
30
- node.all(*locator).any?
30
+ locator_copy = locator.dup
31
+ options = locator_copy.pop
32
+
33
+ node.all(*locator_copy, **options).any?
31
34
  end
32
35
  end
33
36
 
@@ -4,9 +4,7 @@ module AePageObjects
4
4
  class ApplicationRouter < BasicRouter
5
5
 
6
6
  # This whole file is a kludge and probably belongs in an ae_page_objects-rails extension
7
-
8
7
  module Recognizer
9
-
10
8
  class Base
11
9
  def generate_path(named_route, *args)
12
10
  if routes.respond_to?("#{named_route}_path")
@@ -32,7 +30,7 @@ module AePageObjects
32
30
  false
33
31
  end
34
32
 
35
- private
33
+ private
36
34
 
37
35
  def routes
38
36
  raise NotImplementedError, "You must implement routes"
@@ -60,9 +58,8 @@ module AePageObjects
60
58
  ResolvedRoute = Struct.new(:controller, :action)
61
59
  end
62
60
 
63
- class Rails3 < Base
64
-
65
- private
61
+ class Rails6Plus < Base
62
+ private
66
63
 
67
64
  def request_for(url, method)
68
65
  ::Rails.application.routes.request_class.new(env_for(url, method))
@@ -77,7 +74,8 @@ module AePageObjects
77
74
  end
78
75
 
79
76
  def normalize_url(url)
80
- Rack::Mount::Utils.normalize_path(url) unless url =~ %r{://}
77
+ require 'action_dispatch/journey'
78
+ ActionDispatch::Journey::Router::Utils.normalize_path(url) unless url =~ %r{://}
81
79
  end
82
80
 
83
81
  def router
@@ -93,25 +91,6 @@ module AePageObjects
93
91
  end
94
92
  end
95
93
  end
96
-
97
- class Rails32 < Rails3
98
-
99
- private
100
-
101
- def normalize_url(url)
102
- Journey::Router::Utils.normalize_path(url) unless url =~ %r{://}
103
- end
104
- end
105
-
106
- class Rails4Plus < Rails32
107
-
108
- private
109
-
110
- def normalize_url(url)
111
- require 'action_dispatch/journey'
112
- ActionDispatch::Journey::Router::Utils.normalize_path(url) unless url =~ %r{://}
113
- end
114
- end
115
94
  end
116
95
 
117
96
  def path_recognizes_url?(path, url)
@@ -134,15 +113,11 @@ module AePageObjects
134
113
 
135
114
  def recognizer
136
115
  @recognizer ||= case ::Rails.gem_version
137
- when Gem::Requirement.new('>= 3.0', '< 3.2')
138
- Recognizer::Rails3.new
139
- when Gem::Requirement.new('~> 3.2')
140
- Recognizer::Rails32.new
141
- when Gem::Requirement.new('>= 4.0', '< 7.0')
142
- Recognizer::Rails4Plus.new
116
+ when Gem::Requirement.new('>= 6.0', '< 8.0')
117
+ Recognizer::Rails6Plus.new
143
118
  else
144
119
  warn "[WARNING]: AePageObjects is not tested against Rails #{::Rails.version} and may behave in an undefined manner."
145
- Recognizer::Rails4Plus.new
120
+ Recognizer::Rails6Plus.new
146
121
  end
147
122
  end
148
123
  end
@@ -1,3 +1,3 @@
1
1
  module AePageObjects
2
- VERSION = '5.0.0'.freeze
2
+ VERSION = '6.0.0'.freeze
3
3
  end
@@ -0,0 +1,17 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ # Maintain your gem's version:
4
+ require "forum/version"
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |s|
8
+ s.name = "forum"
9
+ s.version = Forum::VERSION
10
+ s.authors = "Appfolio"
11
+ s.summary = "forum engine"
12
+ s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
13
+ s.test_files = Dir["test/**/*"]
14
+
15
+ s.add_dependency "rails", "> 3"
16
+ s.add_development_dependency "sqlite3"
17
+ end
metadata CHANGED
@@ -1,36 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_page_objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - AppFolio Engineering
7
+ - AppFolio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-20 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '3'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '4'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '3.0'
27
- description: Capybara Page Objects pattern
28
- email:
29
- - engineering@appfolio.com
32
+ version: '4'
33
+ description: Capybara Page Objects pattern.
34
+ email: opensource@appfolio.com
30
35
  executables: []
31
36
  extensions: []
32
37
  extra_rdoc_files: []
33
38
  files:
39
+ - ae_page_objects.gemspec
34
40
  - lib/ae_page_objects.rb
35
41
  - lib/ae_page_objects/core/basic_router.rb
36
42
  - lib/ae_page_objects/core/dsl.rb
@@ -60,10 +66,12 @@ files:
60
66
  - lib/ae_page_objects/util/internal_helpers.rb
61
67
  - lib/ae_page_objects/util/wait_time_manager.rb
62
68
  - lib/ae_page_objects/version.rb
63
- homepage: http://github.com/appfolio/ae_page_objects
69
+ - test/test_apps/shared/engines/forum/forum.gemspec
70
+ homepage: https://github.com/appfolio/ae_page_objects
64
71
  licenses:
65
72
  - MIT
66
- metadata: {}
73
+ metadata:
74
+ allowed_push_host: https://rubygems.org
67
75
  post_install_message:
68
76
  rdoc_options: []
69
77
  require_paths:
@@ -72,15 +80,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
80
  requirements:
73
81
  - - ">="
74
82
  - !ruby/object:Gem::Version
75
- version: 2.2.5
83
+ version: 2.7.5
76
84
  required_rubygems_version: !ruby/object:Gem::Requirement
77
85
  requirements:
78
86
  - - ">="
79
87
  - !ruby/object:Gem::Version
80
88
  version: '0'
81
89
  requirements: []
82
- rubygems_version: 3.1.2
90
+ rubygems_version: 3.3.26
83
91
  signing_key:
84
92
  specification_version: 4
85
- summary: Capybara Page Objects pattern
93
+ summary: Capybara Page Objects pattern.
86
94
  test_files: []