wist 0.2.1 → 0.2.2

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: cc61f2c9e1bbd38709007f5da04f7245ecbb7eea
4
- data.tar.gz: 73d64f0a71e5cc0e23ad92a03123a8054d0ff140
3
+ metadata.gz: 8d195a4bc3c7ceee9e2b0b0d91dc8fe3642c9c7e
4
+ data.tar.gz: 5af4f9f8dbfc22155e2454e39c5fb95b95b6f666
5
5
  SHA512:
6
- metadata.gz: 924060310a5fc0beaaeb89e75306d2c254e439126bd09f6d849d832d8f586510532ac8b8c9f2096e2244e1603c080acae08c7087b7cec7a3b36e6412ca52f2d1
7
- data.tar.gz: 861deace2eeea2ccbb7a3686f86160064fa855ca26c1ccdd11d268f9347910dff50529737776adf0ee0864d798acca4eaa54ba2140303792ff98a867105af9b6
6
+ metadata.gz: 241d428a2a7c00b862aa43e75fc25f88d41c3f47a38a76ee480fb03aaca1d50035414c47d2004356888d7242f133f741b5a3b416d1ad50adbabfeb514f6ea924
7
+ data.tar.gz: 17c9b4dfde7c3c26e6fc9df2ad4fc304d88dbfd310719bc8b661495d195d07eadf819bbc00160f872a0a6b1119bc050410c75616561965763450ffbf99ee1dde
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- wist (0.2.1)
12
+ wist (0.2.2)
13
13
  capybara
14
14
  selenium-webdriver
15
15
 
data/lib/wist.rb CHANGED
@@ -27,8 +27,8 @@ module Wist
27
27
  end
28
28
  end
29
29
 
30
- def click(selector)
31
- find(selector).click
30
+ def click(*args)
31
+ find(*args).click
32
32
  end
33
33
 
34
34
  def set_cookie(k, v)
@@ -40,7 +40,7 @@ module Wist
40
40
 
41
41
  def set_value_and_trigger_evts(selector, val)
42
42
  find(selector).set(val)
43
- page.execute_script("$('#{selector}').focusout().change().trigger('input')")
43
+ page.execute_script("$('#{selector}').focusout().blur().change().trigger('input')")
44
44
  end
45
45
 
46
46
  def verify_tweet_button(text)
@@ -96,6 +96,7 @@ module Wist
96
96
  if element_to_click.nil?
97
97
  yield
98
98
  else
99
+ element_to_click = find(element_to_click, visible: true) if element_to_click.is_a?(String)
99
100
  element_to_click.click
100
101
  end
101
102
 
@@ -19,8 +19,8 @@ class WistTest < CapybaraTestCase
19
19
 
20
20
  # tests
21
21
  def test_click
22
- click '#click_test'
23
- assert_equal 'clicked', find('#click_test').text
22
+ click('#click_test', visible: true)
23
+ assert_equal('clicked', find('#click_test').text)
24
24
  end
25
25
 
26
26
  def test_wait_until_nested
@@ -88,6 +88,11 @@ class WistTest < CapybaraTestCase
88
88
  verify_test_page(1)
89
89
  end
90
90
 
91
+ def test_wait_for_new_url_with_string
92
+ wait_for_new_url('#wait_for_new_url_test')
93
+ verify_test_page(1)
94
+ end
95
+
91
96
  def test_wait_for_new_url_with_block
92
97
  wait_for_new_url { click('#wait_for_new_url_test') }
93
98
  verify_test_page(1)
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.1'
3
+ gem.version = '0.2.2'
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.1
4
+ version: 0.2.2
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-05-16 00:00:00.000000000 Z
11
+ date: 2014-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara