rudra 1.0.13 → 1.0.14
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/lib/rudra.rb +23 -14
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f065383cc3c1a776dccc5708a77f627383aaa63f4198b087adad977271f713d6
|
4
|
+
data.tar.gz: 9fc4e3d993f3d3a1b4fb53d57b146df87fe8fa5e561308b726a3c8c46dd5ac1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f80dd1cc85e183b9ac7ac2be6831a2e1ac56be27ab884133fcbfc4b0f87e03a23d4d9443bd933cfef69292c881d968b2033d3af8cd5a72c909ba8474afcce03
|
7
|
+
data.tar.gz: ad1f215b1ea9c9f6d16e387f95f1a5f9c087845c2db3239d0f64ea719e94241805578fe1a3589b69dafc0207fcc10b6589677259ecb87939752ab0fd0d5c9a52
|
data/lib/rudra.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'selenium-webdriver'
|
2
2
|
require 'webdrivers/chromedriver'
|
3
3
|
require 'webdrivers/geckodriver'
|
4
|
+
require 'webdrivers/iedriver'
|
4
5
|
|
5
6
|
# Selenium::WebDriver::Chrome::Service.driver_path = './webdrivers/chromedriver'
|
6
7
|
# Selenium::WebDriver::Firefox::Service.driver_path = './webdrivers/geckodriver'
|
@@ -16,7 +17,7 @@ require 'webdrivers/geckodriver'
|
|
16
17
|
# @attr_reader [Boolean] verbose Verbose mode
|
17
18
|
class Rudra
|
18
19
|
# Supported Browsers
|
19
|
-
BROWSERS = %i[chrome firefox safari].freeze
|
20
|
+
BROWSERS = %i[chrome firefox ie safari].freeze
|
20
21
|
|
21
22
|
# Element Finder Methods
|
22
23
|
HOWS = %i[
|
@@ -51,19 +52,11 @@ class Rudra
|
|
51
52
|
self.headless = options.fetch(:headless, false)
|
52
53
|
self.log_prefix = options.fetch(:log_prefix, ' - ')
|
53
54
|
self.verbose = options.fetch(:verbose, true)
|
55
|
+
self.main_label = caller_locations(2, 1).first.label
|
54
56
|
|
55
57
|
initialize_driver
|
56
58
|
|
57
59
|
self.timeout = options.fetch(:timeout, 30)
|
58
|
-
|
59
|
-
@main_label = caller_locations(2, 1).first.label
|
60
|
-
@verbose && (
|
61
|
-
puts %(
|
62
|
-
============ Rudra ============
|
63
|
-
Browser: #{@browser}, Locale: #{@locale}
|
64
|
-
============ Log ============
|
65
|
-
).lines.map(&:strip).reject(&:empty?).join("\n")
|
66
|
-
)
|
67
60
|
end
|
68
61
|
|
69
62
|
#
|
@@ -1066,9 +1059,7 @@ class Rudra
|
|
1066
1059
|
end
|
1067
1060
|
|
1068
1061
|
(instance_methods - superclass.instance_methods).map do |method_name|
|
1069
|
-
if private_method_defined?(method_name) || ATTRIBUTES.include?(method_name)
|
1070
|
-
next
|
1071
|
-
end
|
1062
|
+
next if private_method_defined?(method_name) || ATTRIBUTES.include?(method_name)
|
1072
1063
|
|
1073
1064
|
original_method = instance_method(method_name)
|
1074
1065
|
|
@@ -1080,6 +1071,8 @@ class Rudra
|
|
1080
1071
|
|
1081
1072
|
private
|
1082
1073
|
|
1074
|
+
attr_writer :main_label
|
1075
|
+
|
1083
1076
|
def browser=(brw)
|
1084
1077
|
unless BROWSERS.include?(brw)
|
1085
1078
|
browsers = BROWSERS.map { |b| ":#{b}" }.join(', ')
|
@@ -1129,6 +1122,8 @@ class Rudra
|
|
1129
1122
|
Selenium::WebDriver.for(:chrome, options: chrome_options)
|
1130
1123
|
elsif browser == :firefox
|
1131
1124
|
Selenium::WebDriver.for(:firefox, options: firefox_options)
|
1125
|
+
elsif browser == :ie
|
1126
|
+
Selenium::WebDriver.for(:ie, options: ie_options)
|
1132
1127
|
else
|
1133
1128
|
Selenium::WebDriver.for(:safari)
|
1134
1129
|
end
|
@@ -1138,6 +1133,10 @@ class Rudra
|
|
1138
1133
|
options = Selenium::WebDriver::Chrome::Options.new
|
1139
1134
|
options.add_argument('--disable-notifications')
|
1140
1135
|
options.add_argument('--headless') if headless
|
1136
|
+
options.add_option(
|
1137
|
+
'excludeSwitches',
|
1138
|
+
%w[enable-automation enable-logging]
|
1139
|
+
)
|
1141
1140
|
options.add_preference('intl.accept_languages', locale)
|
1142
1141
|
options
|
1143
1142
|
end
|
@@ -1149,6 +1148,16 @@ class Rudra
|
|
1149
1148
|
options
|
1150
1149
|
end
|
1151
1150
|
|
1151
|
+
def ie_options
|
1152
|
+
options = Selenium::WebDriver::IE::Options.new
|
1153
|
+
options.ensure_clean_session = true
|
1154
|
+
options.full_page_screenshot = true
|
1155
|
+
options.ignore_protected_mode_settings = true
|
1156
|
+
options.ignore_zoom_level = true
|
1157
|
+
options.native_events = false
|
1158
|
+
options
|
1159
|
+
end
|
1160
|
+
|
1152
1161
|
def parse_locator(locator)
|
1153
1162
|
unmatched, how, what = locator.split(/^([A-Za-z]+)=(.+)/)
|
1154
1163
|
|
@@ -1170,7 +1179,7 @@ class Rudra
|
|
1170
1179
|
end
|
1171
1180
|
|
1172
1181
|
def log(method_name, *args)
|
1173
|
-
return unless @verbose && caller_locations(2, 1).first.label ==
|
1182
|
+
return unless @verbose && caller_locations(2, 1).first.label == main_label
|
1174
1183
|
|
1175
1184
|
arguments = args.map(&:to_s).join(', ')
|
1176
1185
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rudra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9.
|
19
|
+
version: 0.9.25
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9.
|
26
|
+
version: 0.9.25
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: selenium-webdriver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -48,24 +48,24 @@ dependencies:
|
|
48
48
|
name: webdrivers
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - ">="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 4.3.0
|
54
51
|
- - "~>"
|
55
52
|
- !ruby/object:Gem::Version
|
56
|
-
version: '4.
|
53
|
+
version: '4.4'
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 4.4.1
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - ">="
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: 4.3.0
|
64
61
|
- - "~>"
|
65
62
|
- !ruby/object:Gem::Version
|
66
|
-
version: '4.
|
63
|
+
version: '4.4'
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 4.4.1
|
67
67
|
description: Selenium IDE alternative using selenium-webdriver
|
68
|
-
email: aaron@
|
68
|
+
email: aaron@611b.com
|
69
69
|
executables: []
|
70
70
|
extensions: []
|
71
71
|
extra_rdoc_files: []
|