true_automation 0.4.0 → 0.5.4

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
  SHA256:
3
- metadata.gz: 22f6553e2b4a2f3190038a8ad52c2b838bcfb61cae3e86fb963d8492d345b8f2
4
- data.tar.gz: 64ca3a87d2bdbb8ac1a180e5691051aa11fa9eb72c02fa00a64e94a361971984
3
+ metadata.gz: 18f3ddf74aa6ec0b2d308d4696bfc7a1157991876fc9a28d9e37b5b5ae28c038
4
+ data.tar.gz: b76f40baa2268dc9d213a4f9d58681b19a4aa3db2b327cc828cdaafe98c08a8c
5
5
  SHA512:
6
- metadata.gz: e26186f0e510de4185f3a60732fa0040d58a820f2d33a92333231cab9fdedfd1a54afffaf5bf3158c62b73c961a19cf3ed6b42efc252a5fa6fb37576f90720f6
7
- data.tar.gz: f399dfc5bcc4fab22517db68ba5eecea5ba911b0b31db65a20d5dbd0acdfa168a16fb13553a46e486909974c4e030f196836d480ce67f12b029f59fdddea7383
6
+ metadata.gz: 566fcc5ce2711a0529555f775b5f5269108207b836c60c69c20caadc9bf0f0268fd8ecaec1da41fa1a72738eb38e89547e4286e203be05358b532cbfebcaf6fb
7
+ data.tar.gz: 39036bc4f154e7d37588fe386b390284c194514b194067cb263593de1e3a20dbc96cf2b750a69d661162bec6fd8841e30bab16f5ae4505987ef628092fe91f0e
@@ -10,6 +10,7 @@ module TrueAutomation
10
10
  def start(options)
11
11
  @port = options[:port]
12
12
  remote = options[:remote]
13
+ ta_debug = options[:ta_debug]
13
14
 
14
15
  if options[:ta_service]
15
16
  driver_path = " --driver #{options[:ta_service]}"
@@ -30,7 +31,7 @@ module TrueAutomation
30
31
  Dir.mkdir('log') unless File.exist?('log')
31
32
  logfile = "log/trueautomation-#{Time.now.strftime('%Y%m%dT%H%M%S')}.log"
32
33
 
33
- @pid = spawn("#{@executable} --log-file #{logfile} --port #{@port}#{driver_path}#{remote}")
34
+ @pid = spawn("#{@executable} --log-file #{logfile} --port #{@port}#{driver_path}#{remote}#{ta_debug}")
34
35
  puts "Started TrueAutomation.IO client with pid #{@pid} listening to port #{@port}"
35
36
 
36
37
  @pid
@@ -7,11 +7,11 @@ module Capybara
7
7
  desc = original_description
8
8
  matched_result = desc.match(/.*__taonly__(.+)__taonly__.*/)
9
9
  if selector = matched_result && matched_result[1]
10
- desc = "TrueAutomation element #{selector} on the page"
10
+ desc = "Element was not found on the page. Element '#{selector}' with such locator is not on this page and could not be detected by TrueAutomation."
11
11
  end
12
- matched_result_ta = desc.match(/.*(__ta__.+__ta__).*/)
13
- if selector = matched_result_ta && matched_result_ta[1]
14
- desc = desc.gsub(selector, '')
12
+ matched_result_ta = desc.match(/visible\s(.+)\s\"(.*)__ta__(.+)__ta__.*/)
13
+ if matched_result_ta && matched_result_ta[3]
14
+ desc = "Unable to locate element { using: '#{matched_result_ta[1]}', selector: '#{matched_result_ta[2]}' }"
15
15
  end
16
16
  desc
17
17
  end
@@ -19,6 +19,23 @@ module Capybara
19
19
  end
20
20
  end
21
21
 
22
+ module Capybara
23
+ module Node
24
+ module Finders
25
+ private
26
+ alias_method :original_synced_resolve, :synced_resolve
27
+ def synced_resolve(query)
28
+ begin
29
+ original_synced_resolve(query)
30
+ rescue Capybara::ElementNotFound => ex
31
+ raise Capybara::ElementNotFound, query.applied_description if query.locator.match(/.*__ta(only)*__(.+)__ta(only)*__.*/)
32
+ raise Capybara::ElementNotFound, ex
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+
22
39
  module TrueAutomation
23
40
  class RecordNotFound < StandardError; end
24
41
 
@@ -30,6 +47,11 @@ module TrueAutomation
30
47
  @driver = options.delete(:driver)
31
48
  @driver_version = options.delete(:driver_version)
32
49
 
50
+ if options && options[:ta_debug]
51
+ @ta_debug = ' --ta-debug'
52
+ options.delete(:ta_debug)
53
+ end
54
+
33
55
  if options[:ta_service]
34
56
  @ta_service = options.delete(:ta_service)
35
57
  end
@@ -61,6 +83,7 @@ module TrueAutomation
61
83
  unless @browser
62
84
  @ta_client.start(port: @port,
63
85
  remote: @remote,
86
+ ta_debug: @ta_debug,
64
87
  driver: @driver,
65
88
  ta_service_path: @ta_service&.executable_path,
66
89
  driver_version: @driver_version)
@@ -1,3 +1,3 @@
1
1
  module TrueAutomation
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: true_automation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - TrueAutomation.IO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-25 00:00:00.000000000 Z
11
+ date: 2020-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler