watir_framework 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +8 -0
- data/bin/watir_framework +4 -0
- data/generators/new_project/generator.rb +61 -0
- data/generators/new_project/templates/gemfile.rb.erb +4 -0
- data/generators/new_project/templates/gemspec.rb.erb +29 -0
- data/generators/new_project/templates/gitignore.rb.erb +8 -0
- data/generators/new_project/templates/lib/name.rb.erb +7 -0
- data/generators/new_project/templates/lib/pages/home.rb.erb +15 -0
- data/generators/new_project/templates/lib/pages/results.rb.erb +12 -0
- data/generators/new_project/templates/license.rb.erb +21 -0
- data/generators/new_project/templates/rakefile.rb.erb +6 -0
- data/generators/new_project/templates/readme.rb.erb +41 -0
- data/generators/new_project/templates/rspec.rb.erb +2 -0
- data/generators/new_project/templates/spec/name_spec.rb.erb +17 -0
- data/generators/new_project/templates/spec/spec_helper.rb.erb +2 -0
- data/generators/new_project/templates/travis.rb.erb +5 -0
- data/lib/watir_framework.rb +3 -1
- data/lib/watir_framework/pages/home.rb +15 -0
- data/lib/watir_framework/pages/results.rb +12 -0
- data/watir_framework.gemspec +7 -4
- metadata +66 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a04bec43f576280c689bcf118f674b5f2d69021
|
4
|
+
data.tar.gz: 5b7bd9502e68bbeb3d3f2b22c32d88f7ced42c82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33ae4419caef017cf68036acb5ba65901bc3920f39472495418e1973c0cb496c69eee13365522405260c36cd8736e6ebe2881b81177078e900a4c3e3267bd4e6
|
7
|
+
data.tar.gz: 4aaa1dd67cb7523841c1fcb23753cd3068f56d8b26dcdf30c0f139f7bae631b25c335b794964bbcdae92c27c71c06c53e1df7b733a0ef363f8296c4a91d9113f
|
data/CHANGES.md
ADDED
data/bin/watir_framework
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
require 'git'
|
3
|
+
require 'active_support/inflector'
|
4
|
+
require "highline/import"
|
5
|
+
|
6
|
+
class NewProject < Thor::Group
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
argument :name, banner: 'creates new test project'
|
10
|
+
|
11
|
+
def self.source_root
|
12
|
+
File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
13
|
+
end
|
14
|
+
|
15
|
+
def git
|
16
|
+
@git ||= Git.init(name)
|
17
|
+
end
|
18
|
+
|
19
|
+
def user_name
|
20
|
+
# @user_name ||= git.config["user.name"]
|
21
|
+
return @user_name if @user_name
|
22
|
+
@user_name = ask "Enter your Name: "
|
23
|
+
@git.config('user.name', @user_name)
|
24
|
+
@user_name
|
25
|
+
end
|
26
|
+
|
27
|
+
def user_email
|
28
|
+
# @user_email ||= git.config["user.email"]
|
29
|
+
return @user_email if @user_email
|
30
|
+
@user_email = ask "Enter your Email: "
|
31
|
+
@git.config('user.email', @user_email)
|
32
|
+
@user_email
|
33
|
+
end
|
34
|
+
|
35
|
+
def root_files
|
36
|
+
template "gemfile.rb.erb", "#{name}/Gemfile"
|
37
|
+
template "gemspec.rb.erb", "#{name}/#{name}.gemspec"
|
38
|
+
template "gitignore.rb.erb", "#{name}/.gitignore"
|
39
|
+
template "license.rb.erb", "#{name}/LICENSE.txt"
|
40
|
+
template "rakefile.rb.erb", "#{name}/Rakefile"
|
41
|
+
template "readme.rb.erb", "#{name}/README.md"
|
42
|
+
template "rspec.rb.erb", "#{name}/.rspec"
|
43
|
+
template "travis.rb.erb", "#{name}/.travis.yml"
|
44
|
+
end
|
45
|
+
|
46
|
+
def lib_files
|
47
|
+
template "lib/name.rb.erb", File.join(name, "lib", "#{name}.rb")
|
48
|
+
template "lib/pages/home.rb.erb", File.join(name, "lib", name, "pages", "home.rb")
|
49
|
+
template "lib/pages/results.rb.erb", File.join(name, "lib", name, "pages", "results.rb")
|
50
|
+
end
|
51
|
+
|
52
|
+
def spec_files
|
53
|
+
template "spec/name_spec.rb.erb", File.join(name, "spec", "#{name}_spec.rb")
|
54
|
+
template "spec/spec_helper.rb.erb", File.join(name, "spec", "spec_helper.rb")
|
55
|
+
end
|
56
|
+
|
57
|
+
def initial_commit
|
58
|
+
git.lib.add('.', all: true)
|
59
|
+
git.commit("initial commit", {all: true})
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,29 @@
|
|
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 = "<%= name.downcase %>"
|
7
|
+
spec.version = "0.1"
|
8
|
+
spec.authors = ["<%= user_name %>}"]
|
9
|
+
spec.email = ["<%= user_email %>"]
|
10
|
+
|
11
|
+
spec.summary = "Write a short summary, because Rubygems requires one."
|
12
|
+
spec.description = "Write a longer description or delete this line."
|
13
|
+
spec.homepage = "TODO: Put your project's website or public repo URL here."
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
spec.bindir = "bin"
|
20
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
|
27
|
+
spec.add_development_dependency "watir", "~> 6.0"
|
28
|
+
spec.add_development_dependency "watir_drops", "~> 0.5.0"
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module <%= name.capitalize %>
|
2
|
+
class Home < WatirDrops::PageObject
|
3
|
+
|
4
|
+
element(:signup) { browser.text_field(name: 'q')}
|
5
|
+
element(:submit) { browser.button(name: 'btnG') }
|
6
|
+
|
7
|
+
page_url { 'https://www.google.com' }
|
8
|
+
|
9
|
+
def search(string)
|
10
|
+
self.signup = string
|
11
|
+
submit.click
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) <%= user_name %> 2016
|
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,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,17 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe <%= name.capitalize %> do
|
4
|
+
it "starts a driver" do
|
5
|
+
browser = Watir::Browser.new
|
6
|
+
expect(browser.window).to exist
|
7
|
+
browser.quit
|
8
|
+
end
|
9
|
+
|
10
|
+
it "submits a search" do
|
11
|
+
WatirDrops::PageObject.browser = Watir::Browser.new
|
12
|
+
search_page = <%= name.capitalize %>::Home.visit
|
13
|
+
search_page.search('Foo')
|
14
|
+
expect(<%= name.capitalize %>::Results.new.first_result).to include "Foobar - Wikipedia"
|
15
|
+
WatirDrops::PageObject.browser.quit
|
16
|
+
end
|
17
|
+
end
|
data/lib/watir_framework.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
module WatirFramework
|
2
|
+
class Home < WatirDrops::PageObject
|
3
|
+
|
4
|
+
element(:signup) { browser.text_field(name: 'q')}
|
5
|
+
element(:submit) { browser.button(name: 'btnG') }
|
6
|
+
|
7
|
+
page_url { 'https://www.google.com' }
|
8
|
+
|
9
|
+
def search(string)
|
10
|
+
self.signup = string
|
11
|
+
submit.click
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
data/watir_framework.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "watir_framework"
|
7
|
-
spec.version = 0.1
|
7
|
+
spec.version = "0.1.1"
|
8
8
|
spec.authors = ["Titus Fortner"]
|
9
9
|
spec.email = ["titusfortner@gmail.com"]
|
10
10
|
|
@@ -25,13 +25,16 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
26
26
|
f.match(%r{^(test|spec|features)/})
|
27
27
|
end
|
28
|
-
spec.bindir = "
|
29
|
-
spec.executables =
|
28
|
+
spec.bindir = "bin"
|
29
|
+
spec.executables = 'watir_framework'
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 1.13"
|
33
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
34
|
spec.add_development_dependency "rspec", "~> 3.0"
|
35
35
|
|
36
|
-
spec.
|
36
|
+
spec.add_dependency('thor', '~> 0.19.1')
|
37
|
+
spec.add_dependency "watir", "~> 6.0"
|
38
|
+
spec.add_dependency "watir_drops", "~> 0.5.0"
|
39
|
+
spec.add_dependency "git", "~> 1.3.0"
|
37
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Fortner
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
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
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: watir
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,29 +73,76 @@ dependencies:
|
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '6.0'
|
62
|
-
type: :
|
76
|
+
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '6.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: watir_drops
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.5.0
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.5.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: git
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.3.0
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.3.0
|
69
111
|
description: '"Watir Framework provides everything necessary to quickly create maintainable
|
70
112
|
automated test suites in an understandable and enjoyable way."'
|
71
113
|
email:
|
72
114
|
- titusfortner@gmail.com
|
73
|
-
executables:
|
115
|
+
executables:
|
116
|
+
- watir_framework
|
74
117
|
extensions: []
|
75
118
|
extra_rdoc_files: []
|
76
119
|
files:
|
77
120
|
- ".gitignore"
|
78
121
|
- ".rspec"
|
79
122
|
- ".travis.yml"
|
123
|
+
- CHANGES.md
|
80
124
|
- Gemfile
|
81
125
|
- LICENSE.txt
|
82
126
|
- README.md
|
83
127
|
- Rakefile
|
128
|
+
- bin/watir_framework
|
129
|
+
- generators/new_project/generator.rb
|
130
|
+
- generators/new_project/templates/gemfile.rb.erb
|
131
|
+
- generators/new_project/templates/gemspec.rb.erb
|
132
|
+
- generators/new_project/templates/gitignore.rb.erb
|
133
|
+
- generators/new_project/templates/lib/name.rb.erb
|
134
|
+
- generators/new_project/templates/lib/pages/home.rb.erb
|
135
|
+
- generators/new_project/templates/lib/pages/results.rb.erb
|
136
|
+
- generators/new_project/templates/license.rb.erb
|
137
|
+
- generators/new_project/templates/rakefile.rb.erb
|
138
|
+
- generators/new_project/templates/readme.rb.erb
|
139
|
+
- generators/new_project/templates/rspec.rb.erb
|
140
|
+
- generators/new_project/templates/spec/name_spec.rb.erb
|
141
|
+
- generators/new_project/templates/spec/spec_helper.rb.erb
|
142
|
+
- generators/new_project/templates/travis.rb.erb
|
84
143
|
- lib/watir_framework.rb
|
144
|
+
- lib/watir_framework/pages/home.rb
|
145
|
+
- lib/watir_framework/pages/results.rb
|
85
146
|
- watir_framework.gemspec
|
86
147
|
homepage: https://github.com/titusfortner/watir_framework
|
87
148
|
licenses:
|