automation_wizard 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/ChangeLog +2 -0
- data/Readme.md +20 -0
- data/automation_wizard.gemspec +28 -0
- data/bin/wiz +4 -0
- data/lib/automation_wizard/cli.rb +16 -0
- data/lib/automation_wizard/generators/project/Gemfile.tt +10 -0
- data/lib/automation_wizard/generators/project/Rakefile +9 -0
- data/lib/automation_wizard/generators/project/Readme.md.tt +49 -0
- data/lib/automation_wizard/generators/project/cucumber.yml.tt +1 -0
- data/lib/automation_wizard/generators/project/env.rb.tt +10 -0
- data/lib/automation_wizard/generators/project/hooks.rb.tt +20 -0
- data/lib/automation_wizard/generators/project.rb +63 -0
- data/lib/automation_wizard/version.rb +3 -0
- data/lib/automation_wizard.rb +2 -0
- metadata +170 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 278280f6976a396faab9b3b87edb3c78df1b6e6d
|
4
|
+
data.tar.gz: dffab9fd29018cb43bd64f0f1b25e9e32244b085
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1ab199f9751d3da87d6db6a75e74450f3cfcc9bd481e5f9ada0c442d127c55c9f6d38b4e67ce897613b4c24254e4ec28dffceaf4e4e870262cfb6ea040d638d6
|
7
|
+
data.tar.gz: 5297caef617e6e810e5698fe619de9c21e40a2be5b578b69c201f7977d184ec15e164225837ccbfd6f17520873dfda15e8a34a4fb389db770a5cdbd9d2203d12
|
data/.gitignore
ADDED
data/ChangeLog
ADDED
data/Readme.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Automation Wizard
|
2
|
+
|
3
|
+
A gem that contains generators that create things testers need.
|
4
|
+
|
5
|
+
Currently it only generates a cucumber project. You can do this by executing:
|
6
|
+
|
7
|
+
wiz testproject <project_name>
|
8
|
+
|
9
|
+
This command will create a project in the <em>project_name</em> directory with the files needed to begin
|
10
|
+
developing cucumber features. There is an option that can be provided to have the project configure to use different gems:
|
11
|
+
|
12
|
+
## Web testing
|
13
|
+
|
14
|
+
If you are testing a web application, <em>testgen</em> can setup the project to use the PageObject gem.
|
15
|
+
|
16
|
+
wiz testproject <project_name> --pageobject-driver=watir
|
17
|
+
|
18
|
+
Valid options for the <em>--pageobject-driver</em> option are 'watir' or 'selenium'
|
19
|
+
|
20
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "automation_wizard/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "automation_wizard"
|
7
|
+
s.version = AutomationWizard::VERSION
|
8
|
+
s.license = 'MIT'
|
9
|
+
s.authors = ["Avery Roswell"]
|
10
|
+
s.email = ["avery.roswell@loblaw.ca"]
|
11
|
+
s.summary = %q{Generator for wizard test. Generator for base project setup.}
|
12
|
+
s.description = %q{A collection of generators for project setup, applicant testing, and onboarding.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "automation_wizard"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_dependency 'thor', '~> 0.17', '>=0.17.0'
|
22
|
+
s.add_dependency 'cucumber', '~> 1.2', '>=1.2.0'
|
23
|
+
s.add_dependency 'rspec', '~> 2.13', '>=2.13.0'
|
24
|
+
s.add_dependency 'pry', '~> 0.10', '>=0.10.0'
|
25
|
+
s.add_dependency 'require_all'
|
26
|
+
|
27
|
+
s.add_development_dependency 'aruba'
|
28
|
+
end
|
data/bin/wiz
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'automation_wizard/generators/project'
|
3
|
+
|
4
|
+
module AutomationWizard
|
5
|
+
class CLI < Thor
|
6
|
+
|
7
|
+
desc "testproject <project_name>", "Create a new test project"
|
8
|
+
method_option :pageobject_driver, type: :string, required: false, desc: "Use the PageObject gem to drive browsers. Valid values are 'watir' and 'selenium'"
|
9
|
+
|
10
|
+
def testproject(name)
|
11
|
+
driver = options[:pageobject_driver].nil? ? 'none' : options[:pageobject_driver]
|
12
|
+
AutomationWizard::Generators::Project.start([name, driver])
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
###Automation Take-Home Test
|
2
|
+
|
3
|
+
Purpose:
|
4
|
+
|
5
|
+
1. To measure candidate's ability to build robust tests using the PageObject gem as a base.
|
6
|
+
|
7
|
+
2. To measure candidate's overall code quality and test architecture
|
8
|
+
|
9
|
+
|
10
|
+
Deliverables:
|
11
|
+
|
12
|
+
* Return the generated project folder in a zip file
|
13
|
+
|
14
|
+
* Include instructions on how to run the tests and install any required libraries
|
15
|
+
|
16
|
+
|
17
|
+
Recommended Tools in Generated Gemfile:
|
18
|
+
|
19
|
+
* Cucumber for the test framework
|
20
|
+
|
21
|
+
* Page-Object gem for the test code (it is a wrapper for Selenium & Watir WebDriver)
|
22
|
+
|
23
|
+
* Rake for launching tests / tasks
|
24
|
+
|
25
|
+
* Pry for debugging (optional)
|
26
|
+
|
27
|
+
|
28
|
+
Browser the test needs to run on:
|
29
|
+
|
30
|
+
* Chrome (Chrome driver should be installed first if not already.)
|
31
|
+
|
32
|
+
|
33
|
+
Time:
|
34
|
+
|
35
|
+
* 1 week from the time the candidate receives the email with the test instructions.
|
36
|
+
|
37
|
+
* You can contact aroswell@gmail.com via email or on google hangout for any questions or clarifications
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
Tests scenarios:
|
42
|
+
|
43
|
+
_Goto_ [loblaw.ca](https://www.loblaws.ca/)
|
44
|
+
|
45
|
+
1a) Search for `apples` and sort the search results from highest price to lowest price. Confirm that the web site has sorted the price correctly.
|
46
|
+
|
47
|
+
1b) Search for `apples` and use the _Price Reduction_ filter under _Promotions_ to sort the search by sale badges. Verify for every product: the amount on the badge and the price reduction match, and that the price in kg is equivalent to the price in lbs.
|
48
|
+
|
49
|
+
2) As a new user to the site, add an item to your cart. The site should ask you to pick a store. After selecting a store that allows online shopping, confirm that the homepage displays the correct store. Then select a timeslot in the slot wizard and confirm that the homepage displays the correct timeslot.
|
@@ -0,0 +1 @@
|
|
1
|
+
default: --no-source --color --format pretty
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% if pageobject_driver.downcase == 'watir' -%>
|
2
|
+
require 'watir-webdriver'
|
3
|
+
<% end %>
|
4
|
+
<% if pageobject_driver.downcase == 'selenium' -%>
|
5
|
+
require 'selenium-webdriver'
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
Before do
|
9
|
+
<% if pageobject_driver.downcase == 'watir' -%>
|
10
|
+
@browser = Watir::Browser.new :chrome
|
11
|
+
<% end %>
|
12
|
+
<% if pageobject_driver.downcase == 'selenium' -%>
|
13
|
+
@browser = Selenium::WebDriver.for :chrome
|
14
|
+
<% end %>
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
After do
|
19
|
+
@browser.close
|
20
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
module AutomationWizard
|
4
|
+
module Generators
|
5
|
+
class Project < Thor::Group
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
argument :name, type: :string, desc: 'The name of the project'
|
9
|
+
argument :pageobject_driver, type: :string, desc: 'Driver to use with PageObject'
|
10
|
+
|
11
|
+
desc "Generates a project structure for automation applicant test"
|
12
|
+
|
13
|
+
def self.source_root
|
14
|
+
File.dirname(__FILE__) + "/project"
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_top_directory
|
18
|
+
empty_directory(name)
|
19
|
+
end
|
20
|
+
|
21
|
+
def copy_cucumber_yml
|
22
|
+
template "cucumber.yml.tt", "#{name}/cucumber.yml"
|
23
|
+
end
|
24
|
+
|
25
|
+
def copy_gemfile
|
26
|
+
template "Gemfile.tt", "#{name}/Gemfile"
|
27
|
+
end
|
28
|
+
|
29
|
+
def copy_rakefile
|
30
|
+
copy_file "Rakefile", "#{name}/Rakefile"
|
31
|
+
end
|
32
|
+
|
33
|
+
def copy_readme
|
34
|
+
copy_file "Readme.md.tt", "#{name}/Readme.md"
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_cucumber_directories
|
38
|
+
empty_directory("#{name}/features")
|
39
|
+
empty_directory("#{name}/features/support")
|
40
|
+
empty_directory("#{name}/features/step_definitions")
|
41
|
+
end
|
42
|
+
|
43
|
+
def copy_env
|
44
|
+
template "env.rb.tt", "#{name}/features/support/env.rb"
|
45
|
+
end
|
46
|
+
|
47
|
+
def copy_hooks
|
48
|
+
template "hooks.rb.tt", "#{name}/features/support/hooks.rb" unless no_driver_selected
|
49
|
+
end
|
50
|
+
|
51
|
+
def create_pages_directory
|
52
|
+
empty_directory("#{name}/features/support/pages") unless no_driver_selected
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
private
|
57
|
+
def no_driver_selected
|
58
|
+
pageobject_driver.downcase == 'none'
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
metadata
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: automation_wizard
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Avery Roswell
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.17'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.17.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.17'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.17.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: cucumber
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.2'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.2.0
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.2'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.2.0
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rspec
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '2.13'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 2.13.0
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.13'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 2.13.0
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: pry
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0.10'
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.10.0
|
83
|
+
type: :runtime
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.10'
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 0.10.0
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: require_all
|
95
|
+
requirement: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
type: :runtime
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
- !ruby/object:Gem::Dependency
|
108
|
+
name: aruba
|
109
|
+
requirement: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
type: :development
|
115
|
+
prerelease: false
|
116
|
+
version_requirements: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
description: A collection of generators for project setup, applicant testing, and
|
122
|
+
onboarding.
|
123
|
+
email:
|
124
|
+
- avery.roswell@loblaw.ca
|
125
|
+
executables:
|
126
|
+
- wiz
|
127
|
+
extensions: []
|
128
|
+
extra_rdoc_files: []
|
129
|
+
files:
|
130
|
+
- ".gitignore"
|
131
|
+
- ChangeLog
|
132
|
+
- Readme.md
|
133
|
+
- automation_wizard.gemspec
|
134
|
+
- bin/wiz
|
135
|
+
- lib/automation_wizard.rb
|
136
|
+
- lib/automation_wizard/cli.rb
|
137
|
+
- lib/automation_wizard/generators/project.rb
|
138
|
+
- lib/automation_wizard/generators/project/Gemfile.tt
|
139
|
+
- lib/automation_wizard/generators/project/Rakefile
|
140
|
+
- lib/automation_wizard/generators/project/Readme.md.tt
|
141
|
+
- lib/automation_wizard/generators/project/cucumber.yml.tt
|
142
|
+
- lib/automation_wizard/generators/project/env.rb.tt
|
143
|
+
- lib/automation_wizard/generators/project/hooks.rb.tt
|
144
|
+
- lib/automation_wizard/version.rb
|
145
|
+
homepage:
|
146
|
+
licenses:
|
147
|
+
- MIT
|
148
|
+
metadata: {}
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
require_paths:
|
152
|
+
- lib
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
requirements: []
|
164
|
+
rubyforge_project: automation_wizard
|
165
|
+
rubygems_version: 2.5.1
|
166
|
+
signing_key:
|
167
|
+
specification_version: 4
|
168
|
+
summary: Generator for wizard test. Generator for base project setup.
|
169
|
+
test_files: []
|
170
|
+
has_rdoc:
|