iu-test-factory 0.6.0.beta1 → 0.7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/LICENSE +10 -65
- data/iu-test-factory-0.6.0.beta1.gem +0 -0
- data/iu-test-factory.gemspec +3 -2
- data/lib/test-factory/page_factory.rb +13 -13
- metadata +9 -6
- data/iu-test-factory-0.6.0.0.gem.old +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09d68db8e2596a6eac1cc2ae52a153a8edf09cd9850d275b7c9f86c6c2efbf5f'
|
4
|
+
data.tar.gz: 2aaa3ece4d66d12e87c609ad94a17d0f2782e35546880a10b91ba97b0ac88376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2780590cea9a09a078d24081dd7fa04dfb4c1e2a16c3d0b91293c8594257b45c17176e1051bcf19e41eac3d8ddd34b182c905f6bcc107c06ea4bfb17bb41f4ea
|
7
|
+
data.tar.gz: f4d087e16ab556736f1012f9a6aaeb9c36fba9dbbab2b23302e98b0a2425e20e832774121250db1fc1bf9018203c143c4a940259c27d91f7d6c8af60d1100ab2
|
data/Gemfile.lock
CHANGED
data/LICENSE
CHANGED
@@ -1,68 +1,13 @@
|
|
1
|
-
|
2
|
-
Apache License
|
3
|
-
Version 2.0, January 2004
|
4
|
-
http://www.apache.org/licenses/
|
1
|
+
Copyright (C) 2023 Indiana University
|
5
2
|
|
6
|
-
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
7
6
|
|
8
|
-
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
17
|
-
|
18
|
-
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
19
|
-
|
20
|
-
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
21
|
-
|
22
|
-
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
23
|
-
|
24
|
-
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
25
|
-
|
26
|
-
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
27
|
-
|
28
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
29
|
-
|
30
|
-
2. Grant of Copyright License.
|
31
|
-
|
32
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
33
|
-
|
34
|
-
3. Grant of Patent License.
|
35
|
-
|
36
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
37
|
-
|
38
|
-
4. Redistribution.
|
39
|
-
|
40
|
-
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
41
|
-
|
42
|
-
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
43
|
-
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
44
|
-
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
45
|
-
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
46
|
-
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
47
|
-
|
48
|
-
5. Submission of Contributions.
|
49
|
-
|
50
|
-
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
51
|
-
|
52
|
-
6. Trademarks.
|
53
|
-
|
54
|
-
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
55
|
-
|
56
|
-
7. Disclaimer of Warranty.
|
57
|
-
|
58
|
-
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
59
|
-
|
60
|
-
8. Limitation of Liability.
|
61
|
-
|
62
|
-
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
63
|
-
|
64
|
-
9. Accepting Warranty or Additional Liability.
|
65
|
-
|
66
|
-
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
67
|
-
|
68
|
-
END OF TERMS AND CONDITIONS
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
Binary file
|
data/iu-test-factory.gemspec
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'iu-test-factory'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.7.0.0'
|
4
4
|
s.summary = 'framework for creating automated testing scripts'
|
5
5
|
s.description = 'This gem provides a set of modules and methods to help quickly and DRYly create a test \
|
6
6
|
automation framework using Ruby and Watir.'
|
7
7
|
s.files = Dir.glob('**/**/**')
|
8
8
|
s.test_files = Dir.glob('test/*test_rb')
|
9
9
|
s.authors = ['Abraham Heward', 'David Elyea', 'Megha Ramawat']
|
10
|
-
s.email =
|
10
|
+
s.email = ['aheward@rsmart.com', 'delyea@iu.edu', 'mramawat@iu.edu']
|
11
11
|
s.homepage = 'https://github.iu.edu/iu-uits-es'
|
12
12
|
s.add_dependency 'watir', '~> 7.0'
|
13
13
|
s.required_ruby_version = '~> 3.1'
|
14
|
+
s.license = 'Apache-2.0'
|
14
15
|
end
|
@@ -21,7 +21,7 @@ class PageFactory
|
|
21
21
|
# As the PageFactory will be the superclass for all your page classes, having this initialize
|
22
22
|
# method here means it's only written once.
|
23
23
|
#
|
24
|
-
def initialize
|
24
|
+
def initialize browser, visit = false
|
25
25
|
@browser = browser
|
26
26
|
goto if visit
|
27
27
|
expected_element if respond_to? :expected_element
|
@@ -32,7 +32,7 @@ class PageFactory
|
|
32
32
|
# that Watir will take care of parsing them, so the assumption is that the method being
|
33
33
|
# passed is a valid method for the browser object.
|
34
34
|
#
|
35
|
-
def method_missing
|
35
|
+
def method_missing sym, *args, &block
|
36
36
|
@browser.send sym, *args, &block
|
37
37
|
end
|
38
38
|
|
@@ -41,7 +41,7 @@ class PageFactory
|
|
41
41
|
# Define this in a page class and when you use the "visit" method to instantiate the class
|
42
42
|
# it will enter the URL in the browser's address bar.
|
43
43
|
#
|
44
|
-
def page_url
|
44
|
+
def page_url url
|
45
45
|
define_method 'goto' do
|
46
46
|
@browser.goto url
|
47
47
|
end
|
@@ -51,7 +51,7 @@ class PageFactory
|
|
51
51
|
# element appears on the page before continuing with the script.
|
52
52
|
# @param element_name [Symbol] The method name of the element that must be present on the page
|
53
53
|
#
|
54
|
-
def expected_element
|
54
|
+
def expected_element element_name, timeout=30
|
55
55
|
define_method 'expected_element' do
|
56
56
|
self.send(element_name).wait_until_present timeout: timeout
|
57
57
|
end
|
@@ -62,7 +62,7 @@ class PageFactory
|
|
62
62
|
# error and halts the script.
|
63
63
|
# @param expected_title [String] The exact text that is expected to appear in the Browser title when the page loads
|
64
64
|
#
|
65
|
-
def expected_title
|
65
|
+
def expected_title expected_title
|
66
66
|
define_method 'has_expected_title?' do
|
67
67
|
has_expected_title = expected_title.kind_of?(Regexp) ? expected_title =~ @browser.title : expected_title == @browser.title
|
68
68
|
raise "Expected title '#{expected_title}' instead of '#{@browser.title}'" unless has_expected_title
|
@@ -81,7 +81,7 @@ class PageFactory
|
|
81
81
|
# action(:continue) { |b| b.frm.button(:value=>"Continue").click } => Creates a #continue method that clicks the Continue button
|
82
82
|
# p_element(:select_style) { |stylename, b| b.div(:text=>/#{Regexp.escape(stylename)}/).link(:text=>"Select").click } => #select_style(stylename)
|
83
83
|
#
|
84
|
-
def element
|
84
|
+
def element name, &block
|
85
85
|
raise "#{name} is being defined twice in #{self}!" if self.instance_methods.include?(name.to_sym)
|
86
86
|
define_method name.to_s do |*thing|
|
87
87
|
Proc.new(&block).call *thing, self
|
@@ -116,7 +116,7 @@ class PageFactory
|
|
116
116
|
# @example
|
117
117
|
# link("Click Me For Fun!", :click_me) => Creates the methods #click_me and #click_me_link
|
118
118
|
#
|
119
|
-
def link
|
119
|
+
def link link_text, *alias_name
|
120
120
|
elementize(:link, link_text, *alias_name)
|
121
121
|
end
|
122
122
|
|
@@ -143,7 +143,7 @@ class PageFactory
|
|
143
143
|
# @example
|
144
144
|
# link("Click Me For Fun!", :click_me) => Creates the methods #click_me and #click_me_link
|
145
145
|
#
|
146
|
-
def button
|
146
|
+
def button button_text, *alias_name
|
147
147
|
elementize(:button, button_text, *alias_name)
|
148
148
|
end
|
149
149
|
|
@@ -168,11 +168,11 @@ class PageFactory
|
|
168
168
|
# @example
|
169
169
|
# undefine :status, :doc_id => Undefines the specified methods in the current class
|
170
170
|
#
|
171
|
-
def undefine
|
171
|
+
def undefine *methods
|
172
172
|
methods.each{ |m| undef_method m }
|
173
173
|
end
|
174
174
|
|
175
|
-
def inherited
|
175
|
+
def inherited klass
|
176
176
|
klass.instance_eval {
|
177
177
|
|
178
178
|
# Creates a method, #wait_for_ajax, usable in your Page Classes, that executes
|
@@ -181,7 +181,7 @@ class PageFactory
|
|
181
181
|
# If timeout is exceeded, raises Watir::Wait::TimeoutError exception. The returned error
|
182
182
|
# message is customizable.
|
183
183
|
#
|
184
|
-
define_method 'wait_for_ajax' do |timeout
|
184
|
+
define_method 'wait_for_ajax' do |timeout=10, message|
|
185
185
|
timeout.times do
|
186
186
|
sleep 0.3
|
187
187
|
return true if @browser.execute_script('return jQuery.active').to_i == 0
|
@@ -197,11 +197,11 @@ class PageFactory
|
|
197
197
|
# A helper method that converts the passed string into snake case. See the StringFactory
|
198
198
|
# module for more info.
|
199
199
|
#
|
200
|
-
def damballa
|
200
|
+
def damballa text
|
201
201
|
StringFactory.damballa(text)
|
202
202
|
end
|
203
203
|
|
204
|
-
def elementize
|
204
|
+
def elementize type, text, *alias_name
|
205
205
|
hash={:link=>:text, :button=>:value}
|
206
206
|
if alias_name.empty?
|
207
207
|
el_name=damballa("#{text}_#{type}")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iu-test-factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abraham Heward
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-03-
|
13
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: watir
|
@@ -31,6 +31,8 @@ description: |-
|
|
31
31
|
automation framework using Ruby and Watir.
|
32
32
|
email:
|
33
33
|
- aheward@rsmart.com
|
34
|
+
- delyea@iu.edu
|
35
|
+
- mramawat@iu.edu
|
34
36
|
executables: []
|
35
37
|
extensions: []
|
36
38
|
extra_rdoc_files: []
|
@@ -40,7 +42,7 @@ files:
|
|
40
42
|
- Gemfile.lock
|
41
43
|
- LICENSE
|
42
44
|
- README.md
|
43
|
-
- iu-test-factory-0.6.0.
|
45
|
+
- iu-test-factory-0.6.0.beta1.gem
|
44
46
|
- iu-test-factory.gemspec
|
45
47
|
- lib/test-factory.rb
|
46
48
|
- lib/test-factory/collections_factory.rb
|
@@ -51,7 +53,8 @@ files:
|
|
51
53
|
- lib/test-factory/string_factory.rb
|
52
54
|
- lib/test-factory/test_factory.rb
|
53
55
|
homepage: https://github.iu.edu/iu-uits-es
|
54
|
-
licenses:
|
56
|
+
licenses:
|
57
|
+
- Apache-2.0
|
55
58
|
metadata: {}
|
56
59
|
post_install_message:
|
57
60
|
rdoc_options: []
|
@@ -64,9 +67,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
67
|
version: '3.1'
|
65
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
69
|
requirements:
|
67
|
-
- - "
|
70
|
+
- - ">="
|
68
71
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
72
|
+
version: '0'
|
70
73
|
requirements: []
|
71
74
|
rubygems_version: 3.3.7
|
72
75
|
signing_key:
|
Binary file
|