rwebspec 5.0.3 → 5.1.0

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: c51c5e4e8e790cf5836d5b731778df3dc361de7d
4
- data.tar.gz: 63e0adb033dd8ac4e58af344759895b5bdb5cfec
3
+ metadata.gz: 93b6b8fe7fea586a71732d1d5e7f169a2d55d169
4
+ data.tar.gz: a51ec988649fc537843c19c23a2b219ef8ea9b1f
5
5
  SHA512:
6
- metadata.gz: 4bc94fa500322f4a8b45f9aaa99a63f7aa2f84c9824196ce0ea423c073fce04339752ddb4e323c96fbdc2a7125c5d308e1c3754175e6d41a5a4d7c4686d574c1
7
- data.tar.gz: 917853302ffc7cd70b8bbcec91016ef188be2c5962ff5d1a53cf092da3b4617ce33dc2d1bc2b2d447ba750526b7db780ec0aa64c7605758ae4fcaac483091e9f
6
+ metadata.gz: 4eddeb039df9ce3309beb7996974f3937de4d0f67d1d11dd06912c0f709ce3f70993f7882b6c960e8f5aaee79380c5be876862a999c944ed4e02c455331a49fd
7
+ data.tar.gz: 80424f6d8a6e18e2a5a802fdc7484418ac5037b0f7b8e4ba2e9580513ad21a336fed30b972c2bf8de9b58189416062d187fd260c7c6898bf4b2cfe86a0b833e6
data/CHANGELOG CHANGED
@@ -1,6 +1,14 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 5.1
5
+ [Feature] Use minitest 4 for assertion
6
+ [Fixes] Handle assert_text_present in try_for{}
7
+ [Change] Lock activesupport version 3.2.17
8
+
9
+ 5.0.4
10
+ [Enhancement] click_button_with_id, click_link_with_id will focus on the element first (Selenium) to avoid unable to click when the browser window too small.
11
+
4
12
  5.0.2
5
13
  [Fixes] inconsistency enter_text_with_id() between Watir and Selenium
6
14
 
data/Rakefile CHANGED
@@ -77,9 +77,9 @@ end
77
77
  spec = Gem::Specification.new do |s|
78
78
  s.platform= Gem::Platform::RUBY
79
79
  s.name = "rwebspec"
80
- s.version = "5.0.3"
80
+ s.version = "5.1.0"
81
81
  s.summary = "Web application functional specification in Ruby"
82
- s.description = "Executable functional specification for web applications in RSpec syntax with Watir or Selenium"
82
+ s.description = "Executable functional specification for web applications in RSpec syntax with Watir or Selenium WebDriver"
83
83
 
84
84
  s.author = "Zhimin Zhan"
85
85
  s.email = "zhimin@agileway.com.au"
@@ -102,6 +102,8 @@ spec = Gem::Specification.new do |s|
102
102
  s.add_dependency(%q<rspec-mocks>, [">= 2.13.0"])
103
103
  s.add_dependency(%q<rspec-expectations>, [">= 2.13"])
104
104
  s.add_dependency("commonwatir", ">= 4.0.0")
105
+ s.add_dependency("minitest", "~> 4.0")
106
+ s.add_dependency("activesupport", "~> 3.2.17")
105
107
 
106
108
  unless RUBY_PLATFORM =~ /mingw/
107
109
  s.add_dependency("selenium-webdriver")
@@ -1,17 +1,12 @@
1
- require 'test/unit/assertions'
2
1
 
3
2
  module RWebSpec
4
3
  module Assert
5
- include Test::Unit::Assertions
4
+ include ::MiniTest::Assertions
6
5
 
7
6
  def assert_not(condition, msg = "")
8
7
  perform_assertion { assert(!condition, msg) }
9
8
  end
10
9
 
11
- def assert_nil(actual, msg="")
12
- perform_assertion { assert(actual.nil?, msg) }
13
- end
14
-
15
10
  def assert_not_nil(actual, msg="")
16
11
  perform_assertion { assert(!actual.nil?, msg) }
17
12
  end
@@ -509,6 +504,9 @@ module RWebSpec
509
504
  # puts "[DEBUG] Assertion error: #{e}"
510
505
  take_screenshot if $take_screenshot
511
506
  raise e
507
+ rescue MiniTest::Assertion => e2
508
+ take_screenshot if $take_screenshot
509
+ raise e2
512
510
  end
513
511
  end
514
512
 
@@ -122,6 +122,8 @@ module RWebSpec
122
122
  yield
123
123
  last_error = nil
124
124
  return true
125
+ rescue MiniTest::Assertion => e1
126
+ last_error = e1
125
127
  rescue => e
126
128
  last_error = e
127
129
  end
@@ -40,8 +40,9 @@ module RWebSpec
40
40
  begin
41
41
  snapshot if $TESTWISE_DUMP_PAGE || $TESTWISE_DUMP_PAGE
42
42
  delay = $TESTWISE_PAGE_DELAY || $TESTWISE_PAGE_DELAY
43
- sleep(delay)
43
+ sleep(delay) if delay
44
44
  rescue => e
45
+ puts e.backtrace
45
46
  end
46
47
  assert_on_page
47
48
  end
@@ -458,12 +458,22 @@ module RWebSpec
458
458
  def click_link_with_id(link_id, opts = {})
459
459
  if opts && opts[:index]
460
460
  elements = find_elements(:id, link_id)
461
+ focus_on_element(elements[opts[:index]-1])
461
462
  elements[opts[:index]-1].click
462
463
  else
464
+ focus_on_element(find_element(:id, link_id))
463
465
  find_element(:id, link_id).click
464
466
  end
465
467
  end
466
468
 
469
+ def focus_on_element(elem)
470
+ begin
471
+ elem.send_keys("")
472
+ rescue => e
473
+ # ignore for example, an on hover table might not be ablet to send keys to
474
+ end
475
+ end
476
+
467
477
  ##
468
478
  # click_link_with_text("Login")
469
479
  # click_link_with_text("Show", :index => 2)
@@ -487,8 +497,10 @@ module RWebSpec
487
497
  elements = find_elements(:id, id)
488
498
  the_index = opts[:index].to_i() - 1
489
499
  first_match = elements[the_index]
500
+ focus_on_element(first_match)
490
501
  first_match.click
491
502
  else
503
+ focus_on_element(find_element(:id, id))
492
504
  find_element(:id, id).click
493
505
  end
494
506
 
data/lib/rwebspec.rb CHANGED
@@ -4,6 +4,11 @@
4
4
  #***********************************************************
5
5
  require "rubygems"
6
6
 
7
+ gem "activesupport", "~> 3.2.17"
8
+ gem "minitest", "~> 4.0" # ver 5 return errors
9
+
10
+ require 'minitest/autorun'
11
+
7
12
  # Load active_support, so that we can use 1.days.ago
8
13
  begin
9
14
  require 'active_support/basic_object'
@@ -16,7 +21,7 @@ end
16
21
  require 'rspec'
17
22
 
18
23
  unless defined? RWEBSPEC_VERSION
19
- RWEBSPEC_VERSION = RWEBUNIT_VERSION = "5.0.2"
24
+ RWEBSPEC_VERSION = RWEBUNIT_VERSION = "5.1.0"
20
25
  end
21
26
 
22
27
  $testwise_polling_interval = 1 # seconds
metadata CHANGED
@@ -1,110 +1,138 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rwebspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zhimin Zhan
8
8
  autorequire: rwebspec
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-19 00:00:00.000000000 Z
11
+ date: 2014-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.13'
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: '2.13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.13.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: 2.13.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-mocks
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.13.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.13.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-expectations
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.13'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.13'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: commonwatir
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 4.0.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 4.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '4.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activesupport
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 3.2.17
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 3.2.17
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: selenium-webdriver
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
- - - '>='
115
+ - - ">="
88
116
  - !ruby/object:Gem::Version
89
117
  version: '0'
90
118
  type: :runtime
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
- - - '>='
122
+ - - ">="
95
123
  - !ruby/object:Gem::Version
96
124
  version: '0'
97
125
  description: Executable functional specification for web applications in RSpec syntax
98
- with Watir or Selenium
126
+ with Watir or Selenium WebDriver
99
127
  email: zhimin@agileway.com.au
100
128
  executables: []
101
129
  extensions: []
102
130
  extra_rdoc_files: []
103
131
  files:
104
- - Rakefile
105
- - README
106
132
  - CHANGELOG
107
133
  - MIT-LICENSE
134
+ - README
135
+ - Rakefile
108
136
  - lib/extensions/rspec_extensions.rb
109
137
  - lib/extensions/watir_extensions.rb
110
138
  - lib/extensions/webdriver_extensions.rb
@@ -139,18 +167,18 @@ require_paths:
139
167
  - lib
140
168
  required_ruby_version: !ruby/object:Gem::Requirement
141
169
  requirements:
142
- - - '>='
170
+ - - ">="
143
171
  - !ruby/object:Gem::Version
144
172
  version: '0'
145
173
  required_rubygems_version: !ruby/object:Gem::Requirement
146
174
  requirements:
147
- - - '>='
175
+ - - ">="
148
176
  - !ruby/object:Gem::Version
149
177
  version: '0'
150
178
  requirements:
151
179
  - none
152
180
  rubyforge_project: rwebspec
153
- rubygems_version: 2.1.11
181
+ rubygems_version: 2.2.2
154
182
  signing_key:
155
183
  specification_version: 4
156
184
  summary: Web application functional specification in Ruby