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 +4 -4
- data/.coveralls.yml +0 -0
- data/.gitignore +2 -0
- data/.travis.yml +0 -0
- data/Gemfile +1 -1
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/lib/symbiont/accessor.rb +0 -0
- data/lib/symbiont/assertions.rb +0 -0
- data/lib/symbiont/data_builder.rb +0 -0
- data/lib/symbiont/data_reader.rb +0 -0
- data/lib/symbiont/data_setter.rb +0 -0
- data/lib/symbiont/elements.rb +0 -0
- data/lib/symbiont/errors.rb +0 -0
- data/lib/symbiont/factory.rb +4 -1
- data/lib/symbiont/helpers.rb +0 -0
- data/lib/symbiont/pages.rb +0 -0
- data/lib/symbiont/version.rb +1 -1
- data/lib/symbiont.rb +15 -11
- data/spec/fixtures/default.yml +0 -0
- data/spec/fixtures/element_definitions.rb +0 -0
- data/spec/fixtures/mock_data.yml +0 -0
- data/spec/fixtures/mock_drivers.rb +0 -0
- data/spec/fixtures/page_definitions.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/symbiont/assertion_spec.rb +0 -0
- data/spec/symbiont/data_builder_spec.rb +0 -0
- data/spec/symbiont/data_setter_spec.rb +1 -1
- data/spec/symbiont/driver_spec.rb +1 -1
- data/spec/symbiont/element_spec.rb +0 -0
- data/spec/symbiont/factory_spec.rb +3 -0
- data/spec/symbiont/page_spec.rb +6 -6
- data/symbiont.gemspec +0 -0
- data/test/symbiont-script.rb +0 -0
- metadata +23 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f692e1b29e577731428b560d2ce89c4d87131ec8
|
4
|
+
data.tar.gz: 789b0574b2cc7d08128c26c22860941817709bda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 546437a61554e1ab5c2035b1de7b9c2093b882dcb5a8066639d7b9a32b01a55020278bae4133c17ada70a027e9f86077333ff8cb709b3d6fae2c873bd298fffd
|
7
|
+
data.tar.gz: bce7117fbaf58555ccfdef11ef85c60d87c5549a299a626689eba8e87357f0ba1af069f249d7ad76992fa443efd29c90fa8e5fb3afd4dda2490a0832babbad8c
|
data/.coveralls.yml
CHANGED
File without changes
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
File without changes
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/lib/symbiont/accessor.rb
CHANGED
File without changes
|
data/lib/symbiont/assertions.rb
CHANGED
File without changes
|
File without changes
|
data/lib/symbiont/data_reader.rb
CHANGED
File without changes
|
data/lib/symbiont/data_setter.rb
CHANGED
File without changes
|
data/lib/symbiont/elements.rb
CHANGED
File without changes
|
data/lib/symbiont/errors.rb
CHANGED
File without changes
|
data/lib/symbiont/factory.rb
CHANGED
@@ -24,13 +24,15 @@ module Symbiont
|
|
24
24
|
end
|
25
25
|
|
26
26
|
@page = definition.new(@browser)
|
27
|
-
@page.view if visit
|
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
|
data/lib/symbiont/helpers.rb
CHANGED
File without changes
|
data/lib/symbiont/pages.rb
CHANGED
File without changes
|
data/lib/symbiont/version.rb
CHANGED
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
|
51
|
-
def initialize(
|
52
|
-
Symbiont.trace("Symbiont attached to browser:\n\t#{
|
53
|
-
|
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
|
data/spec/fixtures/default.yml
CHANGED
File without changes
|
File without changes
|
data/spec/fixtures/mock_data.yml
CHANGED
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 '
|
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
|
-
|
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
|
data/spec/symbiont/page_spec.rb
CHANGED
@@ -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 '
|
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 '
|
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 '
|
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 '
|
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
|
data/test/symbiont-script.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
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:
|