1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
U
[±d¸Vã@säddlmZddlmZmZddlmZddlZddlZddl    m
Z
ddl    m Z ddl    m Z Gd    d
„d
e ƒZGd d „d ejƒZGd d„dejƒZGdd„dejƒZeGdd„dƒƒZeGdd„dƒƒZeGdd„dƒƒZeGdd„dƒƒZGdd„dejƒZeGdd„dƒƒZddœdd „Zddœd!d"„ZdDd#d$d%d&d'd(œd)d*„ZdEd+d,d'd-œd.d/„ZdFd,d0d1œd2d3„ZdGd#d$d%d'd4œd5d6„ZdHd
d,d'd7œd8d9„ZdId#d$d%d:d:d'd;œd<d=„Z ed>ƒeGd?d@„d@ƒƒƒZ!edAƒeGdBdC„dCƒƒƒZ"dS)Jé)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassN)Údom)Úpage)ÚruntimecsBeZdZdZddœdd„Zedddœdd„ƒZ‡fd    d
„Z‡ZS) ÚAXNodeIdz/
    Unique accessibility node identifier.
    Ústr©ÚreturncCs|S©N©©Úselfrrúld:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v112/accessibility.pyÚto_jsonszAXNodeId.to_json©Újsonr cCs||ƒSrr©ÚclsrrrrÚ    from_jsonszAXNodeId.from_jsoncsd tƒ ¡¡S)Nz AXNodeId({}))ÚformatÚsuperÚ__repr__r©Ú    __class__rrrszAXNodeId.__repr__)    Ú__name__Ú
__module__Ú __qualname__Ú__doc__rÚ classmethodrrÚ __classcell__rrrrr
s
r
c@sheZdZdZdZdZdZdZdZdZ    dZ
d    Z d
Z d Z d Zd ZdZdZdZdZdZdd„Zedd„ƒZdS)Ú AXValueTypez*
    Enum of possible property types.
    ÚbooleanZtristateZbooleanOrUndefinedÚidrefZ    idrefListÚintegerÚnodeZnodeListÚnumberÚstringZcomputedStringÚtokenZ    tokenListZ domRelationÚroleZ internalRoleZvalueUndefinedcCs|jSr©Úvaluerrrrr6szAXValueType.to_jsoncCs||ƒSrrrrrrr9szAXValueType.from_jsonN)rrr r!ÚBOOLEANZTRISTATEZBOOLEAN_OR_UNDEFINEDZIDREFZ
IDREF_LISTZINTEGERZNODEZ    NODE_LISTÚNUMBERÚSTRINGZCOMPUTED_STRINGZTOKENZ
TOKEN_LISTZ DOM_RELATIONZROLEZ INTERNAL_ROLEZVALUE_UNDEFINEDrr"rrrrrr$ s*r$c@s<eZdZdZdZdZdZdZdZdZ    dd    „Z
e d
d „ƒZ d S) ÚAXValueSourceTypez,
    Enum of possible property sources.
    Ú    attributeZimplicitÚstyleÚcontentsÚ placeholderZrelatedElementcCs|jSrr-rrrrrIszAXValueSourceType.to_jsoncCs||ƒSrrrrrrrLszAXValueSourceType.from_jsonN) rrr r!Z    ATTRIBUTEZIMPLICITZSTYLEZCONTENTSZ PLACEHOLDERZRELATED_ELEMENTrr"rrrrrr2>sr2c@sLeZdZdZdZdZdZdZdZdZ    dZ
d    Z d
Z d Z d d „Zedd„ƒZdS)ÚAXValueNativeSourceTypezd
    Enum of possible native property sources (as a subtype of a particular AXValueSourceType).
    Ú descriptionÚ
figcaptionÚlabelZlabelforZ labelwrappedZlegendZrubyannotationZ tablecaptionÚtitleÚothercCs|jSrr-rrrrr`szAXValueNativeSourceType.to_jsoncCs||ƒSrrrrrrrcsz!AXValueNativeSourceType.from_jsonN)rrr r!Z DESCRIPTIONZ
FIGCAPTIONZLABELZLABELFORZ LABELWRAPPEDZLEGENDZRUBYANNOTATIONZ TABLECAPTIONZTITLEÚOTHERrr"rrrrrr7Qsr7c@sŽeZdZUdZded<dZded<dZded<dZded    <dZd
ed <dZ    d ed <dZ
ded<dZ d
ed<dZ ded<dd„Z edd„ƒZdS)Ú AXValueSourcez5
    A single source for a computed AX property.
    r2Útype_Nútyping.Optional[AXValue]r.útyping.Optional[str]r3Úattribute_valueútyping.Optional[bool]Ú
supersededz(typing.Optional[AXValueNativeSourceType]Ú native_sourceÚnative_source_valueÚinvalidÚinvalid_reasoncCsÈtƒ}|j ¡|d<|jdk    r,|j ¡|d<|jdk    r@|j|d<|jdk    rX|j ¡|d<|jdk    rl|j|d<|jdk    r„|j ¡|d<|jdk    rœ|j ¡|d<|j    dk    r°|j    |d<|j
dk    rÄ|j
|d    <|S)
NÚtyper.r3ÚattributeValuerDÚ nativeSourceÚnativeSourceValuerGÚ invalidReason) Údictr?rr.r3rBrDrErFrGrH©rrrrrrˆs&
 
 
 
 
 
 
 
 
 
 
 
zAXValueSource.to_jsonc CsÌ|t |d¡d|kr$t |d¡ndd|kr:t|dƒndd|krRt |d¡ndd|krht|dƒndd|kr€t |d¡ndd|kr˜t |d¡ndd|kr®t|dƒndd    |krÄt|d    ƒndd
    S) NrIr.r3rJrDrKrLrGrM)    r?r.r3rBrDrErFrGrH)r2rÚAXValuer Úboolr7rrrrrs ÷zAXValueSource.from_json)rrr r!Ú__annotations__r.r3rBrDrErFrGrHrr"rrrrrr>hs
        r>c@sBeZdZUded<dZded<dZded<dd„Zed    d
„ƒZdS) Ú AXRelatedNodezdom.BackendNodeIdÚbackend_dom_node_idNrAr&ÚtextcCs@tƒ}|j ¡|d<|jdk    r(|j|d<|jdk    r<|j|d<|S)NÚbackendDOMNodeIdr&rU)rNrTrr&rUrOrrrr·s
 
 
 
zAXRelatedNode.to_jsoncCsB|tj |d¡d|kr$t|dƒndd|kr:t|dƒnddS)NrVr&rU)rTr&rU)rÚ BackendNodeIdrr rrrrrÀs
ýzAXRelatedNode.from_json)    rrr rRr&rUrr"rrrrrrS¬s
      rSc@s2eZdZUded<ded<dd„Zedd„ƒZd    S)
Ú
AXPropertyÚAXPropertyNameÚnamerPr.cCs&tƒ}|j ¡|d<|j ¡|d<|S)NrZr.)rNrZrr.rOrrrrÑszAXProperty.to_jsoncCs |t |d¡t |d¡dS)NrZr.)rZr.)rYrrPrrrrr×s  þzAXProperty.from_jsonN)rrr rRrr"rrrrrrXÉs
 
rXc@sReZdZUdZded<dZded<dZded<dZd    ed
<d d „Ze    d d„ƒZ
dS)rPz(
    A single computed AX property.
    r$r?Nztyping.Optional[typing.Any]r.z+typing.Optional[typing.List[AXRelatedNode]]Ú related_nodesz+typing.Optional[typing.List[AXValueSource]]ÚsourcescCshtƒ}|j ¡|d<|jdk    r(|j|d<|jdk    rFdd„|jDƒ|d<|jdk    rddd„|jDƒ|d<|S)NrIr.cSsg|] }| ¡‘qSr©r©Ú.0ÚirrrÚ
<listcomp>ösz#AXValue.to_json.<locals>.<listcomp>Ú relatedNodescSsg|] }| ¡‘qSrr]r^rrrraøsr\)rNr?rr.r[r\rOrrrrðs
 
 
 
zAXValue.to_jsoncCs^|t |d¡d|kr|dndd|kr:dd„|dDƒndd|krVdd„|dDƒnddS)    NrIr.rbcSsg|]}t |¡‘qSr)rSrr^rrrrasz%AXValue.from_json.<locals>.<listcomp>r\cSsg|]}t |¡‘qSr)r>rr^rrrras)r?r.r[r\)r$rrrrrrûs  üzAXValue.from_json) rrr r!rRr.r[r\rr"rrrrrrPßs
    rPc@sÀeZdZdZdZdZdZdZdZdZ    dZ
d    Z d
Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)d*„Z+e,d+d,„ƒZ-d-S).rYaµ
    Values of AXProperty name:
    - from 'busy' to 'roledescription': states which apply to every AX node
    - from 'live' to 'root': attributes which apply to nodes in live regions
    - from 'autocomplete' to 'valuetext': attributes which apply to widgets
    - from 'checked' to 'selected': states which apply to widgets
    - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling.
    ÚbusyÚdisabledÚeditableZ    focusableZfocusedÚhiddenZ
hiddenRootrGZ keyshortcutsZsettableZroledescriptionZliveZatomicZrelevantÚrootÚ autocompleteZhasPopupÚlevelZmultiselectableZ orientationÚ    multilineÚreadonlyÚrequiredZvalueminZvaluemaxZ    valuetextÚcheckedÚexpandedÚmodalZpressedÚselectedZactivedescendantÚcontrolsZ describedbyÚdetailsZ errormessageZflowtoZ
labelledbyZownscCs|jSrr-rrrrr6szAXPropertyName.to_jsoncCs||ƒSrrrrrrr9szAXPropertyName.from_jsonN).rrr r!ZBUSYZDISABLEDZEDITABLEZ    FOCUSABLEZFOCUSEDZHIDDENZ HIDDEN_ROOTÚINVALIDZ KEYSHORTCUTSZSETTABLEZROLEDESCRIPTIONZLIVEZATOMICZRELEVANTÚROOTZ AUTOCOMPLETEZ    HAS_POPUPZLEVELZMULTISELECTABLEZ ORIENTATIONÚ    MULTILINEZREADONLYZREQUIREDZVALUEMINZVALUEMAXZ    VALUETEXTZCHECKEDZEXPANDEDZMODALZPRESSEDZSELECTEDZACTIVEDESCENDANTZCONTROLSZ DESCRIBEDBYZDETAILSZ ERRORMESSAGEZFLOWTOZ
LABELLEDBYZOWNSrr"rrrrrrYsVrYc@sºeZdZUdZded<ded<dZded<dZd    ed
<dZd    ed <dZd    ed <dZ    d    ed <dZ
d    ed<dZ ded<dZ ded<dZ ded<dZded<dZded<dd„Zedd„ƒZdS)ÚAXNodez+
    A node in the accessibility tree.
    r
Únode_idrQÚignoredNz(typing.Optional[typing.List[AXProperty]]Úignored_reasonsr@r,Ú chrome_rolerZr8r.Ú
propertiesztyping.Optional[AXNodeId]Ú    parent_idz&typing.Optional[typing.List[AXNodeId]]Ú    child_idsú"typing.Optional[dom.BackendNodeId]rTútyping.Optional[page.FrameId]Úframe_idcCsBtƒ}|j ¡|d<|j|d<|jdk    r<dd„|jDƒ|d<|jdk    rT|j ¡|d<|jdk    rl|j ¡|d<|jdk    r„|j ¡|d<|jdk    rœ|j ¡|d    <|j    dk    r´|j     ¡|d
<|j
dk    rÒd d„|j
Dƒ|d <|j dk    rê|j  ¡|d <|j dk    r
dd„|j Dƒ|d<|j dk    r$|j  ¡|d<|jdk    r>|j ¡|d<|S)NÚnodeIdrxcSsg|] }| ¡‘qSrr]r^rrrraosz"AXNode.to_json.<locals>.<listcomp>ÚignoredReasonsr,Ú
chromeRolerZr8r.cSsg|] }| ¡‘qSrr]r^rrrra{sr{ÚparentIdcSsg|] }| ¡‘qSrr]r^rrrrasÚchildIdsrVÚframeId)rNrwrrxryr,rzrZr8r.r{r|r}rTr€rOrrrrjs4
 
 
 
 
 
 
 
 
   zAXNode.to_jsoncCs:|t |d¡t|dƒd|kr2dd„|dDƒndd|krJt |d¡ndd|krbt |d¡ndd|krzt |d¡ndd    |kr’t |d    ¡ndd
|krªt |d
¡ndd |krÆd d„|d Dƒndd |krÞt |d ¡ndd|krúdd„|dDƒndd|krtj |d¡ndd|kr2tj |d¡ndd S)Nrrxr‚cSsg|]}t |¡‘qSr©rXrr^rrrra‹sz$AXNode.from_json.<locals>.<listcomp>r,rƒrZr8r.r{cSsg|]}t |¡‘qSrr‡r^rrrra‘sr„r…cSsg|]}t |¡‘qSr)r
rr^rrrra“srVr†) rwrxryr,rzrZr8r.r{r|r}rTr€)r
rrQrPrrWrZFrameIdrrrrr†s 
ózAXNode.from_json)rrr r!rRryr,rzrZr8r.r{r|r}rTr€rr"rrrrrrv>s"
           rvz0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]r ccsddi}|V}dS)z,
    Disables the accessibility domain.
    ÚmethodzAccessibility.disableNr©Úcmd_dictrrrrÚdisable™sÿr‹ccsddi}|V}dS)zÝ
    Enables the accessibility domain which causes ``AXNodeId``'s to remain consistent between method calls.
    This turns on accessibility for the page, which can impact performance until accessibility is disabled.
    rˆzAccessibility.enableNrr‰rrrÚenable£sÿrŒztyping.Optional[dom.NodeId]r~z'typing.Optional[runtime.RemoteObjectId]rCz?typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[AXNode]])rwÚbackend_node_idÚ    object_idÚfetch_relativesr ccsttƒ}|dk    r| ¡|d<|dk    r.| ¡|d<|dk    rB| ¡|d<|dk    rR||d<d|dœ}|V}dd    „|d
DƒS) aË
    Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
 
    **EXPERIMENTAL**
 
    :param node_id: *(Optional)* Identifier of the node to get the partial accessibility tree for.
    :param backend_node_id: *(Optional)* Identifier of the backend node to get the partial accessibility tree for.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper to get the partial accessibility tree for.
    :param fetch_relatives: *(Optional)* Whether to fetch this node's ancestors, siblings and children. Defaults to true.
    :returns: The ``Accessibility.AXNode`` for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
    NrÚ backendNodeIdÚobjectIdZfetchRelativeszAccessibility.getPartialAXTree©rˆÚparamscSsg|]}t |¡‘qSr©rvrr^rrrraÍsz'get_partial_ax_tree.<locals>.<listcomp>Únodes©rNr)rwrrŽrr“rŠrrrrÚget_partial_ax_tree®s   þr—ztyping.Optional[int]r)Údepthr€r ccsLtƒ}|dk    r||d<|dk    r*| ¡|d<d|dœ}|V}dd„|dDƒS)    a
    Fetches the entire accessibility tree for the root Document
 
    **EXPERIMENTAL**
 
    :param depth: *(Optional)* The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.
    :param frame_id: *(Optional)* The frame for whose document the AX tree should be retrieved. If omited, the root frame is used.
    :returns: 
    Nr˜r†zAccessibility.getFullAXTreer’cSsg|]}t |¡‘qSrr”r^rrrraçsz$get_full_ax_tree.<locals>.<listcomp>r•r–)r˜r€r“rŠrrrrÚget_full_ax_treeÐs  þr™z2typing.Generator[T_JSON_DICT, T_JSON_DICT, AXNode])r€r ccs8tƒ}|dk    r| ¡|d<d|dœ}|V}t |d¡S)zô
    Fetches the root node.
    Requires ``enable()`` to have been called previously.
 
    **EXPERIMENTAL**
 
    :param frame_id: *(Optional)* The frame in whose document the node resides. If omitted, the root frame is used.
    :returns: 
    Nr†zAccessibility.getRootAXNoder’r()rNrrvr)r€r“rŠrrrrÚget_root_ax_nodeês  þrš)rwrrŽr ccsdtƒ}|dk    r| ¡|d<|dk    r.| ¡|d<|dk    rB| ¡|d<d|dœ}|V}dd„|d    DƒS)
aŒ
    Fetches a node and all ancestors up to and including the root.
    Requires ``enable()`` to have been called previously.
 
    **EXPERIMENTAL**
 
    :param node_id: *(Optional)* Identifier of the node to get.
    :param backend_node_id: *(Optional)* Identifier of the backend node to get.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper to get.
    :returns: 
    Nrrr‘z#Accessibility.getAXNodeAndAncestorsr’cSsg|]}t |¡‘qSrr”r^rrrrasz-get_ax_node_and_ancestors.<locals>.<listcomp>r•r–)rwrrŽr“rŠrrrrÚget_ax_node_and_ancestorss   þr›)Úid_r€r ccsHtƒ}| ¡|d<|dk    r&| ¡|d<d|dœ}|V}dd„|dDƒS)    a"
    Fetches a particular accessibility node by AXNodeId.
    Requires ``enable()`` to have been called previously.
 
    **EXPERIMENTAL**
 
    :param id_:
    :param frame_id: *(Optional)* The frame in whose document the node resides. If omitted, the root frame is used.
    :returns: 
    ÚidNr†zAccessibility.getChildAXNodesr’cSsg|]}t |¡‘qSrr”r^rrrra7sz&get_child_ax_nodes.<locals>.<listcomp>r•r–)rœr€r“rŠrrrrÚget_child_ax_nodes s  þržrA)rwrrŽÚaccessible_namer,r ccs„tƒ}|dk    r| ¡|d<|dk    r.| ¡|d<|dk    rB| ¡|d<|dk    rR||d<|dk    rb||d<d|dœ}|V}d    d
„|d DƒS) a
    Query a DOM node's accessibility subtree for accessible name and role.
    This command computes the name and role for all nodes in the subtree, including those that are
    ignored for accessibility, and returns those that mactch the specified name and role. If no DOM
    node is specified, or the DOM node does not exist, the command returns an error. If neither
    ``accessibleName`` or ``role`` is specified, it returns all the accessibility nodes in the subtree.
 
    **EXPERIMENTAL**
 
    :param node_id: *(Optional)* Identifier of the node for the root to query.
    :param backend_node_id: *(Optional)* Identifier of the backend node for the root to query.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper for the root to query.
    :param accessible_name: *(Optional)* Find nodes with this computed name.
    :param role: *(Optional)* Find nodes with this computed role.
    :returns: A list of ``Accessibility.AXNode`` matching the specified attributes, including nodes that are ignored for accessibility.
    Nrrr‘ZaccessibleNamer,zAccessibility.queryAXTreer’cSsg|]}t |¡‘qSrr”r^rrrraasz!query_ax_tree.<locals>.<listcomp>r•r–)rwrrŽrŸr,r“rŠrrrrÚ query_ax_tree:s    þr zAccessibility.loadCompletec@s.eZdZUdZded<edddœdd„ƒZdS)    Ú LoadCompletez®
    **EXPERIMENTAL**
 
    The loadComplete event mirrors the load complete event sent by the browser to assistive
    technology when the web page has finished loading.
    rvrgrrcCs|t |d¡dS)Nrg)rgr”rrrrrps ÿzLoadComplete.from_jsonN©rrr r!rRr"rrrrrr¡ds
r¡zAccessibility.nodesUpdatedc@s.eZdZUdZded<edddœdd„ƒZdS)    Ú NodesUpdatedz~
    **EXPERIMENTAL**
 
    The nodesUpdated event is sent every time a previously requested node has changed the in tree.
    ztyping.List[AXNode]r•rrcCs|dd„|dDƒdS)NcSsg|]}t |¡‘qSrr”r^rrrra…sz*NodesUpdated.from_json.<locals>.<listcomp>r•)r•rrrrrr‚sÿzNodesUpdated.from_jsonNr¢rrrrr£ws
r£)NNNN)NN)N)NNN)N)NNNNN)#Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingÚrrr    r r
ÚEnumr$r2r7r>rSrXrPrYrvr‹rŒr—r™ršr›ržr r¡r£rrrrÚ<module>sh     C%9Z
 ü#þÿý!þû*