test-factory 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/test-factory/gem_ext.rb +10 -17
- data/test-factory-0.1.6.gem +0 -0
- data/test-factory.gemspec +1 -1
- metadata +2 -1
data/Gemfile.lock
CHANGED
data/lib/test-factory/gem_ext.rb
CHANGED
@@ -14,26 +14,19 @@
|
|
14
14
|
# Proper use of the #fit method requires following a particular coding
|
15
15
|
# pattern, however:
|
16
16
|
#
|
17
|
-
# 1. In your Page Classes, define your radio buttons and checkboxes
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# checkboxes should have the values of +:set+ or +:clear+. If they *need* to be
|
21
|
-
# something else, then define a Hash transform method to easily
|
22
|
-
# convert the custom values back to +:set+ or +:clear+, then pass that
|
23
|
-
# transform to the #fit method.
|
24
|
-
# 3. Always remember to end your #edit methods with the #set_options()
|
25
|
-
# method, from the DataFactory module. It automatically takes care
|
26
|
-
# of updating your data object's instance variables with any
|
27
|
-
# new values.
|
17
|
+
# 1. In your Page Classes, define your radio buttons and checkboxes directly. Do not define #set and/or #clear actions there.
|
18
|
+
# 2. Your data object's instance variables for radio buttons and checkboxes, when not +nil+, should have the values of +:set+ or +:clear+. If they *need* to be something else, then define a Hash transform method to easily convert the custom values back to +:set+ or +:clear+, then pass that transform to the #fit method.
|
19
|
+
# 3. Always remember to end your #edit methods with the #set_options() method, from the DataFactory module. It automatically takes care of updating your data object's instance variables with any new values.
|
28
20
|
#
|
29
21
|
# ==Example
|
30
22
|
#
|
31
23
|
# Let's take a look at how the proper use of #fit in your code can significantly
|
32
|
-
# clean things up.
|
24
|
+
# clean things up, using a checkbox field for our example. Remember that #fit
|
25
|
+
# works with radio buttons, text fields, and select lists, too.
|
33
26
|
#
|
34
27
|
# First, here's some code written without using #fit, and using
|
35
28
|
# actions for the checkbox page objects, and a Data Object
|
36
|
-
# instance variable that is either "YES" or "NO"...
|
29
|
+
# instance variable, +@option+, that is either "YES" or "NO"...
|
37
30
|
#
|
38
31
|
# class MyPage < BasePage
|
39
32
|
# # ...
|
@@ -61,9 +54,9 @@
|
|
61
54
|
# # ...
|
62
55
|
# end
|
63
56
|
#
|
64
|
-
# Now, let's take that same code, but this time use the #fit method,
|
65
|
-
# the data object's instance variable
|
66
|
-
# end the #edit with #set_options ...
|
57
|
+
# Now, let's take that same code, but this time use the #fit method, assume that
|
58
|
+
# the data object's +@option+ instance variable will be +:set+, +:clear+, or +nil+, and
|
59
|
+
# end the #edit with the DataFactory's #set_options helper method...
|
67
60
|
#
|
68
61
|
# class MyPage < BasePage
|
69
62
|
# # ...
|
@@ -87,7 +80,7 @@
|
|
87
80
|
# end
|
88
81
|
#
|
89
82
|
# If you absolutely _must_ have your data object's instance variable be something
|
90
|
-
# other than +:set+ or +:clear+, then consider writing private
|
83
|
+
# other than +:set+ or +:clear+, then consider writing a private transform method
|
91
84
|
# in your data object class, like this:
|
92
85
|
#
|
93
86
|
# def checkbox_trans
|
Binary file
|
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.1.
|
3
|
+
s.version = '0.1.7'
|
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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- lib/test-factory/string_factory.rb
|
48
48
|
- lib/test-factory.rb
|
49
49
|
- README.md
|
50
|
+
- test-factory-0.1.6.gem
|
50
51
|
- test-factory.gemspec
|
51
52
|
homepage: https://github.com/rSmart
|
52
53
|
licenses: []
|