locatine 0.02247 → 0.02542
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +159 -4
- data/bin/locatine-daemon.rb +8 -0
- data/lib/locatine.rb +1 -0
- data/lib/locatine/app/background.js +0 -1
- data/lib/locatine/app/content.js +1 -0
- data/lib/locatine/app/manifest.json +1 -1
- data/lib/locatine/app/popup.js +4 -2
- data/lib/locatine/daemon.rb +93 -0
- data/lib/locatine/daemon_helpers.rb +52 -0
- data/lib/locatine/for_search/data_generate.rb +12 -45
- data/lib/locatine/for_search/data_logic.rb +32 -10
- data/lib/locatine/for_search/defaults.rb +40 -0
- data/lib/locatine/for_search/dialog_logic.rb +31 -8
- data/lib/locatine/for_search/element_selection.rb +4 -4
- data/lib/locatine/for_search/file_work.rb +10 -10
- data/lib/locatine/for_search/find_by_guess.rb +40 -38
- data/lib/locatine/for_search/find_by_locator.rb +0 -30
- data/lib/locatine/for_search/find_by_magic.rb +30 -81
- data/lib/locatine/for_search/find_logic.rb +6 -2
- data/lib/locatine/for_search/helpers.rb +21 -12
- data/lib/locatine/for_search/listening.rb +1 -0
- data/lib/locatine/for_search/merge.rb +2 -1
- data/lib/locatine/for_search/page_work.rb +126 -0
- data/lib/locatine/for_search/public.rb +35 -22
- data/lib/locatine/for_search/saying.rb +15 -2
- data/lib/locatine/for_search/xpath_generator.rb +10 -11
- data/lib/locatine/large_scripts/element.js +30 -0
- data/lib/locatine/large_scripts/page.js +60 -0
- data/lib/locatine/scope.rb +1 -0
- data/lib/locatine/search.rb +8 -3
- data/lib/locatine/version.rb +1 -1
- metadata +23 -16
- data/lib/locatine/for_search/find_by_css.rb +0 -47
data/lib/locatine/scope.rb
CHANGED
@@ -80,6 +80,7 @@ module Locatine
|
|
80
80
|
item = @search.send(:ask, @scope, '', nil, vars)
|
81
81
|
return find_all(vars) if item[:element].nil?
|
82
82
|
|
83
|
+
@search.send(:set_env_for_search, nil, nil, nil, nil, nil, nil)
|
83
84
|
@search.send(:store, item[:attributes], @scope, item[:name])
|
84
85
|
new_define(vars)
|
85
86
|
end
|
data/lib/locatine/search.rb
CHANGED
@@ -8,12 +8,13 @@ require 'locatine/for_search/merge'
|
|
8
8
|
require 'locatine/for_search/public'
|
9
9
|
require 'locatine/for_search/saying'
|
10
10
|
require 'locatine/for_search/helpers'
|
11
|
+
require 'locatine/for_search/defaults'
|
11
12
|
require 'locatine/for_search/file_work'
|
13
|
+
require 'locatine/for_search/page_work'
|
12
14
|
require 'locatine/for_search/listening'
|
13
15
|
require 'locatine/for_search/highlight'
|
14
16
|
require 'locatine/for_search/data_logic'
|
15
17
|
require 'locatine/for_search/find_logic'
|
16
|
-
require 'locatine/for_search/find_by_css'
|
17
18
|
require 'locatine/for_search/name_helper'
|
18
19
|
require 'locatine/for_search/dialog_logic'
|
19
20
|
require 'locatine/for_search/find_by_magic'
|
@@ -33,12 +34,13 @@ module Locatine
|
|
33
34
|
include Locatine::ForSearch::Public
|
34
35
|
include Locatine::ForSearch::Saying
|
35
36
|
include Locatine::ForSearch::Helpers
|
37
|
+
include Locatine::ForSearch::Defaults
|
36
38
|
include Locatine::ForSearch::FileWork
|
39
|
+
include Locatine::ForSearch::PageWork
|
37
40
|
include Locatine::ForSearch::DataLogic
|
38
41
|
include Locatine::ForSearch::Listening
|
39
42
|
include Locatine::ForSearch::FindLogic
|
40
43
|
include Locatine::ForSearch::Highlight
|
41
|
-
include Locatine::ForSearch::FindByCss
|
42
44
|
include Locatine::ForSearch::NameHelper
|
43
45
|
include Locatine::ForSearch::FindByMagic
|
44
46
|
include Locatine::ForSearch::DialogLogic
|
@@ -55,7 +57,10 @@ module Locatine
|
|
55
57
|
:scope,
|
56
58
|
:tolerance,
|
57
59
|
:visual_search,
|
58
|
-
:no_fail
|
60
|
+
:no_fail,
|
61
|
+
:trusted,
|
62
|
+
:untrusted,
|
63
|
+
:autolearn
|
59
64
|
attr_reader :json,
|
60
65
|
:browser
|
61
66
|
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.02542'
|
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-
|
11
|
+
date: 2019-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,46 +81,48 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '6.16'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: webdrivers
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '4.0'
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 4.0.1
|
90
93
|
type: :runtime
|
91
94
|
prerelease: false
|
92
95
|
version_requirements: !ruby/object:Gem::Requirement
|
93
96
|
requirements:
|
94
97
|
- - "~>"
|
95
98
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
99
|
+
version: '4.0'
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 4.0.1
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
104
|
+
name: sinatra
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
100
106
|
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '3.8'
|
104
107
|
- - ">="
|
105
108
|
- !ruby/object:Gem::Version
|
106
|
-
version:
|
109
|
+
version: 2.0.5
|
107
110
|
type: :runtime
|
108
111
|
prerelease: false
|
109
112
|
version_requirements: !ruby/object:Gem::Requirement
|
110
113
|
requirements:
|
111
|
-
- - "~>"
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
version: '3.8'
|
114
114
|
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
116
|
+
version: 2.0.5
|
117
117
|
description: The main goal to write locators never
|
118
118
|
email: s_seleznev_qa@hotmail.com
|
119
|
-
executables:
|
119
|
+
executables:
|
120
|
+
- locatine-daemon.rb
|
120
121
|
extensions: []
|
121
122
|
extra_rdoc_files: []
|
122
123
|
files:
|
123
124
|
- README.md
|
125
|
+
- bin/locatine-daemon.rb
|
124
126
|
- lib/locatine.rb
|
125
127
|
- lib/locatine/app/background.js
|
126
128
|
- lib/locatine/app/content.css
|
@@ -131,13 +133,15 @@ files:
|
|
131
133
|
- lib/locatine/app/popup.css
|
132
134
|
- lib/locatine/app/popup.html
|
133
135
|
- lib/locatine/app/popup.js
|
136
|
+
- lib/locatine/daemon.rb
|
137
|
+
- lib/locatine/daemon_helpers.rb
|
134
138
|
- lib/locatine/for_search.rb
|
135
139
|
- lib/locatine/for_search/data_generate.rb
|
136
140
|
- lib/locatine/for_search/data_logic.rb
|
141
|
+
- lib/locatine/for_search/defaults.rb
|
137
142
|
- lib/locatine/for_search/dialog_logic.rb
|
138
143
|
- lib/locatine/for_search/element_selection.rb
|
139
144
|
- lib/locatine/for_search/file_work.rb
|
140
|
-
- lib/locatine/for_search/find_by_css.rb
|
141
145
|
- lib/locatine/for_search/find_by_guess.rb
|
142
146
|
- lib/locatine/for_search/find_by_locator.rb
|
143
147
|
- lib/locatine/for_search/find_by_magic.rb
|
@@ -147,11 +151,14 @@ files:
|
|
147
151
|
- lib/locatine/for_search/listening.rb
|
148
152
|
- lib/locatine/for_search/merge.rb
|
149
153
|
- lib/locatine/for_search/name_helper.rb
|
154
|
+
- lib/locatine/for_search/page_work.rb
|
150
155
|
- lib/locatine/for_search/public.rb
|
151
156
|
- lib/locatine/for_search/saying.rb
|
152
157
|
- lib/locatine/for_search/xpath_generator.rb
|
153
158
|
- lib/locatine/large_scripts/css.js
|
154
159
|
- lib/locatine/large_scripts/dimensions.js
|
160
|
+
- lib/locatine/large_scripts/element.js
|
161
|
+
- lib/locatine/large_scripts/page.js
|
155
162
|
- lib/locatine/scope.rb
|
156
163
|
- lib/locatine/search.rb
|
157
164
|
- lib/locatine/version.rb
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module Locatine
|
2
|
-
module ForSearch
|
3
|
-
##
|
4
|
-
# Looking for elements by css values
|
5
|
-
module FindByCss
|
6
|
-
private
|
7
|
-
|
8
|
-
def css_array_by_data(data, vars)
|
9
|
-
q_css = []
|
10
|
-
get_trusted(data['0']).each do |hash|
|
11
|
-
if hash['type'] == 'css'
|
12
|
-
value = process_string(hash['value'], vars) if vars[hash['name']]
|
13
|
-
q_css.push("#{hash['name']}: #{value || hash['value']}")
|
14
|
-
end
|
15
|
-
end
|
16
|
-
q_css
|
17
|
-
end
|
18
|
-
|
19
|
-
def return_caught_elements(caught)
|
20
|
-
all = []
|
21
|
-
caught.each do |i|
|
22
|
-
@help_hash[i[0]] ||= engine.elements(tag_name: i[0].downcase).to_a
|
23
|
-
elm = @help_hash[i[0]][i[1].to_i]
|
24
|
-
all.push(elm) if elm
|
25
|
-
end
|
26
|
-
all
|
27
|
-
end
|
28
|
-
|
29
|
-
def select_elements_from_raws_by_css(q_css, raws)
|
30
|
-
all = []
|
31
|
-
@help_hash = {}
|
32
|
-
q_css.each do |item|
|
33
|
-
caught = (raws.select { |i| i[2].include?(item) })
|
34
|
-
all += return_caught_elements(caught)
|
35
|
-
end
|
36
|
-
all
|
37
|
-
end
|
38
|
-
|
39
|
-
def full_find_by_css(data, vars)
|
40
|
-
q_css = css_array_by_data(data, vars)
|
41
|
-
script = File.read("#{HOME}/large_scripts/css.js")
|
42
|
-
raws = engine.execute_script(script)
|
43
|
-
select_elements_from_raws_by_css(q_css, raws)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|