locatine 0.02432 → 0.02535
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 +4 -4
- data/README.md +13 -1
- data/lib/locatine/app/manifest.json +1 -1
- data/lib/locatine/for_search/defaults.rb +3 -2
- data/lib/locatine/for_search/find_logic.rb +4 -1
- data/lib/locatine/for_search/public.rb +7 -2
- data/lib/locatine/search.rb +2 -1
- data/lib/locatine/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47bfe24e1d440f14261360ee0a4b262a7b495624
|
|
4
|
+
data.tar.gz: ac4af7f07c3db70cbbb745cc68702701f97e442a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62e7a41f9b48b5187bff739b44591632e4a0e98dd69ec72f1683eaeca4d48347d16c78aeb97082db53d7d2a32ba38d743d0abc0dc7f4a7fb330ba86fd5203b4f
|
|
7
|
+
data.tar.gz: be450e5dd42e70b9fc0050c5349932fe43901377d35ef2d6c719fabc22419e2dc80eabb4f3415f3133e58fcc6a1d7cd0c9d6cb2cb5148f9a4a7fd1d642d62173
|
data/README.md
CHANGED
|
@@ -16,7 +16,7 @@ That's it.
|
|
|
16
16
|
|
|
17
17
|
## Stage of development:
|
|
18
18
|
|
|
19
|
-
Version of Locatine is **0.
|
|
19
|
+
Version of Locatine is **0.02535** only. It means so far this is an alfa. You can use it in a real project if you are a risky person.
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
@@ -155,6 +155,18 @@ If you are sure that some attribute (or something) is not good(generated by rand
|
|
|
155
155
|
|
|
156
156
|
On the other hand you can force locatine to always trust something with trusted.
|
|
157
157
|
|
|
158
|
+
### autolearn
|
|
159
|
+
|
|
160
|
+
Determines wether Locatine will study elements by default or not.
|
|
161
|
+
|
|
162
|
+
If true Locatine will always check element for changes even if it is found properly (to catch for example adding of a new attribute). This is slow.
|
|
163
|
+
|
|
164
|
+
If false Locatine will study element only in case when it is lost.
|
|
165
|
+
|
|
166
|
+
If not stated Locatine will use false until it is not facing any lost element. After the first lost element it will be studying everything (true).
|
|
167
|
+
|
|
168
|
+
Notice that if autolearn is false Locatine is not bumping the stability values of attributes for elements which were found normally.
|
|
169
|
+
|
|
158
170
|
## Changing options on fly
|
|
159
171
|
|
|
160
172
|
You can get or set these values on fly. Like:
|
|
@@ -9,13 +9,14 @@ module Locatine
|
|
|
9
9
|
depth: 3,
|
|
10
10
|
browser: nil,
|
|
11
11
|
learn: ENV['LEARN'].nil? ? false : true,
|
|
12
|
-
stability_limit:
|
|
12
|
+
stability_limit: 10,
|
|
13
13
|
scope: 'Default',
|
|
14
14
|
tolerance: 67,
|
|
15
15
|
visual_search: false,
|
|
16
16
|
no_fail: false,
|
|
17
17
|
trusted: [],
|
|
18
|
-
untrusted: []
|
|
18
|
+
untrusted: [],
|
|
19
|
+
autolearn: nil
|
|
19
20
|
}
|
|
20
21
|
end
|
|
21
22
|
|
|
@@ -15,6 +15,8 @@ module Locatine
|
|
|
15
15
|
result = find_by_data(@data[scope][name], vars)
|
|
16
16
|
attributes = generate_data(result, vars) if result
|
|
17
17
|
if !result && !exact
|
|
18
|
+
@autolearn = true if @autolearn.nil?
|
|
19
|
+
@save = true
|
|
18
20
|
result, attributes = find_by_magic(name, scope,
|
|
19
21
|
@data[scope][name], vars)
|
|
20
22
|
end
|
|
@@ -29,9 +31,10 @@ module Locatine
|
|
|
29
31
|
end
|
|
30
32
|
|
|
31
33
|
def full_search(name, scope, vars, locator, exact)
|
|
34
|
+
@save = @autolearn
|
|
32
35
|
result, attributes = search_steps(name, scope, vars, locator, exact)
|
|
33
36
|
raise_not_found(name, scope) if !result && !@current_no_f
|
|
34
|
-
store(attributes, scope, name) if result
|
|
37
|
+
store(attributes, scope, name) if result && (@save || @learn)
|
|
35
38
|
return result, attributes
|
|
36
39
|
end
|
|
37
40
|
|
|
@@ -19,8 +19,8 @@ module Locatine
|
|
|
19
19
|
# +learn+ shows will locatine ask for assistance from user or will fail
|
|
20
20
|
# on error. learn is true when LEARN parameter is set in environment.
|
|
21
21
|
#
|
|
22
|
-
# +stability_limit+ shows max times attribute should be present
|
|
23
|
-
# consider it trusted.
|
|
22
|
+
# +stability_limit+ shows max times attribute should be present and
|
|
23
|
+
# checked to consider it trusted.
|
|
24
24
|
#
|
|
25
25
|
# +scope+ will be used in search (if not provided) defaulkt is "Default"
|
|
26
26
|
#
|
|
@@ -38,6 +38,11 @@ module Locatine
|
|
|
38
38
|
#
|
|
39
39
|
# +untrusted+ array of names of attributes and element params to use
|
|
40
40
|
# in search never.
|
|
41
|
+
#
|
|
42
|
+
# +autolearn+ determines will locatine study an element or not. true means
|
|
43
|
+
# locatine will always study it (slow). false means it won't study it
|
|
44
|
+
# unless it was lost and found. If not stated locatine will turn set it
|
|
45
|
+
# true if at least one element was lost.
|
|
41
46
|
def initialize(config = {})
|
|
42
47
|
init_config = default_init_config.merge(config)
|
|
43
48
|
import_browser init_config.delete :browser
|
data/lib/locatine/search.rb
CHANGED
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.02535'
|
|
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-06-
|
|
11
|
+
date: 2019-06-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -80,20 +80,6 @@ dependencies:
|
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '6.16'
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: json
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - "~>"
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '2.0'
|
|
90
|
-
type: :runtime
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - "~>"
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '2.0'
|
|
97
83
|
- !ruby/object:Gem::Dependency
|
|
98
84
|
name: webdrivers
|
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|