watir_install 0.2.1
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.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +21 -0
- data/CHANGES.md +45 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +23 -0
- data/Rakefile +6 -0
- data/bin/watir +4 -0
- data/lib/watir_install/cli.rb +19 -0
- data/lib/watir_install/generators/new_project/config/data/data.yml.tt +3 -0
- data/lib/watir_install/generators/new_project/cucumber.yml.tt +1 -0
- data/lib/watir_install/generators/new_project/features/search.feature.tt +6 -0
- data/lib/watir_install/generators/new_project/features/step_definitions/search_steps.rb.tt +13 -0
- data/lib/watir_install/generators/new_project/features/support/env.rb.tt +11 -0
- data/lib/watir_install/generators/new_project/features/support/hooks.rb.tt +9 -0
- data/lib/watir_install/generators/new_project/features/support/pages/home.rb.tt +19 -0
- data/lib/watir_install/generators/new_project/features/support/pages/results.rb.tt +13 -0
- data/lib/watir_install/generators/new_project/gemfile.rb.tt +15 -0
- data/lib/watir_install/generators/new_project/gitignore.rb.tt +9 -0
- data/lib/watir_install/generators/new_project/lib/models/search.rb.tt +10 -0
- data/lib/watir_install/generators/new_project/lib/name.rb.tt +5 -0
- data/lib/watir_install/generators/new_project/lib/pages/home.rb.tt +15 -0
- data/lib/watir_install/generators/new_project/lib/pages/results.rb.tt +12 -0
- data/lib/watir_install/generators/new_project/license.rb.tt +21 -0
- data/lib/watir_install/generators/new_project/rakefile.rb.tt +16 -0
- data/lib/watir_install/generators/new_project/readme.rb.tt +41 -0
- data/lib/watir_install/generators/new_project/rspec.rb.tt +2 -0
- data/lib/watir_install/generators/new_project/ruby-version.rb.tt +1 -0
- data/lib/watir_install/generators/new_project/spec/search_spec.rb.tt +12 -0
- data/lib/watir_install/generators/new_project/spec/spec_helper.rb.tt +15 -0
- data/lib/watir_install/generators/new_project/travis.rb.tt +16 -0
- data/lib/watir_install/generators/new_project.rb +100 -0
- data/lib/watir_install.rb +1 -0
- data/watir_install.gemspec +43 -0
- metadata +229 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 11cc85ef4b1e63581703ee6a1fc226506a3ed9de
|
|
4
|
+
data.tar.gz: 5af6288495db7b81953a0a14e10cf6ee40d8fa7d
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b2be72ccc1ac0899ff11b0a53361ef6eef61ea2844963f8a1a2deae75d1d75807f537483f3d6f75977b406f384cd9ad3bb23815acaa9cf823bb9cfe0d887c620
|
|
7
|
+
data.tar.gz: 7b77625b9de6ee39fd59f425b9a78405f596603a3abcb04ff055343f840aaf878f0e97ad80f639e8fe157f047ada123f324c0ed70ab6ea4cee823fc25c50e74d
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-2.3.3
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
sudo: required
|
|
2
|
+
dist: trusty
|
|
3
|
+
language: ruby
|
|
4
|
+
addons:
|
|
5
|
+
firefox: latest
|
|
6
|
+
rvm:
|
|
7
|
+
- 2.2.6
|
|
8
|
+
cache: bundler
|
|
9
|
+
before_script:
|
|
10
|
+
- export CHROME_BIN=/usr/bin/google-chrome
|
|
11
|
+
- export DISPLAY=:99.0
|
|
12
|
+
- sh -e /etc/init.d/xvfb start
|
|
13
|
+
- sudo apt-get update
|
|
14
|
+
- sudo apt-get install -y libappindicator1 fonts-liberation
|
|
15
|
+
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
16
|
+
- sudo dpkg -i google-chrome*.deb
|
|
17
|
+
script: bundle exec rake spec
|
|
18
|
+
env:
|
|
19
|
+
- BROWSER=chrome
|
|
20
|
+
- BROWSER=firefox
|
|
21
|
+
- BROWSER=phantomjs
|
data/CHANGES.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
### 0.2.1 (2017-01-03)
|
|
2
|
+
|
|
3
|
+
* Remove WatirSession requirement
|
|
4
|
+
* Add Bundle Update
|
|
5
|
+
* Add Support for Cucumber and Cheezy's gems
|
|
6
|
+
* Using git is optional by flag
|
|
7
|
+
|
|
8
|
+
### 0.2.0 (2017-01-01)
|
|
9
|
+
|
|
10
|
+
* Rename to Watir Install
|
|
11
|
+
* Reorganize to match Cheezy's testgen implementation
|
|
12
|
+
|
|
13
|
+
### 0.1.7 (2016-11-26)
|
|
14
|
+
|
|
15
|
+
* Fix Windows bugs
|
|
16
|
+
|
|
17
|
+
### 0.1.6 (2016-11-26)
|
|
18
|
+
|
|
19
|
+
* Fix gemspec bug
|
|
20
|
+
|
|
21
|
+
### 0.1.5 (2016-11-25)
|
|
22
|
+
|
|
23
|
+
* Support webdrivers gem
|
|
24
|
+
* Add ruby-version file
|
|
25
|
+
|
|
26
|
+
### 0.1.4 (2016-11-20)
|
|
27
|
+
|
|
28
|
+
* Support underscores in project name
|
|
29
|
+
|
|
30
|
+
### 0.1.3 (2016-11-20)
|
|
31
|
+
|
|
32
|
+
* Support Watir Session
|
|
33
|
+
|
|
34
|
+
### 0.1.2 (2016-11-15)
|
|
35
|
+
|
|
36
|
+
* Support Watir Model
|
|
37
|
+
|
|
38
|
+
### 0.1.1 (2016-11-14)
|
|
39
|
+
|
|
40
|
+
* Support Watir Drops
|
|
41
|
+
* Generate project with template
|
|
42
|
+
|
|
43
|
+
### 0.1.0 (2016-11-14)
|
|
44
|
+
|
|
45
|
+
* Initial Release
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016-2017 Titus Fortner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# WatirInstall
|
|
2
|
+
|
|
3
|
+
This gem allows you to create a new directory for your project with sample templates
|
|
4
|
+
to use to write your Watir tests. It includes a number of useful gems along with
|
|
5
|
+
the recommended default configurations to easily create and maintain your test suite.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
$ gem install watir_install
|
|
10
|
+
|
|
11
|
+
And then execute with the name of your project:
|
|
12
|
+
|
|
13
|
+
$ watir_install foobar
|
|
14
|
+
|
|
15
|
+
## Contributing
|
|
16
|
+
|
|
17
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/titusfortner/watir_install.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## License
|
|
21
|
+
|
|
22
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
23
|
+
|
data/Rakefile
ADDED
data/bin/watir
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'thor'
|
|
2
|
+
require 'watir_install/generators/new_project'
|
|
3
|
+
|
|
4
|
+
module WatirInstall
|
|
5
|
+
class CLI < Thor
|
|
6
|
+
|
|
7
|
+
desc "new <project_name>", "Create a new test project"
|
|
8
|
+
method_option :no_git, type: :boolean, desc: "Do not initialize project with git"
|
|
9
|
+
method_option :test_runner, type: :string, desc: "Do not initialize project with git"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def new(name)
|
|
13
|
+
no_git = options[:no_git] ? 'true' : 'false'
|
|
14
|
+
test_runner = options[:test_runner]
|
|
15
|
+
WatirInstall::Generators::NewProject.start([name, no_git, test_runner])
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
default: --no-source --color --format pretty
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Given 'I am on the Google Home Page' do
|
|
2
|
+
@search_page = visit <%= name.split('_').map(&:capitalize).join %>::Home
|
|
3
|
+
@search_data = @search_page.data_for(:search)
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
When 'I submit a search' do
|
|
7
|
+
@search_page.search(@search_data['search_input'])
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
Then 'I should see the results displayed' do
|
|
11
|
+
results_page = on <%= name.split('_').map(&:capitalize).join %>::Results
|
|
12
|
+
expect(results_page.first_result).to include @search_data['first_result']
|
|
13
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'page-object'
|
|
2
|
+
|
|
3
|
+
module <%= name.split('_').map(&:capitalize).join %>
|
|
4
|
+
class Home
|
|
5
|
+
include PageObject
|
|
6
|
+
include DataMagic
|
|
7
|
+
|
|
8
|
+
page_url "https://www.google.com/"
|
|
9
|
+
|
|
10
|
+
text_field(:search_input, name: 'q')
|
|
11
|
+
button(:submit, name: 'btnG')
|
|
12
|
+
|
|
13
|
+
def search(data)
|
|
14
|
+
populate_page_with data_for :search
|
|
15
|
+
self.submit
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
gem "bundler", "~> 1.13"
|
|
4
|
+
gem "rake", "~> 10.0"
|
|
5
|
+
<% if test_runner == 'cucumber' -%>
|
|
6
|
+
gem "cucumber", "~> 2.0"
|
|
7
|
+
<% end %>
|
|
8
|
+
gem "rspec", "~> 3.0"
|
|
9
|
+
gem "watir", "~> 6.0"
|
|
10
|
+
gem "webdrivers", "~> 2.1"
|
|
11
|
+
gem "watir_drops", "~> 0.5.0"
|
|
12
|
+
gem 'watir_model', "~> 0.2"
|
|
13
|
+
gem "page-object", "~> 2.0"
|
|
14
|
+
gem "data_magic"
|
|
15
|
+
gem "require_all"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module <%= name.split('_').map(&:capitalize).join %>
|
|
2
|
+
class Home < WatirDrops::PageObject
|
|
3
|
+
|
|
4
|
+
element(:search_term) { browser.text_field(name: 'q')}
|
|
5
|
+
element(:submit) { browser.button(name: 'btnG') }
|
|
6
|
+
|
|
7
|
+
page_url { 'https://www.google.com/' }
|
|
8
|
+
|
|
9
|
+
def search(data)
|
|
10
|
+
fill_form(data)
|
|
11
|
+
submit.click
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module <%= name.split('_').map(&:capitalize).join %>
|
|
2
|
+
class Results < WatirDrops::PageObject
|
|
3
|
+
|
|
4
|
+
elements(:results) { browser.divs(class: 'g') }
|
|
5
|
+
element(:title) { |element| element.h3 }
|
|
6
|
+
|
|
7
|
+
def first_result
|
|
8
|
+
title(results.first).text
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 <%= user_name %>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<% if test_runner == 'cucumber' -%>
|
|
2
|
+
require 'cucumber'
|
|
3
|
+
require 'cucumber/rake/task'
|
|
4
|
+
|
|
5
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
|
6
|
+
t.cucumber_opts = "features --format pretty"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
task :default => :features
|
|
10
|
+
<% else -%>
|
|
11
|
+
require "rspec/core/rake_task"
|
|
12
|
+
|
|
13
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
14
|
+
|
|
15
|
+
task :default => :spec
|
|
16
|
+
<% end -%>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# <%= name %>
|
|
2
|
+
|
|
3
|
+
Welcome to your new project!
|
|
4
|
+
|
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your application's Gemfile:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
gem '<%= name.downcase %>'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
$ bundle
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
|
|
21
|
+
$ gem install <%= name.downcase %>
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
TODO: Write usage instructions here
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
30
|
+
|
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
32
|
+
|
|
33
|
+
## Contributing
|
|
34
|
+
|
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/<%= name.downcase %>.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
41
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-2.3.3
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe <%= name.split('_').map(&:capitalize).join %> do
|
|
4
|
+
it "submits a search" do
|
|
5
|
+
search_data = <%= name.split('_').map(&:capitalize).join %>::Model::Search.new
|
|
6
|
+
search_page = <%= name.split('_').map(&:capitalize).join %>::Home.visit
|
|
7
|
+
|
|
8
|
+
search_page.search(search_data)
|
|
9
|
+
|
|
10
|
+
expect(<%= name.split('_').map(&:capitalize).join %>::Results.new.first_result).to include search_data.first_result
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
|
2
|
+
require "<%= name.downcase %>"
|
|
3
|
+
|
|
4
|
+
include <%= name.split('_').map(&:capitalize).join %>
|
|
5
|
+
|
|
6
|
+
RSpec.configure do |config|
|
|
7
|
+
config.before(:each) do
|
|
8
|
+
@browser = Watir::Browser.new
|
|
9
|
+
WatirDrops::PageObject.browser = @browser
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
config.after(:each) do
|
|
13
|
+
@browser.quit
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
sudo: required
|
|
2
|
+
dist: trusty
|
|
3
|
+
language: ruby
|
|
4
|
+
addons:
|
|
5
|
+
firefox: latest
|
|
6
|
+
rvm:
|
|
7
|
+
- 2.2.6
|
|
8
|
+
cache: bundler
|
|
9
|
+
before_script:
|
|
10
|
+
- export CHROME_BIN=/usr/bin/google-chrome
|
|
11
|
+
- export DISPLAY=:99.0
|
|
12
|
+
- sh -e /etc/init.d/xvfb start
|
|
13
|
+
- sudo apt-get update
|
|
14
|
+
- sudo apt-get install -y libappindicator1 fonts-liberation
|
|
15
|
+
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
16
|
+
- sudo dpkg -i google-chrome*.deb
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
require 'thor/group'
|
|
2
|
+
require 'git'
|
|
3
|
+
require 'active_support/inflector'
|
|
4
|
+
|
|
5
|
+
module WatirInstall
|
|
6
|
+
module Generators
|
|
7
|
+
class NewProject < Thor::Group
|
|
8
|
+
include Thor::Actions
|
|
9
|
+
|
|
10
|
+
argument :name, type: :string, desc: 'The name of the test project'
|
|
11
|
+
argument :no_git, type: :string, default: 'false', desc: 'Do not initialize project with git'
|
|
12
|
+
argument :test_runner, type: :string, default: 'rspec', desc: 'Specify RSpec or Cucumber'
|
|
13
|
+
|
|
14
|
+
def self.source_root
|
|
15
|
+
"#{File.dirname(__FILE__)}/new_project"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def git
|
|
19
|
+
@git ||= Git.init(name)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def user_name
|
|
23
|
+
@user_name ||= git.config["user.name"] if git?
|
|
24
|
+
@user_name ||= ask "Enter your Name: "
|
|
25
|
+
@git.config('user.name', @user_name) if git?
|
|
26
|
+
@user_name
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def user_email
|
|
30
|
+
@user_email ||= git.config["user.email"] if git?
|
|
31
|
+
@user_email ||= ask "Enter your Email: "
|
|
32
|
+
@git.config('user.email', @user_email) if git?
|
|
33
|
+
@user_email
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def root_files
|
|
37
|
+
template "gemfile.rb.tt", "#{name}/Gemfile"
|
|
38
|
+
template "gitignore.rb.tt", "#{name}/.gitignore"
|
|
39
|
+
template "license.rb.tt", "#{name}/LICENSE.txt"
|
|
40
|
+
template "rakefile.rb.tt", "#{name}/Rakefile"
|
|
41
|
+
template "readme.rb.tt", "#{name}/README.md"
|
|
42
|
+
template "ruby-version.rb.tt", "#{name}/.ruby-version"
|
|
43
|
+
template "travis.rb.tt", "#{name}/.travis.yml"
|
|
44
|
+
if test_runner == 'cucumber'
|
|
45
|
+
template "cucumber.yml.tt", "#{name}/.cucumber.yml"
|
|
46
|
+
else
|
|
47
|
+
template "rspec.rb.tt", "#{name}/.rspec"
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def lib_files
|
|
52
|
+
if test_runner == 'cucumber'
|
|
53
|
+
template "features/support/pages/home.rb.tt", "#{name}/features/support/pages/home.rb.rb"
|
|
54
|
+
template "features/support/pages/results.rb.tt", "#{name}/features/support/pages/results.rb"
|
|
55
|
+
else
|
|
56
|
+
template "lib/name.rb.tt", "#{name}/lib/#{name}.rb"
|
|
57
|
+
template "lib/pages/home.rb.tt", "#{name}/lib/#{name}/pages/home.rb"
|
|
58
|
+
template "lib/pages/results.rb.tt", "#{name}/lib/#{name}/pages/results.rb"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def data_files
|
|
63
|
+
if test_runner == 'cucumber'
|
|
64
|
+
template "config/data/data.yml.tt", "#{name}/config/data/data.yml"
|
|
65
|
+
else
|
|
66
|
+
template "lib/models/search.rb.tt", "#{name}/lib/#{name}/models/search.rb"
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def test_files
|
|
71
|
+
if test_runner == 'cucumber'
|
|
72
|
+
template "features/support/env.rb.tt", "#{name}/features/support/env.rb"
|
|
73
|
+
template "features/support/hooks.rb.tt", "#{name}/features/support/hooks.rb"
|
|
74
|
+
template "features/step_definitions/search_steps.rb.tt", "#{name}/features/step_definitions/search_steps.rb"
|
|
75
|
+
template "features/search.feature.tt", "#{name}/features/search.feature"
|
|
76
|
+
|
|
77
|
+
else
|
|
78
|
+
template "spec/search_spec.rb.tt", "#{name}/spec/search_spec.rb"
|
|
79
|
+
template "spec/spec_helper.rb.tt", "#{name}/spec/spec_helper.rb"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def bundle
|
|
84
|
+
Dir.chdir(name)
|
|
85
|
+
system 'bundle install'
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def initial_commit
|
|
89
|
+
if git?
|
|
90
|
+
git.lib.add('.', all: true)
|
|
91
|
+
git.commit("initial commit", {all: true})
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def git?
|
|
96
|
+
no_git != 'true'
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'watir_install/cli'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "watir_install"
|
|
7
|
+
spec.version = "0.2.1"
|
|
8
|
+
spec.authors = ["Titus Fortner"]
|
|
9
|
+
spec.email = ["titusfortner@gmail.com"]
|
|
10
|
+
|
|
11
|
+
spec.summary = %q{UI Test Automation Framework}
|
|
12
|
+
spec.description = %q{"Watir Framework provides everything necessary to quickly create maintainable automated test suites in an understandable and enjoyable way."}
|
|
13
|
+
spec.homepage = "https://github.com/titusfortner/watir_install"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
18
|
+
if spec.respond_to?(:metadata)
|
|
19
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
|
20
|
+
else
|
|
21
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
|
22
|
+
"public gem pushes."
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
26
|
+
f.match(%r{^(test|spec|features)/})
|
|
27
|
+
end
|
|
28
|
+
spec.bindir = "bin"
|
|
29
|
+
spec.executables = ['watir']
|
|
30
|
+
spec.require_paths = ["lib"]
|
|
31
|
+
|
|
32
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
|
33
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
34
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
35
|
+
|
|
36
|
+
spec.add_dependency 'thor', '~> 0.19.1'
|
|
37
|
+
spec.add_dependency 'selenium-webdriver', '~> 3.0', '>= 3.0.3'
|
|
38
|
+
spec.add_dependency "watir_drops", "~> 0.5"
|
|
39
|
+
spec.add_dependency 'watir_model', "~> 0.2"
|
|
40
|
+
spec.add_dependency "watir_session", "~> 0.2"
|
|
41
|
+
spec.add_dependency "git", "~> 1.3"
|
|
42
|
+
spec.add_dependency "webdrivers", "~> 2.3"
|
|
43
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: watir_install
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.2.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Titus Fortner
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-01-03 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.13'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.13'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: thor
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 0.19.1
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: 0.19.1
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: selenium-webdriver
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '3.0'
|
|
76
|
+
- - ">="
|
|
77
|
+
- !ruby/object:Gem::Version
|
|
78
|
+
version: 3.0.3
|
|
79
|
+
type: :runtime
|
|
80
|
+
prerelease: false
|
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
82
|
+
requirements:
|
|
83
|
+
- - "~>"
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: '3.0'
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: 3.0.3
|
|
89
|
+
- !ruby/object:Gem::Dependency
|
|
90
|
+
name: watir_drops
|
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - "~>"
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0.5'
|
|
96
|
+
type: :runtime
|
|
97
|
+
prerelease: false
|
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - "~>"
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '0.5'
|
|
103
|
+
- !ruby/object:Gem::Dependency
|
|
104
|
+
name: watir_model
|
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - "~>"
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0.2'
|
|
110
|
+
type: :runtime
|
|
111
|
+
prerelease: false
|
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "~>"
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0.2'
|
|
117
|
+
- !ruby/object:Gem::Dependency
|
|
118
|
+
name: watir_session
|
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "~>"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0.2'
|
|
124
|
+
type: :runtime
|
|
125
|
+
prerelease: false
|
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - "~>"
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '0.2'
|
|
131
|
+
- !ruby/object:Gem::Dependency
|
|
132
|
+
name: git
|
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - "~>"
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '1.3'
|
|
138
|
+
type: :runtime
|
|
139
|
+
prerelease: false
|
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
141
|
+
requirements:
|
|
142
|
+
- - "~>"
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: '1.3'
|
|
145
|
+
- !ruby/object:Gem::Dependency
|
|
146
|
+
name: webdrivers
|
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - "~>"
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: '2.3'
|
|
152
|
+
type: :runtime
|
|
153
|
+
prerelease: false
|
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
155
|
+
requirements:
|
|
156
|
+
- - "~>"
|
|
157
|
+
- !ruby/object:Gem::Version
|
|
158
|
+
version: '2.3'
|
|
159
|
+
description: '"Watir Framework provides everything necessary to quickly create maintainable
|
|
160
|
+
automated test suites in an understandable and enjoyable way."'
|
|
161
|
+
email:
|
|
162
|
+
- titusfortner@gmail.com
|
|
163
|
+
executables:
|
|
164
|
+
- watir
|
|
165
|
+
extensions: []
|
|
166
|
+
extra_rdoc_files: []
|
|
167
|
+
files:
|
|
168
|
+
- ".gitignore"
|
|
169
|
+
- ".rspec"
|
|
170
|
+
- ".ruby-version"
|
|
171
|
+
- ".travis.yml"
|
|
172
|
+
- CHANGES.md
|
|
173
|
+
- Gemfile
|
|
174
|
+
- LICENSE.txt
|
|
175
|
+
- README.md
|
|
176
|
+
- Rakefile
|
|
177
|
+
- bin/watir
|
|
178
|
+
- lib/watir_install.rb
|
|
179
|
+
- lib/watir_install/cli.rb
|
|
180
|
+
- lib/watir_install/generators/new_project.rb
|
|
181
|
+
- lib/watir_install/generators/new_project/config/data/data.yml.tt
|
|
182
|
+
- lib/watir_install/generators/new_project/cucumber.yml.tt
|
|
183
|
+
- lib/watir_install/generators/new_project/features/search.feature.tt
|
|
184
|
+
- lib/watir_install/generators/new_project/features/step_definitions/search_steps.rb.tt
|
|
185
|
+
- lib/watir_install/generators/new_project/features/support/env.rb.tt
|
|
186
|
+
- lib/watir_install/generators/new_project/features/support/hooks.rb.tt
|
|
187
|
+
- lib/watir_install/generators/new_project/features/support/pages/home.rb.tt
|
|
188
|
+
- lib/watir_install/generators/new_project/features/support/pages/results.rb.tt
|
|
189
|
+
- lib/watir_install/generators/new_project/gemfile.rb.tt
|
|
190
|
+
- lib/watir_install/generators/new_project/gitignore.rb.tt
|
|
191
|
+
- lib/watir_install/generators/new_project/lib/models/search.rb.tt
|
|
192
|
+
- lib/watir_install/generators/new_project/lib/name.rb.tt
|
|
193
|
+
- lib/watir_install/generators/new_project/lib/pages/home.rb.tt
|
|
194
|
+
- lib/watir_install/generators/new_project/lib/pages/results.rb.tt
|
|
195
|
+
- lib/watir_install/generators/new_project/license.rb.tt
|
|
196
|
+
- lib/watir_install/generators/new_project/rakefile.rb.tt
|
|
197
|
+
- lib/watir_install/generators/new_project/readme.rb.tt
|
|
198
|
+
- lib/watir_install/generators/new_project/rspec.rb.tt
|
|
199
|
+
- lib/watir_install/generators/new_project/ruby-version.rb.tt
|
|
200
|
+
- lib/watir_install/generators/new_project/spec/search_spec.rb.tt
|
|
201
|
+
- lib/watir_install/generators/new_project/spec/spec_helper.rb.tt
|
|
202
|
+
- lib/watir_install/generators/new_project/travis.rb.tt
|
|
203
|
+
- watir_install.gemspec
|
|
204
|
+
homepage: https://github.com/titusfortner/watir_install
|
|
205
|
+
licenses:
|
|
206
|
+
- MIT
|
|
207
|
+
metadata:
|
|
208
|
+
allowed_push_host: https://rubygems.org
|
|
209
|
+
post_install_message:
|
|
210
|
+
rdoc_options: []
|
|
211
|
+
require_paths:
|
|
212
|
+
- lib
|
|
213
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
|
+
requirements:
|
|
215
|
+
- - ">="
|
|
216
|
+
- !ruby/object:Gem::Version
|
|
217
|
+
version: '0'
|
|
218
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
|
+
requirements:
|
|
220
|
+
- - ">="
|
|
221
|
+
- !ruby/object:Gem::Version
|
|
222
|
+
version: '0'
|
|
223
|
+
requirements: []
|
|
224
|
+
rubyforge_project:
|
|
225
|
+
rubygems_version: 2.5.2
|
|
226
|
+
signing_key:
|
|
227
|
+
specification_version: 4
|
|
228
|
+
summary: UI Test Automation Framework
|
|
229
|
+
test_files: []
|