capybara-ng 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2fe60760b896ba2c87ac3f698db240f5a249c302
4
+ data.tar.gz: e293bf655ff886c0b5ef48fc569f5f11f30309f5
5
+ SHA512:
6
+ metadata.gz: 2584ef8d0dceeb3b578eeb23c6e0620d6ccb449a8af4cd68bf4fa4d01d4148b132e1876f29ce86ba3c10578a680e28217307d822cb205c50bfdb79fd9b5a084d
7
+ data.tar.gz: c441a769921abad480c6ac4c619417fb8426db4be0b42fc10da2aa3060bf95682ae98e1571d1f94449c02b36adb14384fdf78bec6e69dcb6e29efc3cea2db59b
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ capybara-angular
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.1.3
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capybara-ng.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 kari
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # Angular
2
+
3
+ Basic bindings for AngularJS to be used with Capybara. Logic is based into Protractor.
4
+
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'capybara-ng'
11
+ gem 'capybara-ng', git: 'git@github.com:kikonen/capybara-ng.git', tag: 'v0.0.1'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install capybara-ng
20
+
21
+ ## Usage
22
+
23
+ ````ruby
24
+ require 'spec_helper'
25
+
26
+ describe 'capybara', type: :feature do
27
+ include Angular::DSL
28
+
29
+ it 'test' do
30
+ visit 'http://localhost:4000/sampler'
31
+
32
+ p ng_set_location '/hello'
33
+ expect(ng_location_abs).to end_with '/hello'
34
+
35
+ ng_wait
36
+ ap ng_location
37
+ ap ng_eval 'body', '1 + 1'
38
+
39
+ ng_repeater_row('view in views', 1).click
40
+ expect(ng_model('server.url').value).to eq 'http://localhost:3001'
41
+ expect(ng_binding('hello').visible_text).to eq 'foo'
42
+ expect(ng_option("r for r in ['GET', 'POST', 'PUT', 'DELETE']").visible_text).to eq 'GET'
43
+
44
+ # trying out various node query options
45
+
46
+ p "==== ng_options"
47
+ p ng_options("r for r in ['GET', 'POST', 'PUT', 'DELETE']")
48
+ p ng_options("r for r in ['GET', 'POST', 'PUT', 'DELETE']").map(&:visible_text)
49
+ p ng_option("r for r in ['GET', 'POST', 'PUT', 'DELETE']", 1).visible_text
50
+
51
+ p "==== ng_bindings"
52
+ p ng_bindings('hello')
53
+ p ng_bindings('hello').map(&:visible_text)
54
+ p ng_binding('hello', false, 1).visible_text
55
+
56
+ p "==== ng_models"
57
+ p ng_models('server.url')
58
+ p ng_models('server.url').map(&:value)
59
+ p ng_model('server.url').value
60
+
61
+ p "==== ng_repeater_rows"
62
+ p ng_repeater_rows('row in tableData')
63
+ p ng_repeater_rows('row in tableData').map { |n| n['class'] }
64
+ p ng_repeater_row('row in tableData', 2)['class']
65
+
66
+ p "==== ng_repeater_columns"
67
+ p ng_repeater_columns('row in tableData', '{{row.color}}')
68
+ p ng_repeater_columns('row in tableData', '{{row.color}}').map(&:visible_text)
69
+ p ng_repeater_column('row in tableData', '{{row.color}}', 1).visible_text
70
+
71
+ p "==== ng_repeater_elements"
72
+ p ng_repeater_elements('row in tableData', 1, '{{row.color}}')
73
+ p ng_repeater_elements('row in tableData', 1, '{{row.color}}').map(&:visible_text)
74
+ p ng_repeater_element('row in tableData', 1, '{{row.color}}', 1).visible_text
75
+ end
76
+ end
77
+ ```
78
+
79
+ ## Contributing
80
+
81
+ 1. Fork it ( https://github.com/[my-github-username]/capybara/fork )
82
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
83
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
84
+ 4. Push to the branch (`git push origin my-new-feature`)
85
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'angular/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capybara-ng"
8
+ spec.version = Angular::VERSION
9
+ spec.authors = ["kari"]
10
+ spec.email = ["mr.kari.ikonen@gmail.com"]
11
+ spec.summary = %q{AngularJS for capybara.}
12
+ spec.description = %q{AngularJS bindings for capybara.}
13
+ spec.homepage = "https://github.com/kikonen/capybara-ng"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake", '~> 10.3'
23
+
24
+ spec.add_dependency 'awesome_print', '>= 1.2.0'
25
+ end