test-factory 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/test-factory/data_factory.rb +0 -12
- data/lib/test-factory/gem_ext.rb +7 -13
- data/lib/test-factory/test_factory.rb +16 -0
- data/test-factory.gemspec +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTUzYjI3ZWNiZjVjZWI5M2NkODU2MDIzYjg1YmQ5MDczMjliMzAxNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDRiNjc2ZWNiNzUxY2Y1NmZiNzA0YjUxYWY5NWNjOGVjYjFmOGMzMw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWE2ZjM5OTdkYTk4ZTllMGY0ZDkxMGM1ZWFjZDE5MGQyY2QxYTFlNTE0Njk2
|
10
|
+
ZjY3ODM5NzVkZmE4ZDIyZjgxNTJmODEwMDFjZTc2MmJkYTUwMDMwMWVmNzFm
|
11
|
+
NDRjNGY4Y2RjYTE4ZDE3ZDMzMzExYzgzYzllMTQ4NGVjYmE2ZDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTQ5MTg4MDZhNDI5ZTY2ZGVjMDVhYjc5MmNlOGExM2QxOGRkMmMzZmY0MzY1
|
14
|
+
NDE3MTliNjBkMDg3NjU0NjE5NDRiOGUxMDM5NmJhYTczMTFhYjZlZmMxZWFk
|
15
|
+
N2I1ZTRiMjQ2MDEwOTk3ZDM2ODI4ODM2MDEwOTM3NTliZDE5OGI=
|
@@ -112,18 +112,6 @@ class DataFactory
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
# Transform for use with data object instance variables
|
116
|
-
# that refer to checkboxes or radio buttons. Instead of returning a boolean value, it returns
|
117
|
-
# the symbols +:set+ or +:clear+ -- This can be useful because those symbols can then in turn
|
118
|
-
# be passed directly as methods for updating or validating the checkbox later.
|
119
|
-
#
|
120
|
-
# @param checkbox [Watir::CheckBox] The checkbox on the page that you want to inspect
|
121
|
-
#
|
122
|
-
def checkbox_setting(checkbox)
|
123
|
-
checkbox.set? ? :set : :clear
|
124
|
-
end
|
125
|
-
alias radio_setting checkbox_setting
|
126
|
-
|
127
115
|
# A shortcut method for filling out fields on a page. The
|
128
116
|
# method's first parameter is the page class that contains the fields
|
129
117
|
# you want to fill out. That is followed by the list of field name(s)
|
data/lib/test-factory/gem_ext.rb
CHANGED
@@ -106,29 +106,23 @@
|
|
106
106
|
#
|
107
107
|
# Much cleaner!
|
108
108
|
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
# def checkbox_trans
|
114
|
-
# { "YES" => :set, "NO" => :clear }
|
115
|
-
# end
|
116
|
-
#
|
117
|
-
# Then use that transform with your +#fit+ method, like this:
|
118
|
-
#
|
119
|
-
# page.checkbox.fit checkbox_trans[opts[:option]]
|
109
|
+
# The +#fit+ method is designed to allow for other values than just +:set+ or +:clear+. It will support
|
110
|
+
# 'Yes', 'No', 'on', 'off' (and it's case insensitive), +true+, and +false+, as well. This way you don't have to worry so much
|
111
|
+
# about making methods that transform from one type to another.
|
120
112
|
#
|
121
113
|
module Watir
|
122
114
|
|
123
115
|
class CheckBox
|
124
116
|
def fit(arg)
|
125
|
-
|
117
|
+
setting = TestFactory.binary_transform(arg)
|
118
|
+
self.send(setting) unless setting==nil
|
126
119
|
end
|
127
120
|
end
|
128
121
|
|
129
122
|
class Radio
|
130
123
|
def fit(arg)
|
131
|
-
|
124
|
+
setting = TestFactory.binary_transform(arg)
|
125
|
+
self.set if setting==:set
|
132
126
|
end
|
133
127
|
end
|
134
128
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module TestFactory
|
2
|
+
|
3
|
+
def self.binary_transform(var)
|
4
|
+
case(var)
|
5
|
+
when nil
|
6
|
+
nil
|
7
|
+
when /yes/i, /on/i, :set, true
|
8
|
+
:set
|
9
|
+
when /no/i, /off/i, :clear, false
|
10
|
+
:clear
|
11
|
+
else
|
12
|
+
raise "The value of your DataObject's checkbox/radio ('#{var}') instance variable is not supported.\nPlease make sure the value conforms to one of the following patterns:\n\n - :set or :clear (Symbol)\n - 'yes', 'no', 'on', or 'off' (String; case insensitive)\n - true or false (Boolean)"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/test-factory.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'test-factory'
|
3
|
-
s.version = '0.5.
|
3
|
+
s.version = '0.5.1'
|
4
4
|
s.summary = %q{rSmart's framework for creating automated testing scripts}
|
5
5
|
s.description = %q{This gem provides a set of modules and methods to help quickly and DRYly create a test automation framework using Ruby and Watir (or watir-webdriver).}
|
6
6
|
s.files = Dir.glob("**/**/**")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abraham Heward
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: watir-webdriver
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- lib/test-factory/gem_ext.rb
|
44
44
|
- lib/test-factory/page_factory.rb
|
45
45
|
- lib/test-factory/string_factory.rb
|
46
|
+
- lib/test-factory/test_factory.rb
|
46
47
|
- lib/test-factory.rb
|
47
48
|
- LICENSE
|
48
49
|
- README.md
|
@@ -71,3 +72,4 @@ signing_key:
|
|
71
72
|
specification_version: 4
|
72
73
|
summary: rSmart's framework for creating automated testing scripts
|
73
74
|
test_files: []
|
75
|
+
has_rdoc:
|