rwebspec 6.2.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5573de85d53760dcc6e601d4f580262f76359ce
4
- data.tar.gz: c6d7642e66b2684c68a8905c95cf7c7d5f306fe0
3
+ metadata.gz: fe3a0a083f9ec7923ca112fdcdf56d622859e6c6
4
+ data.tar.gz: 4dff3812fcf3995a6d5ca4a8182b6735dc88508e
5
5
  SHA512:
6
- metadata.gz: 47638dcb16b3bf65e5a824b9c381764afc791ccdc13eff0bdc800b4d0ffd5956787b5134893e35181ecd27f9e8f750277454525eb3820b92740766f79c927a2d
7
- data.tar.gz: 4df38f3a99225a8fdacbec2b37838a06b7028a2d4471e92a58142f8148509507b79fdb1c35881767797f19899691a2371db004f28c8938c60e0ca2eafdc6e5a9
6
+ metadata.gz: 98b92a1d388de81b48ad5703c687f926192fbd80713f6b13458fb0eb3fd9b490aa50376410f1dac4f1c6b3c3a098e21b52c168da8feaa7a0ccdffaa94cf9c905
7
+ data.tar.gz: e3ed768733939ac7d6dc918b46c995c4aec48f13c30c187d47573f4c28e6f75db5e3de1e3932178613d8f17a010069666977a027d436499a696b50a1d0d03c58
data/CHANGELOG CHANGED
@@ -1,6 +1,9 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 6.2.1
5
+ [Fix] More compatible with TestWise 4
6
+
4
7
  6.2
5
8
  [Change] Support TestWise 5 pause
6
9
 
data/Rakefile CHANGED
@@ -77,7 +77,7 @@ end
77
77
  spec = Gem::Specification.new do |s|
78
78
  s.platform= Gem::Platform::RUBY
79
79
  s.name = "rwebspec"
80
- s.version = "6.2.0"
80
+ s.version = "6.2.1"
81
81
  s.summary = "Web application functional specification in Ruby"
82
82
  s.description = "Executable functional specification for web applications in RSpec syntax with Watir or Selenium WebDriver"
83
83
 
@@ -14,7 +14,7 @@ module RWebSpec
14
14
  return $TESTWISE_DEBUGGING && $TESTWISE_RUNNING_AS == "test_case"
15
15
  end
16
16
 
17
- def debug(message)
17
+ def write_to_console(message)
18
18
  Thread.pass
19
19
  if (ENV["RUN_IN_TESTWISE"] && ENV["RUN_IN_TESTWISE"].to_s == "true" || $RUN_IN_TESTWISE) && message
20
20
  the_sent_msg = message.to_s
@@ -26,7 +26,7 @@ module RWebSpec
26
26
  puts message
27
27
  end
28
28
  end
29
- alias write_to_console debug
29
+ alias debug write_to_console
30
30
 
31
31
 
32
32
  # Support of TestWise to ajust the intervals between keystroke/mouse operations
@@ -88,24 +88,30 @@ module RWebSpec
88
88
  end
89
89
 
90
90
 
91
- def connect_to_testwise (message_type, body)
91
+ def connect_to_testwise(message_type, body)
92
92
  Thread.pass
93
+ testwise_port = $TESTWISE_TRACE_PORT || ENV["TESTWISE_TRACE_PORT"].to_i || 7025
94
+ testwise_socket = nil
93
95
  begin
94
96
  the_message = message_type + "|" + body
95
97
  if @last_message == the_message then # ignore the message same as preivous one
96
98
  return
97
99
  end
98
- testwise_port = ENV["TESTWISE_TRACE_PORT"].to_i || $TESTWISE_TRACE_PORT || 7025
99
100
  testwise_socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
100
101
  testwise_socket.connect(Socket.pack_sockaddr_in(testwise_port, '127.0.0.1'))
101
102
  testwise_socket.puts(the_message)
102
103
  @last_message = the_message
103
- testwise_socket.close
104
104
  rescue => e
105
+ puts "Failed to connect to TestWise on port #{testwise_port}, #{e}, #{e.backtrace}"
106
+ ensure
107
+ if testwise_socket
108
+ testwise_socket.close();
109
+ end
105
110
  end
106
111
  end
107
112
 
108
113
  def check_for_pause
114
+
109
115
  json_data = fetch_debug_server_status
110
116
 
111
117
  if json_data["testwise_ready_to_pause"]
@@ -126,11 +132,14 @@ module RWebSpec
126
132
 
127
133
  def fetch_debug_server_status
128
134
  testwise_debug_server_port = ENV["TESTWISE_DEBUG_PORT"].to_i || $TESTWISE_DEBUG_PORT || 7035
129
- server = TCPSocket.open("127.0.0.1", testwise_debug_server_port)
130
- server.puts("debug_status")
131
- msg = server.gets.chomp
132
- server.close
133
- json_data = JSON.parse(msg)
135
+ if testwise_debug_server_port
136
+ puts "debug server port: #{testwise_debug_server_port}"
137
+ server = TCPSocket.open("127.0.0.1", testwise_debug_server_port)
138
+ server.puts("debug_status")
139
+ msg = server.gets.chomp
140
+ server.close
141
+ json_data = JSON.parse(msg)
142
+ end
134
143
  end
135
144
 
136
145
  end
@@ -347,7 +347,10 @@ module RWebSpec
347
347
  begin
348
348
  dump_caller_stack
349
349
  operation_delay
350
- check_for_pause
350
+ if defined? TestWiseRuntimeSupport
351
+ check_for_pause
352
+ end
353
+
351
354
  yield
352
355
  rescue RuntimeError => re
353
356
  puts "[DEBUG] operation error: #{re}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rwebspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.2.1
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: 2015-10-25 00:00:00.000000000 Z
11
+ date: 2015-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec