test-factory 0.1.8 → 0.1.9
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.
- data/README.md +10 -6
- data/test-factory-0.1.8.gem +0 -0
- data/test-factory.gemspec +1 -1
- metadata +2 -1
data/README.md
CHANGED
@@ -169,7 +169,8 @@ end
|
|
169
169
|
Design Pattern
|
170
170
|
--------------
|
171
171
|
|
172
|
-
The TestFactory was written assuming the following guiding principles. Any code that does not
|
172
|
+
The TestFactory was written assuming the following guiding principles. Any code that does not
|
173
|
+
follow them probably [smells](http://en.wikipedia.org/wiki/Code_smell), and should be refactored.
|
173
174
|
|
174
175
|
1. Page Classes contain methods relating to interactions with page elements only--meaning
|
175
176
|
the getting or setting of values, or the clicking of links or buttons. Any more
|
@@ -182,10 +183,11 @@ The TestFactory was written assuming the following guiding principles. Any code
|
|
182
183
|
custom methods are avoided without compelling arguments for their inclusion in the class.
|
183
184
|
4. When a Data Object is executing its `edit` method, first the data in the
|
184
185
|
system under test is updated, then the data object's instance variables
|
185
|
-
are updated--using `set_options`.
|
186
|
+
are updated--using DataFactory's `set_options`.
|
186
187
|
5. Site navigation is handled using conditional methods (meaning they only navigate if
|
187
|
-
necessary) inside the Data Object
|
188
|
-
|
188
|
+
necessary) inside the Data Object--and preferably inside the data object's CRUD methods
|
189
|
+
themselves--unless there are specific reasons to explicitly navigate in a step
|
190
|
+
definition. This keeps step definitions from being unnecessarily cluttered.
|
189
191
|
6. Specifying non-default test variables for data objects is done using key/value hash
|
190
192
|
pairs that are parameters of the data object's CRUD methods. It is _not_
|
191
193
|
done by explicitly assigning values to the instance variables. Examples:
|
@@ -193,10 +195,12 @@ The TestFactory was written assuming the following guiding principles. Any code
|
|
193
195
|
# During object creation, following the name of the class
|
194
196
|
@data_object = make DataObject, :attrib1 => "Custom Value 1", :attrib2 => "Custom Value 2" # etc...
|
195
197
|
|
196
|
-
# When an object is edited (Ruby v1.9.3 Hash syntax optional)
|
198
|
+
# When an object is edited (using Ruby v1.9.3's Hash syntax is optional)
|
197
199
|
@data_object.edit attrib1: "Updated Value 1", attrib2: "Updated Value 2"
|
198
200
|
|
199
|
-
# This is frowned upon
|
201
|
+
# This is frowned upon because it can easily lead to
|
202
|
+
# the data object and the data in the test site being
|
203
|
+
# out of sync, leading to a false negative test result:
|
200
204
|
@data_object.attrib1="Another Value"
|
201
205
|
|
202
206
|
```
|
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.9'
|
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.9
|
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.8.gem
|
50
51
|
- test-factory.gemspec
|
51
52
|
homepage: https://github.com/rSmart
|
52
53
|
licenses: []
|