wist 0.2.4 → 0.2.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: 92c7a729771ad5443f5138500cf840ee4e95d3e9
4
- data.tar.gz: 64e03b847b5957264cf8c494d85506102f67ee51
3
+ metadata.gz: 450acc6d356d059a6c0c198eb1b4127c2fb22783
4
+ data.tar.gz: 5e628c0c47dbd85e06875703cfacf2b4fe8721f4
5
5
  SHA512:
6
- metadata.gz: 66ba3eaa0f21c10b9b191eda29e9894ef5a0f31731721146bfd06e63461957b7f8504004ef7e7dbabab730c91a9e541c8a63bc50c761e19e6eda2cb51e37b057
7
- data.tar.gz: 9c9b800713baedad2fbe8924392fdff34514ff1dfe187e98b5e84abd8415295f4108c082ca4ca622366693757846c461fc73cc43314a08fce9c59778edffb75f
6
+ metadata.gz: 951913b7641ab65c9dcee97dddf2c08ca63230d3f2768f287f3979a6c5207be48f5d0974b6051c919264438163e77466b439dcd8d404c52af92000c0dcdd775d
7
+ data.tar.gz: 783a628c708798679e09004dffafa52c8cc18970ddbbfcdd686533237154eaa3f78d351377eaa0fc56f7b365ee5f755cf4f785f4dc6c72b3b08d23b2bac9f428
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wist (0.2.4)
4
+ wist (0.2.5)
5
5
  capybara
6
6
  selenium-webdriver
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- ansi (1.4.3)
11
+ ansi (1.5.0)
12
12
  builder (3.2.2)
13
13
  capybara (2.2.1)
14
14
  mime-types (>= 1.16)
@@ -24,8 +24,8 @@ GEM
24
24
  method_source (0.8.2)
25
25
  mime-types (2.2)
26
26
  mini_portile (0.5.3)
27
- minitest (5.4.3)
28
- minitest-reporters (1.0.7)
27
+ minitest (5.5.1)
28
+ minitest-reporters (1.0.11)
29
29
  ansi
30
30
  builder
31
31
  minitest (>= 5.0)
@@ -46,9 +46,9 @@ GEM
46
46
  rack-test (0.6.2)
47
47
  rack (>= 1.0)
48
48
  rake (10.1.0)
49
- ruby-progressbar (1.7.0)
50
- rubyzip (1.1.6)
51
- selenium-webdriver (2.43.0)
49
+ ruby-progressbar (1.7.1)
50
+ rubyzip (1.1.7)
51
+ selenium-webdriver (2.45.0)
52
52
  childprocess (~> 0.5)
53
53
  multi_json (~> 1.0)
54
54
  rubyzip (~> 1.0)
data/lib/wist.rb CHANGED
@@ -74,6 +74,10 @@ module Wist
74
74
  end
75
75
  end
76
76
 
77
+ def interact_with_confirm(accept = true)
78
+ page.execute_script("window.confirm = function() { return #{accept.to_json} }")
79
+ end
80
+
77
81
  def alert_accept(expected_msg = false)
78
82
  page.execute_script "window.alert = function(msg) { window.lastAlertMsg = msg; }"
79
83
  yield
data/test/test.js CHANGED
@@ -45,4 +45,8 @@ $('#finder_with_wait').click(function () {
45
45
 
46
46
  $('#click_by_text').click(function () {
47
47
  $(this).text('clicked');
48
+ });
49
+
50
+ $('#confirm_test').click(function() {
51
+ window.confirmed = confirm('foo');
48
52
  });
data/test/test0.html CHANGED
@@ -7,6 +7,7 @@
7
7
  <button id='click_test'>foo</button>
8
8
  <button id='wait_test'>foo</button>
9
9
  <button id='enable_tweet_button'>foo</button>
10
+ <button id='confirm_test'>confirm test</button>
10
11
  <a href='https://twitter.com/share' class='twitter-share-button' data-text='check this out'></a>
11
12
  <a id='switch_window_test' href='test1.html' target='_blank'>foo</a>
12
13
  <input id='input_test' type='text' />
data/test/test_helper.rb CHANGED
@@ -3,7 +3,7 @@ require 'capybara/poltergeist'
3
3
  require 'pry'
4
4
  require "minitest/autorun"
5
5
  require "minitest/reporters"
6
- Minitest::Reporters.use!
6
+ Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new)
7
7
 
8
8
  class CapybaraTestCase < Minitest::Test
9
9
  include Capybara::DSL
@@ -198,4 +198,12 @@ class WistTest < CapybaraTestCase
198
198
  assert_equal(0, new_time)
199
199
  assert_equal(old_time, Capybara.default_wait_time)
200
200
  end
201
+
202
+ def test_interact_with_confirm
203
+ [true, false].each do |bool|
204
+ interact_with_confirm(bool)
205
+ click('#confirm_test')
206
+ assert_equal(bool, get_js('confirmed'))
207
+ end
208
+ end
201
209
  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.2.4'
3
+ gem.version = '0.2.5'
4
4
  gem.summary = 'capybara helpers'
5
5
  gem.author = 'Lihan Li'
6
6
  gem.email = 'frankieteardrop@gmail.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.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: 2014-11-24 00:00:00.000000000 Z
11
+ date: 2015-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.2.2
83
+ rubygems_version: 2.4.5
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: capybara helpers
@@ -93,4 +93,3 @@ test_files:
93
93
  - test/test1.html
94
94
  - test/test_helper.rb
95
95
  - test/tests/wist_test.rb
96
- has_rdoc: