test-factory 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +7 -7
- data/lib/test-factory/string_factory.rb +1 -1
- data/test-factory.gemspec +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
rSmart's
|
1
|
+
rSmart's TestFactory Gem
|
2
2
|
=========================
|
3
3
|
|
4
4
|
Overview
|
@@ -10,9 +10,9 @@ Use it to abstract away from the underlying [Watir](http://www.watir.com) code a
|
|
10
10
|
|
11
11
|
With TestFactory you have the ability to...
|
12
12
|
|
13
|
-
1. Easily instantiate
|
14
|
-
2. Concisely describe elements on a page, keeping it DRY by avoiding repetition of element identifiers
|
15
|
-
3. Provide higher-level methods that use the page classes and elements to perform user-oriented functions
|
13
|
+
1. Easily instantiate page classes (described below) in a consistent and readable manner
|
14
|
+
2. Concisely describe elements on a page, keeping it DRY by avoiding repetition of element identifiers that may (will) change
|
15
|
+
3. Provide higher-level methods that use customizable (and default) data, along with the page classes and elements, to perform user-oriented functions with minimal lines of code
|
16
16
|
|
17
17
|
Tremendous thanks is due to [Alister Scott](http://watirmelon.com), whose [custom page object code](https://github.com/alisterscott/wmf-custom-page-object) for the Wikimedia Foundation provided the inspiration for this gem.
|
18
18
|
|
@@ -22,7 +22,7 @@ Summary
|
|
22
22
|
Using the TestFactory properly involves three distinct steps:
|
23
23
|
|
24
24
|
1. Creating page classes that contain references to the elements on your web page. For this you use the PageFactory class. Working on page classes requires that you have a strong command of Watir and basic skills with Ruby.
|
25
|
-
2. Creating data objects that utilize your page classes and elements to build methods that perform user-oriented tasks. For this you use the DataFactory module. Working on data objects requires you have good familiarity with Watir and strong Ruby skills.
|
25
|
+
2. Creating "data objects" that utilize your page classes and elements to build methods that perform user-oriented tasks. For this you use the DataFactory module. Working on data objects requires you have good familiarity with Watir and strong Ruby skills.
|
26
26
|
3. Creating test scenarios using your favorite test framework (like Cucumber or Rspec) and your data objects. The methods in the Foundry class are useful here. Working at this level requires only basic skills with Ruby and Watir, but a strong command of your DSL (the thing you're building with TestFactory).
|
27
27
|
|
28
28
|
How to Start
|
@@ -147,7 +147,7 @@ include Foundry # Gives you access to the methods that instantiate your Page and
|
|
147
147
|
|
148
148
|
on MyPage do |page|
|
149
149
|
page.title.set "Bla bla"
|
150
|
-
# Very contrived example. You should be using your favorite verification framework here:
|
150
|
+
# Very contrived example. TestFactory was made to be test-framework-agnostic. You should be using your favorite verification framework here:
|
151
151
|
page.description==@my_thing.description ? puts "Passed" : puts "Failed"
|
152
152
|
end
|
153
153
|
```
|
@@ -155,7 +155,7 @@ end
|
|
155
155
|
Notice
|
156
156
|
------
|
157
157
|
|
158
|
-
Copyright
|
158
|
+
Copyright 2013 rSmart, Inc., Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
159
159
|
|
160
160
|
[http://www.osedu.org/licenses/ECL-2.0](http://www.osedu.org/licenses/ECL-2.0)
|
161
161
|
|
@@ -45,7 +45,7 @@ module StringFactory
|
|
45
45
|
# @param length [Integer] The count of characters in the string
|
46
46
|
# @param s [String] Typically this will be left blank, but if included, any string created will be prepended with s. Note that the string length will still be as specified
|
47
47
|
def random_alphanums_plus(length=10, s="")
|
48
|
-
chars = %w{ a b c d e f g h j k m n p q r s t u v w x y z A B C D E F G H J K L M N P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 ` ~ ! @ #
|
48
|
+
chars = %w{ a b c d e f g h j k m n p q r s t u v w x y z A B C D E F G H J K L M N P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 ` ~ ! @ # $ % ^ & * ( ) _ + - = { } [ ] \ : " ; ' < > ? , . / }
|
49
49
|
length.times { s << chars[rand(chars.size)] }
|
50
50
|
s.to_s
|
51
51
|
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.1.
|
3
|
+
s.version = '0.1.2'
|
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.2
|
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: 2013-01-
|
12
|
+
date: 2013-01-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: watir-webdriver
|