wist 0.1.4 → 0.1.5

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: cfaaad59ca0b0c89e9e3d755bbc1347c1174bf02
4
- data.tar.gz: 580560c6e11dd641a1b3fd0ba0352c22674e03fc
3
+ metadata.gz: fdda88467ab54634c82e788ac51d6774f88dae19
4
+ data.tar.gz: 114883e8c70fff363c86299594441aa121b5f91a
5
5
  SHA512:
6
- metadata.gz: ba248af31d74208f2768cebbd01c98319e39d49bf9d22d4cf5deb53f6c69042c8d66036d8900cf960a3793db5285552b84ed4a934a96a041b48a0bd7cca8b4e7
7
- data.tar.gz: 83b911fd3a80bdf6be97923e64205cea6cefab7a541109d87b6c3ec752cb46782631abeaea4e9f735a0c91d482266b192255c52d2909a21b72619b449810d574
6
+ metadata.gz: a030fa182e338211a406bcee23c62cdfb98cf4f7be574a2837a6c1dcf7a6a66c941abb4ee530b2af7107951768f35e6e237468ca9cf103b8fb73291fcd59fdfd
7
+ data.tar.gz: b655cd8d1c2ac5ae8954342489e25f5332250f0d8571b05f8e314838eea8546b2a828686b1c4d7db53287ccafdf2c654bc1ad263a563990e36ce9172561b42bb
data/Gemfile CHANGED
@@ -1,9 +1,9 @@
1
1
  source 'http://rubygems.org/'
2
2
  gemspec
3
3
 
4
- gem 'capybara', '2.1.0'
5
- gem 'tconsole'
4
+ gem 'capybara', '2.2.1'
5
+ gem 'tconsole', github: 'lihanli/tconsole'
6
6
  gem 'pry'
7
7
  gem 'turn'
8
8
  gem 'rake'
9
- gem "poltergeist", "1.2.0"
9
+ gem "poltergeist", "1.5.0"
data/Gemfile.lock CHANGED
@@ -1,7 +1,15 @@
1
+ GIT
2
+ remote: git://github.com/lihanli/tconsole.git
3
+ revision: fbc06123705a72d5b5c4509d7d471262cf68c170
4
+ specs:
5
+ tconsole (1.3.0.pre2)
6
+ chattyproc (~> 1.0.0)
7
+ term-ansicolor (~> 1.0.7)
8
+
1
9
  PATH
2
10
  remote: .
3
11
  specs:
4
- wist (0.1.3)
12
+ wist (0.1.4)
5
13
  capybara
6
14
  selenium-webdriver
7
15
 
@@ -9,33 +17,29 @@ GEM
9
17
  remote: http://rubygems.org/
10
18
  specs:
11
19
  ansi (1.4.3)
12
- capybara (2.1.0)
20
+ capybara (2.2.1)
13
21
  mime-types (>= 1.16)
14
22
  nokogiri (>= 1.3.3)
15
23
  rack (>= 1.0.0)
16
24
  rack-test (>= 0.5.4)
17
25
  xpath (~> 2.0)
18
26
  chattyproc (1.0.0)
19
- childprocess (0.3.9)
27
+ childprocess (0.5.2)
20
28
  ffi (~> 1.0, >= 1.0.11)
29
+ cliver (0.3.2)
21
30
  coderay (1.0.9)
22
- eventmachine (1.0.3)
23
- faye-websocket (0.7.0)
24
- eventmachine (>= 0.12.0)
25
- websocket-driver (>= 0.3.0)
26
- ffi (1.9.0)
27
- http_parser.rb (0.5.3)
31
+ ffi (1.9.3)
28
32
  method_source (0.8.2)
29
- mime-types (1.25)
30
- mini_portile (0.5.1)
31
- minitest (4.3.3)
32
- multi_json (1.8.1)
33
- nokogiri (1.6.0)
33
+ mime-types (2.2)
34
+ mini_portile (0.5.3)
35
+ multi_json (1.9.2)
36
+ nokogiri (1.6.1)
34
37
  mini_portile (~> 0.5.0)
35
- poltergeist (1.2.0)
36
- capybara (~> 2.1.0)
37
- faye-websocket (~> 0.4, >= 0.4.4)
38
- http_parser.rb (~> 0.5.3)
38
+ poltergeist (1.5.0)
39
+ capybara (~> 2.1)
40
+ cliver (~> 0.3.1)
41
+ multi_json (~> 1.0)
42
+ websocket-driver (>= 0.2.0)
39
43
  pry (0.9.12.2)
40
44
  coderay (~> 1.0.5)
41
45
  method_source (~> 0.8)
@@ -44,22 +48,18 @@ GEM
44
48
  rack-test (0.6.2)
45
49
  rack (>= 1.0)
46
50
  rake (10.1.0)
47
- rubyzip (0.9.9)
48
- selenium-webdriver (2.35.1)
49
- childprocess (>= 0.2.5)
51
+ rubyzip (1.1.3)
52
+ selenium-webdriver (2.41.0)
53
+ childprocess (>= 0.5.0)
50
54
  multi_json (~> 1.0)
51
- rubyzip (< 1.0.0)
55
+ rubyzip (~> 1.0)
52
56
  websocket (~> 1.0.4)
53
57
  slop (3.4.6)
54
- tconsole (1.2.8)
55
- chattyproc (~> 1.0.0)
56
- minitest (~> 4.3.0)
57
- term-ansicolor (~> 1.0.7)
58
58
  term-ansicolor (1.0.7)
59
59
  turn (0.9.6)
60
60
  ansi
61
61
  websocket (1.0.7)
62
- websocket-driver (0.3.0)
62
+ websocket-driver (0.3.2)
63
63
  xpath (2.0.0)
64
64
  nokogiri (~> 1.3)
65
65
 
@@ -67,10 +67,10 @@ PLATFORMS
67
67
  ruby
68
68
 
69
69
  DEPENDENCIES
70
- capybara (= 2.1.0)
71
- poltergeist (= 1.2.0)
70
+ capybara (= 2.2.1)
71
+ poltergeist (= 1.5.0)
72
72
  pry
73
73
  rake
74
- tconsole
74
+ tconsole!
75
75
  turn
76
76
  wist!
data/lib/wist.rb CHANGED
@@ -88,9 +88,15 @@ module Wist
88
88
  klass.split(' ').include?(class_name)
89
89
  end
90
90
 
91
- def wait_for_new_url(element_to_click)
91
+ def wait_for_new_url(element_to_click = nil)
92
92
  old_url = current_url
93
- element_to_click.click
93
+
94
+ if element_to_click.nil?
95
+ yield
96
+ else
97
+ element_to_click.click
98
+ end
99
+
94
100
  sleep 1
95
101
  wait_until { current_url != old_url }
96
102
  end
@@ -157,4 +163,8 @@ module Wist
157
163
  assert_equal(true, send("#{prefix}_css?", *args))
158
164
  end
159
165
  end
166
+
167
+ def has_css_instant?(selector)
168
+ page.evaluate_script("$('#{selector}:visible').length > 0")
169
+ end
160
170
  end
@@ -68,9 +68,14 @@ class WistTest < CapybaraTestCase
68
68
  end
69
69
 
70
70
  def test_wait_for_new_url
71
- verify_test_page 0
72
- wait_for_new_url find('#wait_for_new_url_test')
73
- verify_test_page 1
71
+ verify_test_page(0)
72
+ wait_for_new_url(find('#wait_for_new_url_test'))
73
+ verify_test_page(1)
74
+ end
75
+
76
+ def test_wait_for_new_url_with_block
77
+ wait_for_new_url { click('#wait_for_new_url_test') }
78
+ verify_test_page(1)
74
79
  end
75
80
 
76
81
  def test_refresh
@@ -152,4 +157,9 @@ class WistTest < CapybaraTestCase
152
157
  assert_has_css('#click_test', visible: true)
153
158
  assert_has_no_css('#dog123')
154
159
  end
160
+
161
+ def test_has_css_instant?
162
+ assert_equal(true, has_css_instant?('body'))
163
+ assert_equal(false, has_css_instant?('#sdklfjk'))
164
+ end
155
165
  end
data/wist.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'wist'
3
- gem.version = '0.1.4'
3
+ gem.version = '0.1.5'
4
4
  gem.summary = 'capybara helpers'
5
5
  gem.author = 'Lihan Li'
6
6
  gem.email = 'frankieteardrop@gmail.com'
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lihan Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-08 00:00:00.000000000 Z
11
+ date: 2014-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
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: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
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: '0'
41
41
  description:
@@ -44,7 +44,7 @@ executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
- - .gitignore
47
+ - ".gitignore"
48
48
  - Gemfile
49
49
  - Gemfile.lock
50
50
  - MIT-LICENSE
@@ -70,26 +70,18 @@ require_paths:
70
70
  - lib
71
71
  required_ruby_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.0.3
83
+ rubygems_version: 2.2.2
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: capybara helpers
87
- test_files:
88
- - test/jquery.cookie.js
89
- - test/jquery.js
90
- - test/test.css
91
- - test/test.js
92
- - test/test0.html
93
- - test/test1.html
94
- - test/test_helper.rb
95
- - test/tests/wist_test.rb
87
+ test_files: []