watir_framework 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a04bec43f576280c689bcf118f674b5f2d69021
4
- data.tar.gz: 5b7bd9502e68bbeb3d3f2b22c32d88f7ced42c82
3
+ metadata.gz: f75e417376c42e17aceb46741ecbf0a269990e41
4
+ data.tar.gz: 177b5929e5944b1b27807b239f628a015a386272
5
5
  SHA512:
6
- metadata.gz: 33ae4419caef017cf68036acb5ba65901bc3920f39472495418e1973c0cb496c69eee13365522405260c36cd8736e6ebe2881b81177078e900a4c3e3267bd4e6
7
- data.tar.gz: 4aaa1dd67cb7523841c1fcb23753cd3068f56d8b26dcdf30c0f139f7bae631b25c335b794964bbcdae92c27c71c06c53e1df7b733a0ef363f8296c4a91d9113f
6
+ metadata.gz: 6a901075c375554f5da0d0eabd06e78ad8706a35bfd616935ab2874b22d10681b34934cc906cb6806bb9347f7278738562bdbd02e762751a4ea7a178b3d3fc48
7
+ data.tar.gz: 3d9aa33920a9887d1c5a536857a1439ba4a8c9c28850c7d73a1f4e7cedc788901963461b0c26530c372d670ff38b018b3b538d37e7a9532db79a19d5494595de
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.1.2 (2016-11-15)
2
+
3
+ * Support Watir Model
4
+
1
5
  ### 0.1.1 (2016-11-14)
2
6
 
3
7
  * Support Watir Drops
@@ -17,7 +17,7 @@ class NewProject < Thor::Group
17
17
  end
18
18
 
19
19
  def user_name
20
- # @user_name ||= git.config["user.name"]
20
+ @user_name ||= git.config["user.name"]
21
21
  return @user_name if @user_name
22
22
  @user_name = ask "Enter your Name: "
23
23
  @git.config('user.name', @user_name)
@@ -25,7 +25,7 @@ class NewProject < Thor::Group
25
25
  end
26
26
 
27
27
  def user_email
28
- # @user_email ||= git.config["user.email"]
28
+ @user_email ||= git.config["user.email"]
29
29
  return @user_email if @user_email
30
30
  @user_email = ask "Enter your Email: "
31
31
  @git.config('user.email', @user_email)
@@ -47,6 +47,7 @@ class NewProject < Thor::Group
47
47
  template "lib/name.rb.erb", File.join(name, "lib", "#{name}.rb")
48
48
  template "lib/pages/home.rb.erb", File.join(name, "lib", name, "pages", "home.rb")
49
49
  template "lib/pages/results.rb.erb", File.join(name, "lib", name, "pages", "results.rb")
50
+ template "lib/models/search.rb.erb", File.join(name, "lib", name, "models", "search.rb")
50
51
  end
51
52
 
52
53
  def spec_files
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_development_dependency "watir", "~> 6.0"
28
28
  spec.add_development_dependency "watir_drops", "~> 0.5.0"
29
+ spec.add_development_dependency "watir_model"
29
30
  end
@@ -0,0 +1,10 @@
1
+ module <%= name.capitalize %>
2
+ module Model
3
+ class Search < WatirModel
4
+
5
+ key(:search_term) { 'foo' }
6
+ key(:first_result) { 'Foobar - Wikipedia' }
7
+
8
+ end
9
+ end
10
+ end
@@ -1,6 +1,8 @@
1
1
  require "watir_drops"
2
+ require "watir_model"
2
3
  require '<%= name.downcase %>/pages/home'
3
4
  require '<%= name.downcase %>/pages/results'
5
+ require '<%= name.downcase %>/models/search'
4
6
 
5
7
  module <%= name.capitalize %>
6
8
  # Your code goes here...
@@ -1,13 +1,13 @@
1
1
  module <%= name.capitalize %>
2
2
  class Home < WatirDrops::PageObject
3
3
 
4
- element(:signup) { browser.text_field(name: 'q')}
4
+ element(:search_term) { browser.text_field(name: 'q')}
5
5
  element(:submit) { browser.button(name: 'btnG') }
6
6
 
7
7
  page_url { 'https://www.google.com' }
8
8
 
9
- def search(string)
10
- self.signup = string
9
+ def search(data)
10
+ fill_form(data)
11
11
  submit.click
12
12
  end
13
13
 
@@ -8,10 +8,11 @@ describe <%= name.capitalize %> do
8
8
  end
9
9
 
10
10
  it "submits a search" do
11
+ search_data = <%= name.capitalize %>::Model::Search.new
11
12
  WatirDrops::PageObject.browser = Watir::Browser.new
12
13
  search_page = <%= name.capitalize %>::Home.visit
13
- search_page.search('Foo')
14
- expect(<%= name.capitalize %>::Results.new.first_result).to include "Foobar - Wikipedia"
14
+ search_page.search(search_data)
15
+ expect(<%= name.capitalize %>::Results.new.first_result).to include search_data.first_result
15
16
  WatirDrops::PageObject.browser.quit
16
17
  end
17
18
  end
@@ -0,0 +1,10 @@
1
+ module WatirFramework
2
+ module Model
3
+ class Search < WatirModel
4
+
5
+ key(:search_term) { 'foo' }
6
+ key(:first_result) { 'Foobar - Wikipedia' }
7
+
8
+ end
9
+ end
10
+ end
@@ -1,13 +1,13 @@
1
1
  module WatirFramework
2
2
  class Home < WatirDrops::PageObject
3
3
 
4
- element(:signup) { browser.text_field(name: 'q')}
4
+ element(:search_term) { browser.text_field(name: 'q')}
5
5
  element(:submit) { browser.button(name: 'btnG') }
6
6
 
7
7
  page_url { 'https://www.google.com' }
8
8
 
9
- def search(string)
10
- self.signup = string
9
+ def search(data)
10
+ fill_form(data)
11
11
  submit.click
12
12
  end
13
13
 
@@ -1,6 +1,8 @@
1
1
  require "watir_drops"
2
+ require "watir_model"
2
3
  require 'watir_framework/pages/home'
3
4
  require 'watir_framework/pages/results'
5
+ require 'watir_framework/models/search'
4
6
 
5
7
  module WatirFramework
6
8
  # Your code goes here...
@@ -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.1"
7
+ spec.version = "0.1.2"
8
8
  spec.authors = ["Titus Fortner"]
9
9
  spec.email = ["titusfortner@gmail.com"]
10
10
 
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "rspec", "~> 3.0"
35
35
 
36
36
  spec.add_dependency('thor', '~> 0.19.1')
37
- spec.add_dependency "watir", "~> 6.0"
38
37
  spec.add_dependency "watir_drops", "~> 0.5.0"
38
+ spec.add_dependency "watir_model"
39
39
  spec.add_dependency "git", "~> 1.3.0"
40
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: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-15 00:00:00.000000000 Z
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,33 +67,33 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.19.1
69
69
  - !ruby/object:Gem::Dependency
70
- name: watir
70
+ name: watir_drops
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '6.0'
75
+ version: 0.5.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '6.0'
82
+ version: 0.5.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: watir_drops
84
+ name: watir_model
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.5.0
89
+ version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.5.0
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: git
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -130,6 +130,7 @@ files:
130
130
  - generators/new_project/templates/gemfile.rb.erb
131
131
  - generators/new_project/templates/gemspec.rb.erb
132
132
  - generators/new_project/templates/gitignore.rb.erb
133
+ - generators/new_project/templates/lib/models/search.rb.erb
133
134
  - generators/new_project/templates/lib/name.rb.erb
134
135
  - generators/new_project/templates/lib/pages/home.rb.erb
135
136
  - generators/new_project/templates/lib/pages/results.rb.erb
@@ -141,6 +142,7 @@ files:
141
142
  - generators/new_project/templates/spec/spec_helper.rb.erb
142
143
  - generators/new_project/templates/travis.rb.erb
143
144
  - lib/watir_framework.rb
145
+ - lib/watir_framework/models/search.rb
144
146
  - lib/watir_framework/pages/home.rb
145
147
  - lib/watir_framework/pages/results.rb
146
148
  - watir_framework.gemspec