selenium-webdriver 4.51.0 → 4.52.0

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +15 -0
  3. data/Gemfile +14 -0
  4. data/README.md +20 -0
  5. data/bin/linux-arm64/selenium-manager +0 -0
  6. data/bin/linux-x86_64/selenium-manager +0 -0
  7. data/bin/macos/selenium-manager +0 -0
  8. data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +543 -226
  9. data/bin/selenium-manager.cdx.json +804 -722
  10. data/bin/windows/selenium-manager.exe +0 -0
  11. data/lib/selenium/webdriver/atoms/findElements.js +960 -250
  12. data/lib/selenium/webdriver/atoms/getAttribute.js +153 -127
  13. data/lib/selenium/webdriver/atoms/isDisplayed.js +433 -364
  14. data/lib/selenium/webdriver/atoms.rb +4 -1
  15. data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +6 -6
  16. data/lib/selenium/webdriver/bidi/protocol/browser.rb +21 -9
  17. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +109 -39
  18. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +89 -44
  19. data/lib/selenium/webdriver/bidi/protocol/input.rb +95 -31
  20. data/lib/selenium/webdriver/bidi/protocol/log.rb +4 -4
  21. data/lib/selenium/webdriver/bidi/protocol/moz_debugging.rb +12 -10
  22. data/lib/selenium/webdriver/bidi/protocol/moz_profiler.rb +4 -4
  23. data/lib/selenium/webdriver/bidi/protocol/network.rb +82 -39
  24. data/lib/selenium/webdriver/bidi/protocol/script.rb +38 -24
  25. data/lib/selenium/webdriver/bidi/protocol/session.rb +61 -8
  26. data/lib/selenium/webdriver/bidi/protocol/storage.rb +3 -3
  27. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +3 -3
  28. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +17 -9
  29. data/lib/selenium/webdriver/bidi/serialization/record.rb +66 -24
  30. data/lib/selenium/webdriver/bidi/serialization.rb +2 -2
  31. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +228 -150
  32. data/lib/selenium/webdriver/common/client_config.rb +4 -1
  33. data/lib/selenium/webdriver/common/driver_finder.rb +5 -2
  34. data/lib/selenium/webdriver/common/websocket_connection.rb +51 -13
  35. data/lib/selenium/webdriver/remote/http/default.rb +17 -1
  36. data/lib/selenium/webdriver/version.rb +1 -1
  37. data/selenium-webdriver.gemspec +0 -12
  38. metadata +6 -163
@@ -1,155 +1,181 @@
1
1
  (function () {
2
- function get(element, attribute) {
2
+ var __seleniumAtom = (() => {
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // javascript/atoms/typescript/get-attribute.ts
22
+ var get_attribute_exports = {};
23
+ __export(get_attribute_exports, {
24
+ default: () => get_attribute_default
25
+ });
26
+ function get(element, attribute) {
3
27
  const PROPERTY_ALIASES = {
4
- 'class': 'className',
5
- 'readonly': 'readOnly',
28
+ "class": "className",
29
+ "readonly": "readOnly"
6
30
  };
7
- const BOOLEAN_PROPERTIES = new Set([
8
- 'allowfullscreen',
9
- 'allowpaymentrequest',
10
- 'allowusermedia',
11
- 'async',
12
- 'autofocus',
13
- 'autoplay',
14
- 'checked',
15
- 'compact',
16
- 'complete',
17
- 'controls',
18
- 'declare',
19
- 'default',
20
- 'defaultchecked',
21
- 'defaultselected',
22
- 'defer',
23
- 'disabled',
24
- 'ended',
25
- 'formnovalidate',
26
- 'hidden',
27
- 'indeterminate',
28
- 'iscontenteditable',
29
- 'ismap',
30
- 'itemscope',
31
- 'loop',
32
- 'multiple',
33
- 'muted',
34
- 'nohref',
35
- 'nomodule',
36
- 'noresize',
37
- 'noshade',
38
- 'novalidate',
39
- 'nowrap',
40
- 'open',
41
- 'paused',
42
- 'playsinline',
43
- 'pubdate',
44
- 'readonly',
45
- 'required',
46
- 'reversed',
47
- 'scoped',
48
- 'seamless',
49
- 'seeking',
50
- 'selected',
51
- 'truespeed',
52
- 'typemustmatch',
53
- 'willvalidate',
31
+ const BOOLEAN_PROPERTIES = /* @__PURE__ */ new Set([
32
+ "allowfullscreen",
33
+ "allowpaymentrequest",
34
+ "allowusermedia",
35
+ "async",
36
+ "autofocus",
37
+ "autoplay",
38
+ "checked",
39
+ "compact",
40
+ "complete",
41
+ "controls",
42
+ "declare",
43
+ "default",
44
+ "defaultchecked",
45
+ "defaultselected",
46
+ "defer",
47
+ "disabled",
48
+ "ended",
49
+ "formnovalidate",
50
+ "hidden",
51
+ "indeterminate",
52
+ "iscontenteditable",
53
+ "ismap",
54
+ "itemscope",
55
+ "loop",
56
+ "multiple",
57
+ "muted",
58
+ "nohref",
59
+ "nomodule",
60
+ "noresize",
61
+ "noshade",
62
+ "novalidate",
63
+ "nowrap",
64
+ "open",
65
+ "paused",
66
+ "playsinline",
67
+ "pubdate",
68
+ "readonly",
69
+ "required",
70
+ "reversed",
71
+ "scoped",
72
+ "seamless",
73
+ "seeking",
74
+ "selected",
75
+ "truespeed",
76
+ "typemustmatch",
77
+ "willvalidate"
54
78
  ]);
55
- function getAttribute(element, attributeName) {
56
- return element.getAttribute(attributeName.toLowerCase());
79
+ function getAttribute(element2, attributeName) {
80
+ return element2.getAttribute(attributeName.toLowerCase());
57
81
  }
58
- function getProperty(element, propertyName) {
59
- return element[propertyName];
82
+ function getProperty(element2, propertyName) {
83
+ return element2[propertyName];
60
84
  }
61
85
  function isElement(node, tagName) {
62
- const elem = node;
63
- if (!elem || elem.nodeType !== 1) {
64
- return false;
65
- }
66
- if (!tagName) {
67
- return true;
68
- }
69
- const normalizedTag = tagName.toUpperCase();
70
- if (node instanceof HTMLFormElement) {
71
- return normalizedTag === 'FORM';
72
- }
73
- return typeof elem.tagName === 'string' && elem.tagName.toUpperCase() === normalizedTag;
74
- }
75
- function isSelectable(element) {
76
- if (isElement(element, 'OPTION')) {
77
- return true;
78
- }
79
- if (isElement(element, 'INPUT')) {
80
- const type = element.type.toLowerCase();
81
- return type === 'checkbox' || type === 'radio';
82
- }
86
+ const elem = node;
87
+ if (!elem || elem.nodeType !== 1) {
83
88
  return false;
89
+ }
90
+ if (!tagName) {
91
+ return true;
92
+ }
93
+ const normalizedTag = tagName.toUpperCase();
94
+ if (node instanceof HTMLFormElement) {
95
+ return normalizedTag === "FORM";
96
+ }
97
+ return typeof elem.tagName === "string" && elem.tagName.toUpperCase() === normalizedTag;
84
98
  }
85
- function isSelected(element) {
86
- var _a;
87
- if (isElement(element, 'OPTION')) {
88
- return element.selected;
89
- }
90
- const type = (_a = element.type) === null || _a === void 0 ? void 0 : _a.toLowerCase();
91
- if (type === 'checkbox' || type === 'radio') {
92
- return element.checked;
93
- }
94
- return false;
99
+ function isSelectable(element2) {
100
+ if (isElement(element2, "OPTION")) {
101
+ return true;
102
+ }
103
+ if (isElement(element2, "INPUT")) {
104
+ const type = element2.type.toLowerCase();
105
+ return type === "checkbox" || type === "radio";
106
+ }
107
+ return false;
108
+ }
109
+ function isSelected(element2) {
110
+ var _a;
111
+ if (isElement(element2, "OPTION")) {
112
+ return element2.selected;
113
+ }
114
+ const type = (_a = element2.type) == null ? void 0 : _a.toLowerCase();
115
+ if (type === "checkbox" || type === "radio") {
116
+ return element2.checked;
117
+ }
118
+ return false;
95
119
  }
96
120
  function isObject(value) {
97
- return value !== null && (typeof value === 'object' || typeof value === 'function');
121
+ return value !== null && (typeof value === "object" || typeof value === "function");
98
122
  }
99
123
  const name = attribute.toLowerCase();
100
- if (name === 'style') {
101
- const style = element.style;
102
- if (!style) {
103
- return null;
104
- }
105
- return typeof style === 'string' ? style : style.cssText;
124
+ if (name === "style") {
125
+ const style = element.style;
126
+ if (!style) {
127
+ return null;
128
+ }
129
+ return typeof style === "string" ? style : style.cssText;
106
130
  }
107
- if ((name === 'selected' || name === 'checked') && isSelectable(element)) {
108
- return isSelected(element) ? 'true' : null;
131
+ if ((name === "selected" || name === "checked") && isSelectable(element)) {
132
+ return isSelected(element) ? "true" : null;
109
133
  }
110
- const isLink = isElement(element, 'A');
111
- const isImg = isElement(element, 'IMG');
112
- if ((isImg && name === 'src') || (isLink && name === 'href')) {
113
- const attrValue = getAttribute(element, name);
114
- if (attrValue) {
115
- return String(getProperty(element, name));
116
- }
117
- return attrValue;
134
+ const isLink = isElement(element, "A");
135
+ const isImg = isElement(element, "IMG");
136
+ if (isImg && name === "src" || isLink && name === "href") {
137
+ const attrValue = getAttribute(element, name);
138
+ if (attrValue) {
139
+ return String(getProperty(element, name));
140
+ }
141
+ return attrValue;
118
142
  }
119
- if (name === 'spellcheck') {
120
- const attrValue = getAttribute(element, name);
121
- if (attrValue !== null) {
122
- const lower = attrValue.toLowerCase();
123
- if (lower === 'false') {
124
- return 'false';
125
- }
126
- if (lower === 'true') {
127
- return 'true';
128
- }
143
+ if (name === "spellcheck") {
144
+ const attrValue = getAttribute(element, name);
145
+ if (attrValue !== null) {
146
+ const lower = attrValue.toLowerCase();
147
+ if (lower === "false") {
148
+ return "false";
129
149
  }
130
- return String(getProperty(element, name));
150
+ if (lower === "true") {
151
+ return "true";
152
+ }
153
+ }
154
+ return String(getProperty(element, name));
131
155
  }
132
156
  const propName = PROPERTY_ALIASES[name] || attribute;
133
157
  if (BOOLEAN_PROPERTIES.has(name)) {
134
- const hasAttr = element.getAttribute(name) !== null;
135
- const propValue = getProperty(element, propName);
136
- return hasAttr || !!propValue ? 'true' : null;
158
+ const hasAttr = element.getAttribute(name) !== null;
159
+ const propValue = getProperty(element, propName);
160
+ return hasAttr || !!propValue ? "true" : null;
137
161
  }
138
- if (name === 'value' && isElement(element, 'LI')) {
139
- const attrValue = element.getAttribute(name);
140
- return attrValue != null ? attrValue : null;
162
+ if (name === "value" && isElement(element, "LI")) {
163
+ const attrValue = element.getAttribute(name);
164
+ return attrValue != null ? attrValue : null;
141
165
  }
142
166
  let property;
143
167
  try {
144
- property = getProperty(element, propName);
145
- }
146
- catch (_e) {
168
+ property = getProperty(element, propName);
169
+ } catch (_e) {
147
170
  }
148
171
  if (property == null || isObject(property)) {
149
- const attrValue = element.getAttribute(name);
150
- return attrValue != null ? attrValue : null;
172
+ const attrValue = element.getAttribute(name);
173
+ return attrValue != null ? attrValue : null;
151
174
  }
152
175
  return property != null ? String(property) : null;
153
- }
154
- return get;
155
- })()
176
+ }
177
+ var get_attribute_default = get;
178
+ return __toCommonJS(get_attribute_exports);
179
+ })();
180
+ return __seleniumAtom.default;
181
+ })()