appium-novawindows2-driver 0.1.13 → 0.2.1

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.
@@ -10,75 +10,75 @@ const functions_1 = require("./functions");
10
10
  const SET_UTF8_ENCODING = /* ps1 */ `$OutputEncoding = [Console]::OutputEncoding = [Text.Encoding]::UTF8`;
11
11
  const ADD_NECESSARY_ASSEMBLIES = /* ps1 */ `Add-Type -AssemblyName UIAutomationClient; Add-Type -AssemblyName UIAutomationTypes; Add-Type -AssemblyName UIAutomationClientsideProviders; Add-Type -AssemblyName System.Drawing; Add-Type -AssemblyName PresentationCore; Add-Type -AssemblyName System.Windows.Forms`;
12
12
  const USE_UI_AUTOMATION_CLIENT = /* ps1 */ `using namespace System.Windows.Automation`;
13
- const INIT_CACHE_REQUEST = /* ps1 */ `
14
- ($cacheRequest = New-Object System.Windows.Automation.CacheRequest).TreeFilter = [AndCondition]::new([Automation]::ControlViewCondition, [NotCondition]::new([PropertyCondition]::new([AutomationElement]::FrameworkIdProperty, 'Chrome')));
15
- $cacheRequest.Add([AutomationElement]::NameProperty);
16
- $cacheRequest.Add([AutomationElement]::AutomationIdProperty);
17
- $cacheRequest.Add([AutomationElement]::ClassNameProperty);
18
- $cacheRequest.Add([AutomationElement]::ControlTypeProperty);
19
- $cacheRequest.Add([AutomationElement]::IsOffscreenProperty);
20
- $cacheRequest.Add([AutomationElement]::IsEnabledProperty);
21
- $cacheRequest.Add([AutomationElement]::BoundingRectangleProperty);
22
- $cacheRequest.Push()
13
+ const INIT_CACHE_REQUEST = /* ps1 */ `
14
+ ($cacheRequest = New-Object System.Windows.Automation.CacheRequest).TreeFilter = [AndCondition]::new([Automation]::ControlViewCondition, [NotCondition]::new([PropertyCondition]::new([AutomationElement]::FrameworkIdProperty, 'Chrome')));
15
+ $cacheRequest.Add([AutomationElement]::NameProperty);
16
+ $cacheRequest.Add([AutomationElement]::AutomationIdProperty);
17
+ $cacheRequest.Add([AutomationElement]::ClassNameProperty);
18
+ $cacheRequest.Add([AutomationElement]::ControlTypeProperty);
19
+ $cacheRequest.Add([AutomationElement]::IsOffscreenProperty);
20
+ $cacheRequest.Add([AutomationElement]::IsEnabledProperty);
21
+ $cacheRequest.Add([AutomationElement]::BoundingRectangleProperty);
22
+ $cacheRequest.Push()
23
23
  `;
24
24
  const INIT_ROOT_ELEMENT = /* ps1 */ `$rootElement = [AutomationElement]::RootElement`;
25
25
  const NULL_ROOT_ELEMENT = /* ps1 */ `$rootElement = $null`;
26
26
  const INIT_ELEMENT_TABLE = /* ps1 */ `$elementTable = New-Object System.Collections.Generic.Dictionary[[string]\`,[AutomationElement]]`;
27
- const MSAA_HELPER_CODE = /* ps1 */ `
28
- $msaaCode = @"
29
- using System;
30
- using System.Runtime.InteropServices;
31
- using System.Reflection;
32
-
33
- public static class MSAAHelper {
34
- [DllImport("oleacc.dll")]
35
- private static extern int AccessibleObjectFromWindow(IntPtr hwnd, uint dwId, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out object ppvObject);
36
-
37
- public static object GetLegacyProperty(IntPtr hwnd, string propertyName) {
38
- if (hwnd == IntPtr.Zero) return null;
39
-
40
- Guid IID_IAccessible = new Guid("618736E0-3C3D-11CF-810C-00AA00389B71");
41
- object acc = null;
42
- // OBJID_CLIENT = 0xFFFFFFFC (-4)
43
- int res = AccessibleObjectFromWindow(hwnd, 0xFFFFFFFC, ref IID_IAccessible, out acc);
44
- if (res == 0 && acc != null) {
45
- try {
46
- // propertyName maps to: accName, accValue, accDescription, accRole, accState, accHelp, accKeyboardShortcut, accDefaultAction
47
- return acc.GetType().InvokeMember(propertyName,
48
- BindingFlags.GetProperty,
49
- null,
50
- acc,
51
- new object[] { 0 }); // 0 = CHILDID_SELF
52
- } catch {
53
- return null;
54
- }
55
- }
56
- return null;
57
- }
58
-
59
- public static bool SetLegacyValue(IntPtr hwnd, string value) {
60
- if (hwnd == IntPtr.Zero) return false;
61
-
62
- Guid IID_IAccessible = new Guid("618736E0-3C3D-11CF-810C-00AA00389B71");
63
- object acc = null;
64
- int res = AccessibleObjectFromWindow(hwnd, 0xFFFFFFFC, ref IID_IAccessible, out acc);
65
- if (res == 0 && acc != null) {
66
- try {
67
- acc.GetType().InvokeMember("accValue",
68
- BindingFlags.SetProperty,
69
- null,
70
- acc,
71
- new object[] { 0, value }); // 0 = CHILDID_SELF
72
- return true;
73
- } catch {
74
- return false;
75
- }
76
- }
77
- return false;
78
- }
79
- }
80
- "@
81
- Add-Type -TypeDefinition $msaaCode -Language CSharp
27
+ const MSAA_HELPER_CODE = /* ps1 */ `
28
+ $msaaCode = @"
29
+ using System;
30
+ using System.Runtime.InteropServices;
31
+ using System.Reflection;
32
+
33
+ public static class MSAAHelper {
34
+ [DllImport("oleacc.dll")]
35
+ private static extern int AccessibleObjectFromWindow(IntPtr hwnd, uint dwId, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out object ppvObject);
36
+
37
+ public static object GetLegacyProperty(IntPtr hwnd, string propertyName) {
38
+ if (hwnd == IntPtr.Zero) return null;
39
+
40
+ Guid IID_IAccessible = new Guid("618736E0-3C3D-11CF-810C-00AA00389B71");
41
+ object acc = null;
42
+ // OBJID_CLIENT = 0xFFFFFFFC (-4)
43
+ int res = AccessibleObjectFromWindow(hwnd, 0xFFFFFFFC, ref IID_IAccessible, out acc);
44
+ if (res == 0 && acc != null) {
45
+ try {
46
+ // propertyName maps to: accName, accValue, accDescription, accRole, accState, accHelp, accKeyboardShortcut, accDefaultAction
47
+ return acc.GetType().InvokeMember(propertyName,
48
+ BindingFlags.GetProperty,
49
+ null,
50
+ acc,
51
+ new object[] { 0 }); // 0 = CHILDID_SELF
52
+ } catch {
53
+ return null;
54
+ }
55
+ }
56
+ return null;
57
+ }
58
+
59
+ public static bool SetLegacyValue(IntPtr hwnd, string value) {
60
+ if (hwnd == IntPtr.Zero) return false;
61
+
62
+ Guid IID_IAccessible = new Guid("618736E0-3C3D-11CF-810C-00AA00389B71");
63
+ object acc = null;
64
+ int res = AccessibleObjectFromWindow(hwnd, 0xFFFFFFFC, ref IID_IAccessible, out acc);
65
+ if (res == 0 && acc != null) {
66
+ try {
67
+ acc.GetType().InvokeMember("accValue",
68
+ BindingFlags.SetProperty,
69
+ null,
70
+ acc,
71
+ new object[] { 0, value }); // 0 = CHILDID_SELF
72
+ return true;
73
+ } catch {
74
+ return false;
75
+ }
76
+ }
77
+ return false;
78
+ }
79
+ }
80
+ "@
81
+ Add-Type -TypeDefinition $msaaCode -Language CSharp
82
82
  `;
83
83
  // Global execution chain to enforce sequential execution across all sessions
84
84
  let globalExecutionChain = Promise.resolve();