locution-sdk 0.1.2 → 0.2.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: c432603cc67c33d0df5c39774e944d4b2572adbf
4
- data.tar.gz: 7ef4db8a73668dbc9d7b57d5e8086335c18e5d10
3
+ metadata.gz: 35982215b4df281bb563b5a7750409df099ba3ff
4
+ data.tar.gz: a1069adf0f139f8852fba46894bf27009c7d2a03
5
5
  SHA512:
6
- metadata.gz: 97f60581e608766f233c5d67458ad5a9c65ae2a5aacdc4ad6fc5e3ba7398a4c9f7c460984a2067129e33d24d0bf4a44984f32fa0a5aa4ad9109811fb1f2b38be
7
- data.tar.gz: 1091047f3631a7b69098f9590390c05ee2f9beba7803a7fc9dec037c9f259ad9dc6d5dbe502c8ea8c2e3ae26fd7489b873e7b707865ce89fad2d4ccac8a47fe1
6
+ metadata.gz: 84d1389cfbb4a9b785cdf5ddf9098ab777855a61756c5463b38a8fcc8a6eabf56fd294633963aaa5344dd6389250b12fe135f4e9130ba8fbaf7a598e43b5b9e6
7
+ data.tar.gz: fde1775dcad4878ee0a344c3190762973640baf8dd0fe6f002186822ef5a692c300e6b2f1620fbbc9a88b7cca725a87658eed7fbd29a82a2573cd673665558ea
@@ -17,11 +17,13 @@ module Locution
17
17
  end
18
18
 
19
19
  def before_find(by, what, driver)
20
+ @ignore_javascript_inspection = true
20
21
  @number_of_elements_found = driver.execute_script("return #{get_javascript(by, what)}")
21
22
  @locator_start_time = Time.now
22
23
  end
23
24
 
24
25
  def after_find(by, what, driver)
26
+ @ignore_javascript_inspection = false
25
27
  ::RestClient.post "#{@base_url}/tests/#{@test_id}/locators", {
26
28
  access_token: @access_token,
27
29
  locator_value: "#{by}, #{what}",
@@ -31,6 +33,23 @@ module Locution
31
33
  }
32
34
  end
33
35
 
36
+ def before_execute_script(script, driver)
37
+ unless @ignore_javascript_inspection
38
+ @locator_start_time = Time.now
39
+ end
40
+ end
41
+
42
+ def after_execute_script(script, driver)
43
+ unless @ignore_javascript_inspection
44
+ ::RestClient.post "#{@base_url}/tests/#{@test_id}/locators", {
45
+ access_token: @access_token,
46
+ locator_value: "execute script, #{script}",
47
+ start_time: @locator_start_time,
48
+ end_time: Time.now
49
+ }
50
+ end
51
+ end
52
+
34
53
  def after_quit(driver)
35
54
  ::RestClient.put "#{@base_url}/tests/#{@test_id}", {
36
55
  access_token: @access_token,
@@ -1,5 +1,5 @@
1
1
  module Locution
2
2
  module Sdk
3
- VERSION = '0.1.2'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locution-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Haeffner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-10 00:00:00.000000000 Z
11
+ date: 2016-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler