symbiont 1.1.2 → 1.2.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: fdb3287f23af4a662a33dfd6351d6129b20d19b2
4
- data.tar.gz: 6b66f2115cee8781b5773bf74d90bf362bafea9a
3
+ metadata.gz: edf424efc47090510c1a93fa282073824f2324e3
4
+ data.tar.gz: 73823dbbad9c776ded4e86d1b280c3145d614f59
5
5
  SHA512:
6
- metadata.gz: 475bfa38a2b1dd521164320c130a87a6e6759f78265860e3741e5d957665bb37fe39254cd2bfb9836c800cfce3da38e8401a55fd665c5a6441c84018385e0a45
7
- data.tar.gz: f6b8720a29cb164f1c2b7450f3373742962cd63b190b282c46f4462366d9dcbd5610bb80dd6f5087c7e1294cb756c1198ff435b3c6f83dc8278b6032c8e1d21b
6
+ metadata.gz: 2067064fdd4ef6dd5290baeafc51fa2d34ead66bc884e5b89e4b75c50f2ce5d33d28cb3d92798a5ae1f647edc9f392c4cdc74032a60225dbe574d3c8dc1d1e3e
7
+ data.tar.gz: a72afebb4c23e107039b30a41590f9c099e47bf5aacb5a68e2e37fa9a6edef91628b61b36d783af1fb7caf4f47103d0c873742c3109abe526d7dae9a74c2b286
data/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # Symbiont
2
2
 
3
- [![Build Status](https://travis-ci.org/jnyman/symbiont.svg)](https://travis-ci.org/jnyman/symbiont)
4
3
  [![Gem Version](https://badge.fury.io/rb/symbiont.svg)](http://badge.fury.io/rb/symbiont)
4
+ [![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jnyman/symbiont/blob/master/LICENSE.txt)
5
+
6
+ [![Build Status](https://travis-ci.org/jnyman/symbiont.svg)](https://travis-ci.org/jnyman/symbiont)
5
7
  [![Dependency Status](https://gemnasium.com/jnyman/symbiont.png)](https://gemnasium.com/jnyman/symbiont)
6
8
  [![Code Climate](https://codeclimate.com/github/jnyman/symbiont/badges/gpa.svg)](https://codeclimate.com/github/jnyman/symbiont)
7
-
8
- Symbiont provides a semantic domain-specific language that can be used to construct a fluent interface for test execution libraries. The initial focus will be on using the [watir-webdriver](https://github.com/watir/watir-webdriver) API as the underlying driver library.
9
-
10
9
  [![Gitter chat](https://badges.gitter.im/jnyman/symbiont.png)](https://gitter.im/jnyman/symbiont)
11
- [![endorse](https://api.coderwall.com/jnyman/endorsecount.png)](https://coderwall.com/jnyman)
10
+
11
+ Symbiont provides a semantic domain-specific language that can be used to construct a fluent interface for test execution libraries. The initial focus will be on using the [watir-webdriver](https://github.com/watir/watir-webdriver) API as the underlying driver library.
12
12
 
13
13
  ## What is this?
14
14
 
@@ -20,7 +20,6 @@ In terms of what Symbiont does, it provides a way to describe your application i
20
20
 
21
21
  The DSL provides a fluent interface that can be used for constructing test execution logic. This fluent interface promotes the idea of compressibility of your test logic, allowing for more factoring, more reuse, and less repetition.
22
22
 
23
-
24
23
  ## Installation
25
24
 
26
25
  To get the latest stable release, add this line to your application's Gemfile:
@@ -45,9 +44,10 @@ You can also install Symbiont just as you would any other gem:
45
44
 
46
45
  To learn how to use the framework, you can check out my [blog posts on Symbiont](http://testerstories.com/category/symbiont/) and for the most up to date information, you can check out the [Symbiont Wiki](https://github.com/jnyman/symbiont/wiki).
47
46
 
48
- You can check out the [Symbiont test script](https://github.com/jnyman/symbiont/blob/master/test/symbiont-script.rb) for an idea of how the library can be interacted with. Do note that the test script requires a local copy of [Symbiote](https://github.com/jnyman/symbiote) to be running. To execute the test script:
47
+ You can check out the [Symbiont Watir test script](https://github.com/jnyman/symbiont/blob/master/test/symbiont-with-watir.rb) or the [Symbiont Capybara test script](https://github.com/jnyman/symbiont/blob/master/test/symbiont-with-capybara.rb) for an idea of how the library can be interacted with. Do note that the test scripts will use my [Decohere](http://decohere.herokuapp.com/) web application. To execute the test scripts, do one of the following:
49
48
 
50
- $ rake test:script
49
+ $ rake scripts:watir
50
+ $ rake scripts:capybara
51
51
 
52
52
  ## Why call it Symbiont?
53
53
 
@@ -29,9 +29,15 @@ module Symbiont
29
29
  caller.extend Symbiont::Assertion
30
30
  caller.extend Symbiont::Elements
31
31
  caller.send :include, Symbiont::Pages
32
+ caller.send :include, Symbiont::Ready
32
33
  caller.send :include, Symbiont::Accessor
33
34
  caller.send :include, Symbiont::DataSetter
34
35
  caller.send :include, Symbiont::DataBuilder
36
+
37
+ caller.page_ready do
38
+ [displayed?, "Expected #{current_url} to match #{url_match} but it did not."]
39
+ end
40
+
35
41
  Symbiont.trace("#{caller.class} #{caller} has attached the Symbiont.")
36
42
  end
37
43
 
@@ -60,7 +66,7 @@ Capybara: #{Gem.loaded_specs['capybara'].version}
60
66
  attr_reader :browser
61
67
 
62
68
  # @param browser [Object] a tool driver instance
63
- def initialize(browser = nil)
69
+ def initialize(browser = nil, &block)
64
70
  Symbiont.trace("Symbiont attached to browser:\n\t#{browser.inspect}")
65
71
 
66
72
  @browser = Symbiont.browser unless Symbiont.browser.nil?
@@ -68,6 +74,8 @@ Capybara: #{Gem.loaded_specs['capybara'].version}
68
74
 
69
75
  initialize_page if respond_to?(:initialize_page)
70
76
  initialize_activity if respond_to?(:initialize_activity)
77
+
78
+ instance_eval(&block) if block
71
79
  end
72
80
 
73
81
  def self.set_browser(app = :firefox, *args)
@@ -118,3 +126,9 @@ module Watir
118
126
  alias_method :chosen?, :set?
119
127
  end
120
128
  end
129
+
130
+ module Watir
131
+ class TextField
132
+ alias_method :enter, :set
133
+ end
134
+ end
@@ -3,7 +3,11 @@ module Symbiont
3
3
  # @param element [Symbol] name of Watir-based object
4
4
  # @param locator [Hash] locators for referencing the element
5
5
  def reference_element(element, locator)
6
- browser.send(element, *locator)
6
+ begin
7
+ browser.send(element, *locator).to_subtype
8
+ rescue NoMethodError
9
+ browser.send(element, *locator)
10
+ end
7
11
  end
8
12
  end
9
13
  end
@@ -2,7 +2,7 @@ require 'capybara'
2
2
  require 'capybara/dsl'
3
3
 
4
4
  require 'symbiont/capybara/element'
5
- require 'symbiont/capybara/ready'
5
+ require 'symbiont/ready'
6
6
 
7
7
  module Symbiont
8
8
  class Page
@@ -1,13 +1,20 @@
1
+ require 'symbiont/ready'
2
+
1
3
  module Symbiont
2
4
  module Pages
3
5
  include Helpers
4
6
 
5
- def view
7
+ def view(&block)
6
8
  no_url_is_provided if asserted_url.nil?
7
9
  browser.goto(asserted_url)
10
+ when_ready(&block) if block_given?
8
11
  self
9
12
  end
10
13
 
14
+ def perform
15
+ view
16
+ end
17
+
11
18
  def has_correct_url?
12
19
  no_url_matches_is_provided if url_match.nil?
13
20
  !(browser.url =~ url_match).nil?
@@ -1,3 +1,3 @@
1
1
  module Symbiont
2
- VERSION = '1.1.2'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symbiont
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Nyman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-31 00:00:00.000000000 Z
11
+ date: 2016-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -216,7 +216,6 @@ files:
216
216
  - lib/symbiont/assertions.rb
217
217
  - lib/symbiont/capybara/element.rb
218
218
  - lib/symbiont/capybara/page.rb
219
- - lib/symbiont/capybara/ready.rb
220
219
  - lib/symbiont/capybara/region.rb
221
220
  - lib/symbiont/data_builder.rb
222
221
  - lib/symbiont/data_reader.rb
@@ -226,6 +225,7 @@ files:
226
225
  - lib/symbiont/factory.rb
227
226
  - lib/symbiont/helpers.rb
228
227
  - lib/symbiont/pages.rb
228
+ - lib/symbiont/ready.rb
229
229
  - lib/symbiont/service_objects.rb
230
230
  - lib/symbiont/soap_methods.rb
231
231
  - lib/symbiont/version.rb
@@ -235,7 +235,7 @@ licenses:
235
235
  - MIT
236
236
  metadata: {}
237
237
  post_install_message: "\n(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n
238
- \ Symbiont 1.1.2 has been installed.\n\n(::) (::) (::) (::) (::) (::) (::) (::)
238
+ \ Symbiont 1.2.0 has been installed.\n\n(::) (::) (::) (::) (::) (::) (::) (::)
239
239
  (::) (::) (::) (::)\n "
240
240
  rdoc_options: []
241
241
  require_paths:
@@ -258,4 +258,3 @@ signing_key:
258
258
  specification_version: 4
259
259
  summary: An Endosymbiotic Facultative Semantically Clean Fluent Interface Test Framework
260
260
  test_files: []
261
- has_rdoc: