automation_wizard 0.1.3 → 2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +3 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +2 -2
- data/Readme.md +31 -6
- data/automation_wizard.gemspec +6 -6
- data/email_instructions.md +2 -3
- data/lib/automation_wizard/cli.rb +5 -4
- data/lib/automation_wizard/generators/project.rb +23 -30
- data/lib/automation_wizard/generators/project/.rspec +3 -0
- data/lib/automation_wizard/generators/project/Gemfile +7 -0
- data/lib/automation_wizard/generators/project/Rakefile +3 -7
- data/lib/automation_wizard/generators/project/Readme.md.tt +6 -3
- data/lib/automation_wizard/generators/project/loblaws_home.rb.tt +13 -0
- data/lib/automation_wizard/generators/project/loblaws_search_spec.rb.tt +18 -0
- data/lib/automation_wizard/generators/project/model_loblaws_search.rb.tt +5 -0
- data/lib/automation_wizard/generators/project/spec_helper.rb +22 -0
- data/lib/automation_wizard/version.rb +1 -1
- metadata +9 -7
- data/gemfile +0 -2
- data/lib/automation_wizard/generators/project/Gemfile.tt +0 -10
- data/lib/automation_wizard/generators/project/cucumber.yml.tt +0 -1
- data/lib/automation_wizard/generators/project/env.rb.tt +0 -10
- data/lib/automation_wizard/generators/project/hooks.rb.tt +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34759bd383003b2e10df0b6281c6c0fea20990c2
|
4
|
+
data.tar.gz: 99bc6417b22fb39435864fdaf3122f1325abf34a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 807b662eac58a5ba49c7a95dbb8bb3dc8808ffda606ad6ae77cae2cee97d5a99ad5f907b40d1d10a0446d3f38eb08f59ab5825978cc235543c26d4ca4863e6fb
|
7
|
+
data.tar.gz: 3156100d06b0161c1b85a2a5c1a27a0952e3f443b72b59eb19613998891903dbdacea6a404c53013e1c22fd885c81e3d4bfddefaac61f65ec5d0d1a3be508d04
|
data/ChangeLog
CHANGED
data/Gemfile
ADDED
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -4,17 +4,42 @@ A gem that contains generators that create things testers need.
|
|
4
4
|
|
5
5
|
Currently it only generates a cucumber project. You can do this by executing:
|
6
6
|
|
7
|
-
wiz testproject <project_name>
|
7
|
+
wiz testproject <project_name> level=jr
|
8
8
|
|
9
9
|
This command will create a project in the <em>project_name</em> directory with the files needed to begin
|
10
|
-
developing
|
10
|
+
developing specs. There is an option that can be provided to have the project configure to use different gems:
|
11
11
|
|
12
|
-
|
12
|
+
###Automation Take-Home Test
|
13
13
|
|
14
|
-
|
14
|
+
Purpose:
|
15
|
+
|
16
|
+
1. To measure the candidate's ability to build robust tests using the PageObject gem as a base.
|
17
|
+
|
18
|
+
2. To measure the candidate's overall code quality
|
19
|
+
|
20
|
+
|
21
|
+
Deliverables:
|
22
|
+
|
23
|
+
* Return the generated project folder in a zip file
|
24
|
+
|
25
|
+
* Include instructions on how to run the tests and install any required libraries
|
26
|
+
|
27
|
+
|
28
|
+
Required Tools in Generated Gemfile:
|
29
|
+
|
30
|
+
* RSpec for the test framework
|
31
|
+
|
32
|
+
* Watir-drops gem for the test code (this gem enables you to implement the Page Objects)
|
33
|
+
|
34
|
+
* Rake for launching tests / tasks
|
35
|
+
|
36
|
+
* Pry for debugging (optional)
|
37
|
+
|
38
|
+
|
39
|
+
Browser the test needs to run on:
|
40
|
+
|
41
|
+
* Chrome (Chrome driver should be installed first if not already. If chrome driver is not installed, use [webdrivers](https://github.com/titusfortner/webdrivers))
|
15
42
|
|
16
|
-
wiz testproject <project_name> --pageobject-driver=watir
|
17
43
|
|
18
|
-
Valid options for the <em>--pageobject-driver</em> option are 'watir' or 'selenium'
|
19
44
|
|
20
45
|
|
data/automation_wizard.gemspec
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path(
|
3
|
-
require
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'automation_wizard/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "automation_wizard"
|
7
7
|
s.version = AutomationWizard::VERSION
|
8
8
|
s.license = 'MIT'
|
9
|
-
s.authors = [
|
10
|
-
s.email = [
|
9
|
+
s.authors = ['Avery Roswell']
|
10
|
+
s.email = ['avery.roswell@loblaw.ca']
|
11
11
|
s.summary = %q{Generator for wizard test. Generator for base project setup.}
|
12
12
|
s.description = %q{A collection of generators for project setup, applicant testing, and onboarding.}
|
13
13
|
|
14
|
-
s.rubyforge_project =
|
14
|
+
s.rubyforge_project = 'automation_wizard'
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
-
s.require_paths = [
|
19
|
+
s.require_paths = ['lib']
|
20
20
|
|
21
21
|
s.add_dependency 'thor', '~> 0.17', '>=0.17.0'
|
22
22
|
end
|
data/email_instructions.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
###Project Setup
|
2
2
|
|
3
3
|
1. Use gem install to install the automation_wizard: `gem install automation_wizard`
|
4
|
-
2. From the command line enter `wiz testproject web_automation --
|
4
|
+
2. From the command line enter `wiz testproject web_automation --level=jr` to generate a project for web application
|
5
5
|
testing using watir as the ruby library for automating tests. Watir interacts with a browser as a user would.
|
6
6
|
Change directories into the newly created web_automation project folder. From there run `bundle install`
|
7
|
-
3. You'll need _chromedriver_ to help with the automation. If _chromedriver_ is not installed, use
|
8
|
-
If _chromedriver_ is not listed then install it with: `brew install chromedriver`
|
7
|
+
3. You'll need _chromedriver_ to help with the automation. If _chromedriver_ is not installed, use [webdrivers] (https://github.com/titusfortner/webdrivers) to install the driver.
|
9
8
|
4. Follow the readme file in the generated project folder.
|
@@ -1,14 +1,15 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'automation_wizard/generators/project'
|
3
|
+
require 'pry'
|
3
4
|
|
4
5
|
module AutomationWizard
|
5
6
|
class CLI < Thor
|
6
|
-
|
7
|
-
desc
|
8
|
-
method_option :
|
7
|
+
|
8
|
+
desc 'testproject <project_name>', 'Create a new test project'
|
9
|
+
method_option :level, type: :string, required: true, desc: 'Provide level option.'
|
9
10
|
|
10
11
|
def testproject(name)
|
11
|
-
driver = options[:
|
12
|
+
driver = options[:level]
|
12
13
|
AutomationWizard::Generators::Project.start([name, driver])
|
13
14
|
end
|
14
15
|
|
@@ -6,58 +6,51 @@ module AutomationWizard
|
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
8
|
argument :name, type: :string, desc: 'The name of the project'
|
9
|
-
argument :
|
9
|
+
argument :level, type: :string, desc: 'Project level'
|
10
10
|
|
11
|
-
desc
|
11
|
+
desc 'Generates a project structure for automation applicant test'
|
12
12
|
|
13
13
|
def self.source_root
|
14
|
-
File.dirname(__FILE__) +
|
14
|
+
File.dirname(__FILE__) + '/project'
|
15
15
|
end
|
16
|
-
|
17
|
-
def
|
16
|
+
|
17
|
+
def create_project_structure
|
18
18
|
empty_directory(name)
|
19
|
+
empty_directory("#{name}/spec")
|
20
|
+
empty_directory("#{name}/lib")
|
21
|
+
empty_directory("#{name}/lib/models")
|
22
|
+
empty_directory("#{name}/lib/pages")
|
19
23
|
end
|
20
|
-
|
21
|
-
def
|
22
|
-
template
|
24
|
+
|
25
|
+
def copy_rspec
|
26
|
+
template '.rspec', "#{name}/.rspec"
|
23
27
|
end
|
24
|
-
|
28
|
+
|
25
29
|
def copy_gemfile
|
26
|
-
template
|
30
|
+
template 'Gemfile', "#{name}/Gemfile"
|
27
31
|
end
|
28
32
|
|
29
33
|
def copy_rakefile
|
30
|
-
copy_file
|
34
|
+
copy_file 'Rakefile', "#{name}/Rakefile"
|
31
35
|
end
|
32
36
|
|
33
37
|
def copy_readme
|
34
|
-
copy_file
|
38
|
+
copy_file 'Readme.md.tt', "#{name}/README.md"
|
35
39
|
end
|
36
40
|
|
37
|
-
def
|
38
|
-
|
39
|
-
|
40
|
-
empty_directory("#{name}/features/step_definitions")
|
41
|
-
end
|
42
|
-
|
43
|
-
def copy_env
|
44
|
-
template "env.rb.tt", "#{name}/features/support/env.rb"
|
41
|
+
def copy_specs
|
42
|
+
template 'spec_helper.rb', "#{name}/spec/spec_helper.rb"
|
43
|
+
template 'loblaws_search_spec.rb.tt', "#{name}/spec/loblaws_search_spec.rb"
|
45
44
|
end
|
46
45
|
|
47
|
-
def
|
48
|
-
template
|
46
|
+
def copy_pages
|
47
|
+
template 'loblaws_home.rb.tt', "#{name}/lib/pages/loblaws_home.rb"
|
49
48
|
end
|
50
49
|
|
51
|
-
def
|
52
|
-
|
50
|
+
def copy_models
|
51
|
+
template 'model_loblaws_search.rb.tt', "#{name}/lib/models/model_loblaws_search.rb"
|
53
52
|
end
|
54
53
|
|
55
|
-
|
56
|
-
private
|
57
|
-
def no_driver_selected
|
58
|
-
pageobject_driver.downcase == 'none'
|
59
|
-
end
|
60
|
-
|
61
54
|
end
|
62
55
|
end
|
63
56
|
end
|
@@ -1,9 +1,5 @@
|
|
1
|
-
require '
|
2
|
-
require 'cucumber'
|
3
|
-
require 'cucumber/rake/task'
|
1
|
+
require 'rspec/core/rake_task'
|
4
2
|
|
5
|
-
|
6
|
-
t.profile = 'default'
|
7
|
-
end
|
3
|
+
RSpec::Core::RakeTask.new(:spec)
|
8
4
|
|
9
|
-
task :default => :
|
5
|
+
task :default => :spec
|
@@ -16,18 +16,21 @@ Deliverables:
|
|
16
16
|
|
17
17
|
Required Tools in Generated Gemfile:
|
18
18
|
|
19
|
-
*
|
19
|
+
* RSpec for the test framework
|
20
20
|
|
21
|
-
*
|
21
|
+
* Watir-drops gem for the test code (this gem enables you to implement the Page Objects)
|
22
22
|
|
23
23
|
* Rake for launching tests / tasks
|
24
24
|
|
25
25
|
* Pry for debugging (optional)
|
26
26
|
|
27
|
+
* chromedriver executable for controlling a Chrome browser (if not installed, follow instructions [here](https://github.com/titusfortner/webdrivers))
|
28
|
+
|
29
|
+
|
27
30
|
|
28
31
|
Browser the test needs to run on:
|
29
32
|
|
30
|
-
* Chrome
|
33
|
+
* Chrome
|
31
34
|
|
32
35
|
|
33
36
|
Time:
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% if level.downcase == 'jr' -%>
|
2
|
+
class LoblawsHome < WatirDrops::PageObject
|
3
|
+
|
4
|
+
page_url { 'https://www.loblaws.ca' }
|
5
|
+
|
6
|
+
element(:search_term) { browser.text_field(id: 'search-bar')}
|
7
|
+
|
8
|
+
def populate_search_field(data)
|
9
|
+
fill_form(data)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if level.downcase == 'jr' -%>
|
2
|
+
require_relative 'spec_helper'
|
3
|
+
require_relative '../lib/pages/loblaws_home'
|
4
|
+
require_relative '../lib/models/model_loblaws_search'
|
5
|
+
|
6
|
+
describe 'Loblaws Home Page' do
|
7
|
+
let(:browser) { WatirDrops::PageObject.browser}
|
8
|
+
|
9
|
+
|
10
|
+
it 'fills in search field' do
|
11
|
+
search_data = ModelLoblawsSearch.new
|
12
|
+
page = LoblawsHome.visit
|
13
|
+
page.populate_search_field(search_data)
|
14
|
+
|
15
|
+
expect(page.search_term.value).to include search_data.search_term
|
16
|
+
end
|
17
|
+
end
|
18
|
+
<% end %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'watir_drops'
|
2
|
+
require 'watir_model'
|
3
|
+
require 'pry'
|
4
|
+
|
5
|
+
Watir.default_timeout = 15
|
6
|
+
|
7
|
+
RSpec.configure do |config|
|
8
|
+
|
9
|
+
config.before(:suite) do
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
config.before(:each) do
|
14
|
+
WatirDrops::PageObject.browser = Watir::Browser.new :chrome
|
15
|
+
WatirDrops::PageObject.browser.window.maximize
|
16
|
+
end
|
17
|
+
|
18
|
+
config.after(:each) do |scenario|
|
19
|
+
WatirDrops::PageObject.browser.close
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: automation_wizard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0
|
4
|
+
version: '2.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Avery Roswell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01
|
11
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -41,21 +41,23 @@ extra_rdoc_files: []
|
|
41
41
|
files:
|
42
42
|
- ".gitignore"
|
43
43
|
- ChangeLog
|
44
|
+
- Gemfile
|
44
45
|
- Gemfile.lock
|
45
46
|
- Readme.md
|
46
47
|
- automation_wizard.gemspec
|
47
48
|
- bin/wiz
|
48
49
|
- email_instructions.md
|
49
|
-
- gemfile
|
50
50
|
- lib/automation_wizard.rb
|
51
51
|
- lib/automation_wizard/cli.rb
|
52
52
|
- lib/automation_wizard/generators/project.rb
|
53
|
-
- lib/automation_wizard/generators/project
|
53
|
+
- lib/automation_wizard/generators/project/.rspec
|
54
|
+
- lib/automation_wizard/generators/project/Gemfile
|
54
55
|
- lib/automation_wizard/generators/project/Rakefile
|
55
56
|
- lib/automation_wizard/generators/project/Readme.md.tt
|
56
|
-
- lib/automation_wizard/generators/project/
|
57
|
-
- lib/automation_wizard/generators/project/
|
58
|
-
- lib/automation_wizard/generators/project/
|
57
|
+
- lib/automation_wizard/generators/project/loblaws_home.rb.tt
|
58
|
+
- lib/automation_wizard/generators/project/loblaws_search_spec.rb.tt
|
59
|
+
- lib/automation_wizard/generators/project/model_loblaws_search.rb.tt
|
60
|
+
- lib/automation_wizard/generators/project/spec_helper.rb
|
59
61
|
- lib/automation_wizard/version.rb
|
60
62
|
homepage:
|
61
63
|
licenses:
|
data/gemfile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
default: --no-source --color --format pretty
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<% if pageobject_driver.downcase == 'watir' -%>require 'watir' <% end %>
|
2
|
-
<% if pageobject_driver.downcase == 'selenium' -%>require 'selenium-webdriver' <% end %>
|
3
|
-
|
4
|
-
Before do
|
5
|
-
<% if pageobject_driver.downcase == 'watir' -%> @browser = Watir::Browser.new :chrome <% end %>
|
6
|
-
<% if pageobject_driver.downcase == 'selenium' -%> @browser = Selenium::WebDriver.for :chrome <% end %>
|
7
|
-
end
|
8
|
-
|
9
|
-
After do
|
10
|
-
@browser.close
|
11
|
-
end
|