locatine 0.01215 → 0.01300
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/locatine/app/manifest.json +1 -1
- data/lib/locatine/dialog_actions.rb +5 -5
- data/lib/locatine/dialog_logic.rb +20 -4
- data/lib/locatine/file_work.rb +1 -1
- data/lib/locatine/public.rb +2 -2
- data/lib/locatine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcac98a7110904e47f05c216b6b78032013f626f
|
4
|
+
data.tar.gz: d2560254389abffb699a635a40dd211bebcb0abc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58a755f90fa8442934185daf90f33d0655e215c7487d21fb44dbd760ad3004bc222bca599ca77c221342a86dde2e665a0f9fdefc365456f06c5389cb60612a54
|
7
|
+
data.tar.gz: 8f0cf282edc1cc4652c8badf6d266814bdd22ab47efb88e708ac381eb75100d895e9e1ccc5306628fb1282eaf3927d8273a03006a96bfd66af638700558ee18c
|
@@ -30,7 +30,7 @@ module Locatine
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def fix_iframe
|
33
|
-
@iframe = @browser.iframe(@iframe.selector) if @iframe
|
33
|
+
@iframe = @browser.iframe(@iframe.selector) if @iframe && @iframe.stale?
|
34
34
|
end
|
35
35
|
|
36
36
|
def push_title(text)
|
@@ -40,7 +40,8 @@ module Locatine
|
|
40
40
|
|
41
41
|
##
|
42
42
|
# Sending request to locatine app
|
43
|
-
def start_listening(
|
43
|
+
def start_listening(scope, name)
|
44
|
+
push_title "You are selecting #{name} in #{scope}"
|
44
45
|
send_to_app('locatinestyle', 'blocked', @browser) if @iframe
|
45
46
|
send_to_app('locatinehint', 'Toggle single//collection mode button if '\
|
46
47
|
'you need. If you want to do some actions on the page toggle Locatine'\
|
@@ -59,13 +60,12 @@ module Locatine
|
|
59
60
|
|
60
61
|
def response_action(element)
|
61
62
|
send_to_app('locatineconfirmed', 'ok')
|
62
|
-
|
63
|
-
'So no button will work')
|
63
|
+
push_title 'Right now you are defining nothing. So no button will work'
|
64
64
|
send_to_app('locatinehint', 'Place for a smart hint here')
|
65
65
|
mass_highlight_turn(element, false)
|
66
66
|
send_to_app('locatinestyle', 'set_false')
|
67
67
|
send_to_app('locatinestyle', 'ok', @browser) if @iframe
|
68
|
-
sleep
|
68
|
+
sleep 1
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
@@ -43,19 +43,35 @@ module Locatine
|
|
43
43
|
|
44
44
|
warn "Maybe #{tag} can't be found as a #{@type}?" if @type && !element
|
45
45
|
|
46
|
-
|
46
|
+
return_selected(element, attributes, new_attributes, vars)
|
47
|
+
end
|
48
|
+
|
49
|
+
def return_old_selection(attrs, vars)
|
50
|
+
return find_by_data(attrs, vars).to_a, attrss.to_h if attrs.to_h != {}
|
51
|
+
|
52
|
+
return nil, {}
|
53
|
+
end
|
54
|
+
|
55
|
+
def return_selected(element, attributes, new_attributes, vars)
|
56
|
+
if !element && new_attributes.to_h != {}
|
57
|
+
push_title 'Selected element was lost before locatine locate it. '\
|
58
|
+
'Consider choosing it from devtools or write your own locator'
|
59
|
+
return return_old_selection(attributes, vars)
|
47
60
|
|
61
|
+
end
|
48
62
|
return element, new_attributes
|
49
63
|
end
|
50
64
|
|
51
65
|
def what_was_selected(element, attributes, vars, name, scope)
|
52
|
-
send_to_app('locatineconfirmed', 'ok')
|
53
66
|
tag, index = tag_index
|
67
|
+
send_to_app('locatineconfirmed', 'ok')
|
54
68
|
mass_highlight_turn(element, false) if element
|
55
69
|
element, attributes = working_on_selected(tag, index, vars, attributes)
|
56
|
-
|
57
|
-
|
70
|
+
if element
|
71
|
+
mass_highlight_turn(element)
|
72
|
+
push_title "#{element.length} elements were selected as #{name} in "\
|
58
73
|
"#{scope}. If it is correct - confirm the selection."
|
74
|
+
end
|
59
75
|
return element, attributes
|
60
76
|
end
|
61
77
|
|
data/lib/locatine/file_work.rb
CHANGED
data/lib/locatine/public.rb
CHANGED
@@ -30,7 +30,7 @@ module Locatine
|
|
30
30
|
tolerance: 15)
|
31
31
|
browser ||= right_browser
|
32
32
|
@browser = browser
|
33
|
-
|
33
|
+
import_file(json)
|
34
34
|
@depth = depth
|
35
35
|
@learn = learn
|
36
36
|
@stability_limit = stability_limit
|
@@ -102,7 +102,7 @@ module Locatine
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def json=(value)
|
105
|
-
|
105
|
+
import_file(value)
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
data/lib/locatine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locatine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.01300'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergei Seleznev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|