capybara-ng 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +2 -97
- data/lib/angular.rb +2 -0
- data/lib/angular/log.rb +5 -0
- data/lib/angular/setup.rb +2 -0
- data/lib/angular/version.rb +1 -1
- metadata +4 -8
- data/capybara-ng.gemspec +0 -25
- data/test/Gemfile +0 -3
- data/test/test.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4acbfb18aaa1bd35e99e42bb590fad2cc321d07a
|
4
|
+
data.tar.gz: 91ea81b100b497848f2e2d0040544466c0c133e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f1d68cd2bfe269ad448925509b9c1418ebd73e3204a5fc90087dbf9c7acd974f8cd4f6f5033ca164dd50c804a7bfebf3d89b2bffee8bd144504a052605187cd
|
7
|
+
data.tar.gz: 1bc652ef7ce2e73f77264e5a2a80af2a2cb45fdf6a4cc2c904409d77840179617705397cabd3cf2b819ef382c091595139c9a8b4da9656cc8922da288fc3002e
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.1.
|
1
|
+
ruby-2.1.5
|
data/README.md
CHANGED
@@ -43,106 +43,11 @@ end
|
|
43
43
|
|
44
44
|
### Experimenting features
|
45
45
|
|
46
|
-
|
47
|
-
require 'spec_helper'
|
48
|
-
|
49
|
-
describe 'capybara', type: :feature do
|
50
|
-
it 'test' do
|
51
|
-
visit 'http://localhost:4000/sampler'
|
52
|
-
|
53
|
-
p ng_set_location '/hello'
|
54
|
-
expect(ng_location_abs).to end_with '/hello'
|
55
|
-
|
56
|
-
ng_wait
|
57
|
-
ap ng_location
|
58
|
-
ap ng_eval 'body', '1 + 1'
|
59
|
-
|
60
|
-
ng_repeater_row('view in views', 1).click
|
61
|
-
expect(ng_model('server.url').value).to eq 'http://localhost:3001'
|
62
|
-
expect(ng_binding('hello').visible_text).to eq 'foo'
|
63
|
-
expect(ng_option("r for r in ['GET', 'POST', 'PUT', 'DELETE']").visible_text).to eq 'GET'
|
64
|
-
|
65
|
-
# trying out various node query options
|
66
|
-
|
67
|
-
p "==== ng_options"
|
68
|
-
p ng_options("r for r in ['GET', 'POST', 'PUT', 'DELETE']")
|
69
|
-
p ng_options("r for r in ['GET', 'POST', 'PUT', 'DELETE']").map(&:visible_text)
|
70
|
-
p ng_option("r for r in ['GET', 'POST', 'PUT', 'DELETE']", 1).visible_text
|
71
|
-
|
72
|
-
p "==== ng_bindings"
|
73
|
-
p ng_bindings('hello')
|
74
|
-
p ng_bindings('hello').map(&:visible_text)
|
75
|
-
p ng_binding('hello', false, 1).visible_text
|
76
|
-
|
77
|
-
p "==== ng_models"
|
78
|
-
p ng_models('server.url')
|
79
|
-
p ng_models('server.url').map(&:value)
|
80
|
-
p ng_model('server.url').value
|
81
|
-
|
82
|
-
p "==== ng_repeater_rows"
|
83
|
-
p ng_repeater_rows('row in tableData')
|
84
|
-
p ng_repeater_rows('row in tableData').map { |n| n['class'] }
|
85
|
-
p ng_repeater_row('row in tableData', 2)['class']
|
86
|
-
|
87
|
-
p "==== ng_repeater_columns"
|
88
|
-
p ng_repeater_columns('row in tableData', '{{row.color}}')
|
89
|
-
p ng_repeater_columns('row in tableData', '{{row.color}}').map(&:visible_text)
|
90
|
-
p ng_repeater_column('row in tableData', '{{row.color}}', 1).visible_text
|
91
|
-
|
92
|
-
p "==== ng_repeater_elements"
|
93
|
-
p ng_repeater_elements('row in tableData', 1, '{{row.color}}')
|
94
|
-
p ng_repeater_elements('row in tableData', 1, '{{row.color}}').map(&:visible_text)
|
95
|
-
p ng_repeater_element('row in tableData', 1, '{{row.color}}', 1).visible_text
|
96
|
-
end
|
97
|
-
end
|
98
|
-
```
|
46
|
+
@see https://github.com/kikonen/sampler/blob/master/dummy/spec/request/test_spec.rb
|
99
47
|
|
100
48
|
### Example test
|
101
|
-
Example taken from https://github.com/kikonen/sampler/blob/master/dummy/spec/request/task_spec.rb
|
102
49
|
|
103
|
-
|
104
|
-
````ruby
|
105
|
-
require 'spec_helper'
|
106
|
-
|
107
|
-
describe 'capybara', type: :feature do
|
108
|
-
include Angular::DSL
|
109
|
-
|
110
|
-
it 'create task' do
|
111
|
-
visit 'http://localhost:4000/sampler'
|
112
|
-
|
113
|
-
init_task_count = 2
|
114
|
-
|
115
|
-
# login
|
116
|
-
ng_repeater_row('view in views', 0).click
|
117
|
-
ng_model('user.username').set('admin')
|
118
|
-
ng_model('user.password').set('password')
|
119
|
-
click_button 'Login'
|
120
|
-
|
121
|
-
# check initial state
|
122
|
-
ng_repeater_row('view in views', 2).click
|
123
|
-
expect(ng_repeater_rows('task in $data').length).to eq init_task_count
|
124
|
-
|
125
|
-
# create new task
|
126
|
-
click_link 'New Task'
|
127
|
-
ng_model('task.name').set('Some')
|
128
|
-
ng_model('task.message').set('Thing')
|
129
|
-
ng_model('task.done').set('true')
|
130
|
-
click_button 'Save'
|
131
|
-
|
132
|
-
# check task is created
|
133
|
-
rows = ng_repeater_columns('task in $data', 'task.name')
|
134
|
-
expect(rows.length).to eq init_task_count + 1
|
135
|
-
|
136
|
-
# delete created task
|
137
|
-
cell = rows.select { |row| row.visible_text == 'Some' }.first
|
138
|
-
cell.click
|
139
|
-
accept_alert do
|
140
|
-
click_button 'Delete'
|
141
|
-
end
|
142
|
-
expect(ng_repeater_rows('task in $data').length).to eq init_task_count
|
143
|
-
end
|
144
|
-
end
|
145
|
-
```
|
50
|
+
@see https://github.com/kikonen/sampler/blob/master/dummy/spec/request/task_spec.rb
|
146
51
|
|
147
52
|
#### Running Example Test
|
148
53
|
````bash
|
data/lib/angular.rb
CHANGED
data/lib/angular/log.rb
ADDED
data/lib/angular/setup.rb
CHANGED
data/lib/angular/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-ng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,6 @@ files:
|
|
66
66
|
- LICENSE.txt
|
67
67
|
- README.md
|
68
68
|
- Rakefile
|
69
|
-
- capybara-ng.gemspec
|
70
69
|
- lib/angular.rb
|
71
70
|
- lib/angular/capybara_setup.rb
|
72
71
|
- lib/angular/client_script.rb
|
@@ -74,12 +73,11 @@ files:
|
|
74
73
|
- lib/angular/dsl.rb
|
75
74
|
- lib/angular/element_helper.rb
|
76
75
|
- lib/angular/locator.rb
|
76
|
+
- lib/angular/log.rb
|
77
77
|
- lib/angular/setup.rb
|
78
78
|
- lib/angular/version.rb
|
79
79
|
- lib/angular/waiter.rb
|
80
80
|
- lib/capybara-ng.rb
|
81
|
-
- test/Gemfile
|
82
|
-
- test/test.rb
|
83
81
|
homepage: https://github.com/kikonen/capybara-ng
|
84
82
|
licenses:
|
85
83
|
- MIT
|
@@ -104,6 +102,4 @@ rubygems_version: 2.2.2
|
|
104
102
|
signing_key:
|
105
103
|
specification_version: 4
|
106
104
|
summary: AngularJS for capybara.
|
107
|
-
test_files:
|
108
|
-
- test/Gemfile
|
109
|
-
- test/test.rb
|
105
|
+
test_files: []
|
data/capybara-ng.gemspec
DELETED
@@ -1,25 +0,0 @@
|
|
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
|
data/test/Gemfile
DELETED