test-factory 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -0
- data/Gemfile.lock +31 -0
- data/README.md +1 -1
- data/lib/test-factory/data_factory.rb +20 -2
- data/lib/test-factory/gem_ext.rb +21 -0
- data/test-factory.gemspec +1 -1
- metadata +5 -3
- data/test-factory-0.0.1.gem +0 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
test-factory (0.0.3)
|
5
|
+
watir-webdriver (>= 0.6.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
addressable (2.2.7)
|
11
|
+
childprocess (0.3.1)
|
12
|
+
ffi (~> 1.0.6)
|
13
|
+
ffi (1.0.11)
|
14
|
+
libwebsocket (0.1.3)
|
15
|
+
addressable
|
16
|
+
multi_json (1.2.0)
|
17
|
+
rubyzip (0.9.7)
|
18
|
+
selenium-webdriver (2.25.0)
|
19
|
+
childprocess (>= 0.2.5)
|
20
|
+
libwebsocket (~> 0.1.3)
|
21
|
+
multi_json (~> 1.0)
|
22
|
+
rubyzip
|
23
|
+
watir-webdriver (0.6.1)
|
24
|
+
selenium-webdriver (>= 2.18.0)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
ruby
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
test-factory!
|
31
|
+
watir-webdriver
|
data/README.md
CHANGED
@@ -91,7 +91,7 @@ class YourDataObject
|
|
91
91
|
# with any options you passed explicitly
|
92
92
|
set_options(options) # This line turns all the contents of the options
|
93
93
|
# Hash into YourDataObject's class instance variables
|
94
|
-
requires
|
94
|
+
requires @id # This line allows you to specify any class instance variables that must
|
95
95
|
# be explicitly defined for the data object
|
96
96
|
end
|
97
97
|
|
@@ -18,11 +18,11 @@ module DataFactory
|
|
18
18
|
#
|
19
19
|
# @example
|
20
20
|
#
|
21
|
-
#
|
21
|
+
# requires @site @assignment
|
22
22
|
#
|
23
23
|
def requires(*elements)
|
24
24
|
elements.each do |inst_var|
|
25
|
-
raise "You
|
25
|
+
raise "You've neglected to define a required variable for the #{self}." if inst_var==nil
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -35,4 +35,22 @@ module DataFactory
|
|
35
35
|
end
|
36
36
|
alias radio_setting checkbox_setting
|
37
37
|
|
38
|
+
# Use this method in your data object class for select list boxes that will have
|
39
|
+
# default values you may be interested in. The method will either set the select
|
40
|
+
# box to the value specified, or, if no value exists for the given variable in your
|
41
|
+
# data object, it will get the value from the UI and set the data object's
|
42
|
+
# variable to that value. Note that this only supports select lists that allow
|
43
|
+
# a single selection.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
#
|
47
|
+
# @num_resubmissions = get_or_set(@num_resubmissions, page.num_resubmissions)
|
48
|
+
def get_or_select(var, select_list)
|
49
|
+
if var==nil
|
50
|
+
select_list.selected_options[0].text
|
51
|
+
else
|
52
|
+
select_list.select var
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
38
56
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Watir
|
2
|
+
module UserEditable
|
3
|
+
|
4
|
+
def fit(*args)
|
5
|
+
unless args==nil
|
6
|
+
assert_exists
|
7
|
+
assert_writable
|
8
|
+
|
9
|
+
@element.clear
|
10
|
+
@element.send_keys(*args)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Select
|
16
|
+
def fit(str_or_rx)
|
17
|
+
select_by :text, str_or_rx unless str_or_rx==nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
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.0.
|
3
|
+
s.version = '0.0.3'
|
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.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: watir-webdriver
|
@@ -35,15 +35,17 @@ executables: []
|
|
35
35
|
extensions: []
|
36
36
|
extra_rdoc_files: []
|
37
37
|
files:
|
38
|
+
- Gemfile
|
39
|
+
- Gemfile.lock
|
38
40
|
- lib/test-factory/core_ext.rb
|
39
41
|
- lib/test-factory/data_factory.rb
|
40
42
|
- lib/test-factory/date_factory.rb
|
41
43
|
- lib/test-factory/foundry.rb
|
44
|
+
- lib/test-factory/gem_ext.rb
|
42
45
|
- lib/test-factory/page_factory.rb
|
43
46
|
- lib/test-factory/string_factory.rb
|
44
47
|
- lib/test-factory.rb
|
45
48
|
- README.md
|
46
|
-
- test-factory-0.0.1.gem
|
47
49
|
- test-factory.gemspec
|
48
50
|
homepage: https://github.com/rSmart
|
49
51
|
licenses: []
|
data/test-factory-0.0.1.gem
DELETED
Binary file
|