symbiont 0.8.0 → 0.9.0

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: f0d743af01968067b8d47f402817f4958ccb3e43
4
- data.tar.gz: db46be1f58ed30af742038e4e47a54ed0d4a1eeb
3
+ metadata.gz: f692e1b29e577731428b560d2ce89c4d87131ec8
4
+ data.tar.gz: 789b0574b2cc7d08128c26c22860941817709bda
5
5
  SHA512:
6
- metadata.gz: b2a68b9558ba508248101eaff5034998021ed029bdcce64040c9050ae5e055d0ffb48ee9bc1ff16908e52bcfce7bcc12ef9c0ed3f0bca837b9485c52f24e5bbb
7
- data.tar.gz: e92524a6df1e92b75de5f6734837391fcf9b54e4b9fcddb953e7275ae3fef16ef2570506b4223c7a862706c1ab331f86aa0115e1f38fceec452d1dd0e4050f46
6
+ metadata.gz: 546437a61554e1ab5c2035b1de7b9c2093b882dcb5a8066639d7b9a32b01a55020278bae4133c17ada70a027e9f86077333ff8cb709b3d6fae2c873bd298fffd
7
+ data.tar.gz: bce7117fbaf58555ccfdef11ef85c60d87c5549a299a626689eba8e87357f0ba1af069f249d7ad76992fa443efd29c90fa8e5fb3afd4dda2490a0832babbad8c
data/.coveralls.yml CHANGED
File without changes
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  *.rbc
3
+ .idea
3
4
  .bundle
4
5
  .config
5
6
  .yardoc
@@ -20,3 +21,4 @@ tmp
20
21
  *.o
21
22
  *.a
22
23
  mkmf.log
24
+ .DS_Store
data/.travis.yml CHANGED
File without changes
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'simplecov', '~> 0.8.0'
3
+ gem 'simplecov', '~> 0.9.0', require: false
4
4
  gem 'coveralls', require: false
5
5
 
6
6
  gemspec
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -24,13 +24,15 @@ module Symbiont
24
24
  end
25
25
 
26
26
  @page = definition.new(@browser)
27
- @page.view if visit == true
27
+ @page.view if visit
28
28
 
29
29
  @page.has_correct_url? if @page.respond_to?(:url_matches)
30
30
  @page.has_correct_title? if @page.respond_to?(:title_is)
31
31
 
32
32
  block.call @page if block
33
33
 
34
+ @model = @page
35
+
34
36
  @page
35
37
  end
36
38
 
@@ -58,6 +60,7 @@ module Symbiont
58
60
  # @return [Object] instance of the definition
59
61
  def on_new(definition, &block)
60
62
  @page = nil
63
+ @model = nil
61
64
 
62
65
  if @context.kind_of?(definition)
63
66
  @context = nil
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Symbiont
2
- VERSION = '0.8.0'
2
+ VERSION = '0.9.0'
3
3
  end
data/lib/symbiont.rb CHANGED
@@ -19,13 +19,6 @@ require 'symbiont/data_setter'
19
19
  require 'symbiont/data_builder'
20
20
 
21
21
  module Symbiont
22
- # The included callback is used to provide the core functionality of the
23
- # library to any class or module that includes the Symbiont library. The
24
- # calling class or module is extended with logic that the library makes
25
- # available as class methods. Any such class or module becomes a page or
26
- # activity definition. The class methods allow assertions and element
27
- # defintions to be defined.
28
- #
29
22
  # @param caller [Class] the class including the framework
30
23
  def self.included(caller)
31
24
  caller.extend Symbiont::Assertion
@@ -43,14 +36,24 @@ module Symbiont
43
36
  def self.trace(message, level = 1)
44
37
  puts '*' * level + " #{message}" if ENV['SYMBIONT_TRACE'] == 'on'
45
38
  end
39
+
40
+ def self.driver=(browser)
41
+ @browser = browser
42
+ end
43
+
44
+ def self.driver
45
+ @browser
46
+ end
46
47
 
47
48
  # @return [Object] browser driver reference
48
49
  attr_reader :browser
49
50
 
50
- # @param driver [Object] a tool driver instance
51
- def initialize(driver)
52
- Symbiont.trace("Symbiont attached to browser:\n\t#{driver.inspect}")
53
- @browser = driver
51
+ # @param browser [Object] a tool driver instance
52
+ def initialize(browser=nil)
53
+ Symbiont.trace("Symbiont attached to browser:\n\t#{browser.inspect}")
54
+
55
+ @browser = Symbiont.driver unless Symbiont.driver.nil?
56
+ @browser = browser if Symbiont.driver.nil?
54
57
 
55
58
  initialize_page if respond_to?(:initialize_page)
56
59
  initialize_activity if respond_to?(:initialize_activity)
@@ -63,6 +66,7 @@ end
63
66
 
64
67
  def symbiont_browser(browser=:firefox)
65
68
  @browser = Watir::Browser.new browser
69
+ Symbiont.driver = @browser
66
70
  end
67
71
 
68
72
  alias :symbiont_browser_for :symbiont_browser
File without changes
File without changes
File without changes
File without changes
File without changes
data/spec/spec_helper.rb CHANGED
File without changes
File without changes
File without changes
@@ -11,7 +11,7 @@ describe Symbiont::DataSetter do
11
11
  watir_definition.using(:text_field => 'works')
12
12
  end
13
13
 
14
- it 'allows methods to be chained' do
14
+ it 'will allow methods to be chained' do
15
15
  expect('testing'.call_method_chain("reverse.capitalize")).to eq('Gnitset')
16
16
  expect('testing'.call_method_chain("start_with?", 't')).to be_truthy
17
17
  end
@@ -5,7 +5,7 @@ describe 'Symbiont Driver' do
5
5
 
6
6
  context 'a symbiont driver is requested' do
7
7
  it 'will provide the default browser' do
8
- expect(Watir::Browser).to receive(:new).once.and_return(watir_browser)
8
+ allow(Watir::Browser).to receive(:new).and_return(Symbiont.driver)
9
9
  symbiont_browser
10
10
  end
11
11
  end
File without changes
@@ -57,6 +57,9 @@ describe Symbiont::Factory do
57
57
  page = @factory.on ValidPage
58
58
  current = @factory.instance_variable_get '@page'
59
59
  expect(current).to be(page)
60
+
61
+ current = @factory.instance_variable_get '@model'
62
+ expect(current).to be(page)
60
63
  end
61
64
 
62
65
  it 'will use an existing object reference with on_set' do
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Symbiont::Page do
4
4
  include_context :page
5
5
  include_context :element
6
-
6
+
7
7
  context 'a page definition being used - url' do
8
8
  it 'will establish no default url' do
9
9
  expect(empty_definition.asserted_url).to be_nil
@@ -19,7 +19,7 @@ describe Symbiont::Page do
19
19
  end
20
20
  end
21
21
 
22
- context 'a page definition being used - url match' do
22
+ context 'a page definition being used - url match' do
23
23
  it 'will establish no default url matcher' do
24
24
  expect(empty_definition.url_match).to be_nil
25
25
  end
@@ -105,7 +105,7 @@ describe Symbiont::Page do
105
105
  expect(watir_definition.execute_script('return document.activeElement')).to eq('input')
106
106
  end
107
107
 
108
- it 'should run a script, with arguments, against the browser' do
108
+ it 'will run a script, with arguments, against the browser' do
109
109
  expect(watir_browser).to receive(:execute_script).with('return arguments[0].innerHTML', watir_element).and_return('testing')
110
110
  expect(watir_definition.execute_script('return arguments[0].innerHTML', watir_element)).to eq('testing')
111
111
  end
@@ -157,19 +157,19 @@ describe Symbiont::Page do
157
157
  watir_definition.will_prompt('Testing') {}
158
158
  end
159
159
 
160
- it 'should be able to attach to a window by using the title' do
160
+ it 'will be able to attach to a window by using the title' do
161
161
  allow(watir_browser).to receive(:window).with(:title => /Display\ Results/).and_return(watir_browser)
162
162
  allow(watir_browser).to receive(:use)
163
163
  watir_definition.within_window(title: 'Display Results')
164
164
  end
165
165
 
166
- it 'should be able to attach to a window by using the url' do
166
+ it 'will be able to attach to a window by using the url' do
167
167
  allow(watir_browser).to receive(:window).with(:url => /results\.html/).and_return(watir_browser)
168
168
  allow(watir_browser).to receive(:use)
169
169
  watir_definition.within_window(url: 'results.html')
170
170
  end
171
171
 
172
- it 'should be able to convert a modal popup to a window' do
172
+ it 'will be able to convert a modal popup to a window' do
173
173
  allow(watir_browser).to receive(:execute_script)
174
174
  watir_definition.within_modal {}
175
175
  end
data/symbiont.gemspec CHANGED
File without changes
File without changes
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symbiont
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Nyman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-25 00:00:00.000000000 Z
11
+ date: 2014-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: colorize
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.7'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.7'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: watir-webdriver
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.6'
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
82
  version: '0.6'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: watir-dom-wait
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
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
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: watir-scroll
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: "\n Symbiont is a framework that allows you to describe your application
@@ -123,9 +123,9 @@ executables: []
123
123
  extensions: []
124
124
  extra_rdoc_files: []
125
125
  files:
126
- - .coveralls.yml
127
- - .gitignore
128
- - .travis.yml
126
+ - ".coveralls.yml"
127
+ - ".gitignore"
128
+ - ".travis.yml"
129
129
  - Gemfile
130
130
  - LICENSE.txt
131
131
  - README.md
@@ -162,24 +162,24 @@ licenses:
162
162
  - MIT
163
163
  metadata: {}
164
164
  post_install_message: "\n(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n
165
- \ Symbiont 0.8.0 has been installed.\n\n(::) (::) (::) (::) (::) (::) (::) (::)
165
+ \ Symbiont 0.9.0 has been installed.\n\n(::) (::) (::) (::) (::) (::) (::) (::)
166
166
  (::) (::) (::) (::)\n "
167
167
  rdoc_options: []
168
168
  require_paths:
169
169
  - lib
170
170
  required_ruby_version: !ruby/object:Gem::Requirement
171
171
  requirements:
172
- - - '>='
172
+ - - ">="
173
173
  - !ruby/object:Gem::Version
174
174
  version: '2.0'
175
175
  required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - '>='
177
+ - - ">="
178
178
  - !ruby/object:Gem::Version
179
179
  version: 1.8.29
180
180
  requirements: []
181
181
  rubyforge_project:
182
- rubygems_version: 2.0.14
182
+ rubygems_version: 2.2.2
183
183
  signing_key:
184
184
  specification_version: 4
185
185
  summary: An Endosymbiotic Facultative Semantically Clean Fluent Interface Test Framework
@@ -198,4 +198,3 @@ test_files:
198
198
  - spec/symbiont/factory_spec.rb
199
199
  - spec/symbiont/page_spec.rb
200
200
  - test/symbiont-script.rb
201
- has_rdoc: