appium-novawindows2-driver 0.2.11 → 0.2.13

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.
@@ -1,296 +1,272 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.startPowerShellSession = startPowerShellSession;
4
- exports.sendIsolatedPowerShellCommand = sendIsolatedPowerShellCommand;
5
3
  exports.sendPowerShellCommand = sendPowerShellCommand;
4
+ exports.sendIsolatedPowerShellCommand = sendIsolatedPowerShellCommand;
5
+ exports.startPowerShellSession = startPowerShellSession;
6
6
  exports.terminatePowerShellSession = terminatePowerShellSession;
7
7
  const node_child_process_1 = require("node:child_process");
8
8
  const base_driver_1 = require("@appium/base-driver");
9
9
  const functions_1 = require("./functions");
10
- // import { ensureMsaaHelperCompiled, CompilationResult, getMsaaHelperCode } from '../powershell/msaa';
10
+ const msaa_1 = require("../powershell/msaa");
11
11
  const SET_UTF8_ENCODING = /* ps1 */ `$OutputEncoding = [Console]::OutputEncoding = [Text.Encoding]::UTF8`;
12
- 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
+ // 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`;
13
+ const ADD_NECESSARY_ASSEMBLIES = /* ps1 */ `
14
+ Add-Type -AssemblyName UIAutomationClient
15
+ #Add-Type -AssemblyName UIAutomationTypes
16
+ Add-Type -AssemblyName System.Drawing
17
+ Add-Type -AssemblyName PresentationCore
18
+ Add-Type -AssemblyName System.Windows.Forms
19
+ `;
13
20
  const USE_UI_AUTOMATION_CLIENT = /* ps1 */ `using namespace System.Windows.Automation`;
14
21
  const INIT_CACHE_REQUEST = /* ps1 */ `($cacheRequest = New-Object System.Windows.Automation.CacheRequest).TreeFilter = [AndCondition]::new([Automation]::ControlViewCondition, [NotCondition]::new([PropertyCondition]::new([AutomationElement]::FrameworkIdProperty, 'Chrome'))); $cacheRequest.Push()`;
15
- // const INIT_CACHE_REQUEST = /* ps1 */ `
16
- // ($cacheRequest = New-Object System.Windows.Automation.CacheRequest).TreeFilter = [AndCondition]::new([Automation]::ControlViewCondition, [NotCondition]::new([PropertyCondition]::new([AutomationElement]::FrameworkIdProperty, 'Chrome')));
17
- // $cacheRequest.Add([AutomationElement]::NameProperty);
18
- // $cacheRequest.Add([AutomationElement]::AutomationIdProperty);
19
- // $cacheRequest.Add([AutomationElement]::BoundingRectangleProperty);
20
- // $cacheRequest.Add([AutomationElement]::RuntimeIdProperty);
21
- // $cacheRequest.Push()
22
- // `;
23
22
  const INIT_ROOT_ELEMENT = /* ps1 */ `$rootElement = [AutomationElement]::RootElement`;
24
23
  const NULL_ROOT_ELEMENT = /* ps1 */ `$rootElement = $null`;
25
24
  const INIT_ELEMENT_TABLE = /* ps1 */ `$elementTable = New-Object System.Collections.Generic.Dictionary[[string]\`,[AutomationElement]]`;
26
- const DISABLE_QUICK_EDIT = /* ps1 */ `try {if (([System.Management.Automation.PSTypeName]'ConsoleHelper').Type) {[ConsoleHelper]::DisableConsoleInteractions()}} catch {}`;
27
- async function startPowerShellSession() {
28
- this.log.debug(`Starting new PowerShell session...`);
29
- const powerShell = (0, node_child_process_1.spawn)('powershell.exe', ['-NoProfile', '-NoExit', '-Command', '-']);
30
- powerShell.stdout.setEncoding('utf8');
31
- powerShell.stderr.setEncoding('utf8');
32
- powerShell.stdout.on('data', (chunk) => {
33
- this.powerShellStdOut += chunk.toString();
34
- });
35
- powerShell.stderr.on('data', (chunk) => {
36
- this.powerShellStdErr += chunk.toString();
37
- });
38
- this.powerShell = powerShell;
39
- if (this.caps.appWorkingDir) {
40
- const envVarsSet = new Set();
41
- const matches = this.caps.appWorkingDir.matchAll(/%([^%]+)%/g);
42
- for (const match of matches) {
43
- envVarsSet.add(match[1]);
44
- }
45
- const envVars = Array.from(envVarsSet);
46
- for (const envVar of envVars) {
47
- this.caps.appWorkingDir = this.caps.appWorkingDir.replaceAll(`%${envVar}%`, process.env[envVar.toUpperCase()] ?? '');
48
- }
25
+ const COMMAND_END_MARKER = 0xF2EE;
26
+ const COMMAND_END_CHAR = String.fromCharCode(COMMAND_END_MARKER);
27
+ // ============================================================================
28
+ // Helper Functions
29
+ // ============================================================================
30
+ /**
31
+ * Expands Windows environment variables (%VAR%) in a string
32
+ */
33
+ function expandEnvironmentVariables(input, log) {
34
+ const matches = Array.from(input.matchAll(/%([^%]+)%/g));
35
+ if (matches.length === 0)
36
+ return input;
37
+ const envVars = [...new Set(matches.map(m => m[1]))];
38
+ log.info(`Expanding environment variables: ${envVars.map(v => `%${v}%`).join(', ')}`);
39
+ let result = input;
40
+ for (const envVar of envVars) {
41
+ const value = process.env[envVar.toUpperCase()] ?? '';
42
+ result = result.replaceAll(`%${envVar}%`, value);
49
43
  }
50
- // const compilationResult = await ensureMsaaHelperCompiled(this.log);
51
- let initScript = `${USE_UI_AUTOMATION_CLIENT}\n`;
52
- initScript += `${SET_UTF8_ENCODING};\n`;
53
- initScript += `${ADD_NECESSARY_ASSEMBLIES};\n`;
54
- if (this.caps.appWorkingDir) {
55
- initScript += `Set-Location -Path '${this.caps.appWorkingDir}';\n`;
56
- }
57
- initScript += `${INIT_CACHE_REQUEST};\n`;
58
- initScript += `${INIT_ELEMENT_TABLE};\n`;
59
- // initScript += `${getMsaaHelperCode(compilationResult)};\n`;
60
- initScript += `${functions_1.PAGE_SOURCE};\n`;
61
- initScript += `${functions_1.GET_LEGACY_PROPERTY_SAFE};\n`;
62
- initScript += `${functions_1.FIND_CHILDREN_RECURSIVELY};\n`;
63
- initScript += `${DISABLE_QUICK_EDIT};\n`;
64
- if ((!this.caps.app && !this.caps.appTopLevelWindow) || (!this.caps.app || this.caps.app.toLowerCase() === 'none')) {
65
- this.log.info(`No app or top-level window specified in capabilities. Setting root element to null.`);
66
- initScript += `${NULL_ROOT_ELEMENT};\n`;
67
- }
68
- else if (this.caps.app && this.caps.app.toLowerCase() === 'root') {
69
- this.log.info(`'root' specified as app in capabilities. Setting root element to desktop root.`);
70
- initScript += `${INIT_ROOT_ELEMENT};\n`;
71
- }
72
- await executeRawCommand(this, initScript);
73
- if (this.caps.app && this.caps.app.toLowerCase() !== 'none' && this.caps.app.toLowerCase() !== 'root') {
74
- this.log.info(`Application path specified in capabilities: ${this.caps.app}`);
75
- const envVarsSet = new Set();
76
- const matches = this.caps.app.matchAll(/%([^%]+)%/g);
77
- for (const match of matches) {
78
- envVarsSet.add(match[1]);
79
- }
80
- const envVars = Array.from(envVarsSet);
81
- this.log.info(`Detected the following environment variables in app path: ${envVars.map((envVar) => `%${envVar}%`).join(', ')}`);
82
- for (const envVar of envVars) {
83
- this.caps.app = this.caps.app.replaceAll(`%${envVar}%`, process.env[envVar.toUpperCase()] ?? '');
84
- }
85
- await this.changeRootElement(this.caps.app);
86
- }
87
- if (this.caps.appTopLevelWindow) {
88
- const nativeWindowHandle = Number(this.caps.appTopLevelWindow);
89
- if (isNaN(nativeWindowHandle)) {
90
- throw new base_driver_1.errors.InvalidArgumentError(`Invalid capabilities. Capability 'appTopLevelWindow' is not a valid native window handle.`);
91
- }
92
- await this.changeRootElement(nativeWindowHandle);
93
- }
94
- this.log.debug(`PowerShell session initialization completed`);
44
+ return result;
95
45
  }
96
- async function sendIsolatedPowerShellCommand(command) {
97
- const powerShell = (0, node_child_process_1.spawn)('powershell.exe', ['-NoProfile', '-NoExit', '-Command', '-']);
98
- const output = { stdout: '', stderr: '' };
99
- try {
100
- powerShell.stdout.setEncoding('utf8');
101
- powerShell.stderr.setEncoding('utf8');
102
- powerShell.stdout.on('data', (chunk) => {
103
- output.stdout += chunk.toString();
104
- });
105
- powerShell.stderr.on('data', (chunk) => {
106
- output.stderr += chunk.toString();
107
- });
108
- let fullCommand = `${SET_UTF8_ENCODING}\n`;
109
- if (this.caps.appWorkingDir) {
110
- const envVarsSet = new Set();
111
- const matches = this.caps.appWorkingDir.matchAll(/%([^%]+)%/g);
112
- for (const match of matches) {
113
- envVarsSet.add(match[1]);
114
- }
115
- const envVars = Array.from(envVarsSet);
116
- for (const envVar of envVars) {
117
- this.caps.appWorkingDir = this.caps.appWorkingDir.replaceAll(`%${envVar}%`, process.env[envVar.toUpperCase()] ?? '');
118
- }
119
- fullCommand += `Set-Location -Path '${this.caps.appWorkingDir}'\n`;
120
- }
121
- fullCommand += command;
122
- return await executeIsolatedRawCommand(this, fullCommand, powerShell, output);
46
+ /**
47
+ * Checks if PowerShell session is ready
48
+ */
49
+ function ensureSessionReady(driver) {
50
+ const ps = driver.powerShell;
51
+ if (!ps || ps.exitCode !== null || !ps.stdin.writable) {
52
+ throw new base_driver_1.errors.UnknownError('PowerShell session is not available or closed');
123
53
  }
124
- finally {
125
- // Ensure the isolated PowerShell process is terminated
126
- try {
127
- powerShell.kill();
128
- }
129
- catch (e) {
130
- this.log.warn(`Failed to terminate isolated PowerShell process: ${e}`);
131
- }
132
- }
133
- }
134
- async function sendPowerShellCommand(command) {
135
- const nextCommand = async () => {
136
- if (!this.powerShell) {
137
- this.log.warn('PowerShell session not running. It was either closed or has crashed. Attempting to start a new session...');
138
- await this.startPowerShellSession();
139
- }
140
- // Use the extracted raw command function
141
- return await executeRawCommand(this, command);
142
- };
143
- // Chain the command to the queue
144
- // Use .catch to ignore previous failures, then .then to queue this command.
145
- // This prevents re-running this command if it fails (no infinite loop).
146
- this.commandQueue = this.commandQueue
147
- .catch(() => { })
148
- .then(nextCommand)
149
- .catch((err) => {
150
- this.log.debug(`PowerShell command failed: ${command}\nError: ${err.message}`);
151
- throw err;
152
- });
153
- return this.commandQueue;
154
- }
155
- async function terminatePowerShellSession() {
156
- const terminateAction = async () => {
157
- if (!this.powerShell) {
158
- return;
159
- }
160
- if (this.powerShell.exitCode !== null) {
161
- this.log.debug(`PowerShell session already terminated.`);
162
- this.powerShell = undefined;
163
- return;
164
- }
165
- this.log.debug(`Terminating PowerShell session...`);
166
- const waitForClose = new Promise((resolve) => {
167
- this.powerShell?.once('close', () => {
168
- resolve();
169
- });
170
- setTimeout(resolve, 5000); // Safety timeout
171
- });
172
- this.powerShell.kill();
173
- await waitForClose;
174
- this.powerShell = undefined;
175
- this.log.debug(`PowerShell session terminated successfully.`);
176
- };
177
- this.commandQueue = this.commandQueue
178
- .catch(() => { })
179
- .then(terminateAction);
180
- return await this.commandQueue;
181
54
  }
182
- // Basic execution logic for PowerShell commands within the established session.
183
- async function executeRawCommand(driver, command) {
184
- const magicNumber = 0xF2EE;
185
- const powerShell = driver.powerShell;
186
- if (!powerShell || powerShell.exitCode !== null || !powerShell.stdin.writable) {
187
- throw new base_driver_1.errors.UnknownError('PowerShell session is not available or closed.');
188
- }
189
- driver.powerShellStdOut = '';
190
- driver.powerShellStdErr = '';
191
- try {
192
- powerShell.stdin.write(`${command}\n`);
193
- powerShell.stdin.write(/* ps1 */ `Write-Output $([char]0x${magicNumber.toString(16)})\n`);
194
- }
195
- catch (e) {
196
- throw new base_driver_1.errors.UnknownError(`Failed to write to PowerShell: ${e.message}`);
197
- }
198
- return await new Promise((resolve, reject) => {
199
- const timeoutMs = driver.caps.powerShellCommandTimeout || 60000;
55
+ /**
56
+ * Waits for command completion marker in PowerShell output
57
+ */
58
+ function waitForCommandCompletion(driver, powerShell, timeoutMs) {
59
+ return new Promise((resolve, reject) => {
60
+ let timedOut = false;
200
61
  const timeout = setTimeout(() => {
201
- if (driver.powerShell === powerShell) {
202
- driver.log.warn(`PowerShell command timed out after ${timeoutMs}ms. Terminating process...`);
203
- try {
62
+ timedOut = true;
63
+ cleanup();
64
+ driver.log.warn(`PowerShell command timed out after ${timeoutMs}ms`);
65
+ try {
66
+ if (driver.powerShell === powerShell) {
204
67
  powerShell.kill();
68
+ driver.powerShell = undefined;
205
69
  }
206
- catch (e) {
207
- driver.log.warn(`Failed to kill PowerShell process: ${e}`);
208
- }
209
- driver.powerShell = undefined;
70
+ }
71
+ catch (e) {
72
+ driver.log.warn(`Failed to kill PowerShell: ${e}`);
210
73
  }
211
74
  reject(new base_driver_1.errors.TimeoutError(`PowerShell command timed out after ${timeoutMs}ms`));
212
75
  }, timeoutMs);
76
+ const onData = (chunk) => {
77
+ if (chunk.toString().includes(COMMAND_END_CHAR)) {
78
+ cleanup();
79
+ if (driver.powerShellStdErr) {
80
+ driver.log.error(`PowerShell error: ${driver.powerShellStdErr}`);
81
+ reject(new base_driver_1.errors.UnknownError(driver.powerShellStdErr));
82
+ }
83
+ else {
84
+ const result = driver.powerShellStdOut.replace(COMMAND_END_CHAR, '').trim();
85
+ resolve(result);
86
+ }
87
+ }
88
+ };
213
89
  const onClose = (code) => {
214
- clearTimeout(timeout);
90
+ if (timedOut)
91
+ return;
92
+ cleanup();
215
93
  if (driver.powerShell === powerShell) {
216
94
  driver.powerShell = undefined;
217
95
  }
218
96
  if (code === 0) {
219
- const result = driver.powerShellStdOut.replace(String.fromCharCode(magicNumber), '').trim();
220
- driver.log.debug(`PowerShell process exited gracefully (0). Result length: ${result.length}`);
97
+ const result = driver.powerShellStdOut.replace(COMMAND_END_CHAR, '').trim();
221
98
  resolve(result);
222
99
  }
223
100
  else {
224
- reject(new base_driver_1.errors.UnknownError(`PowerShell process exited unexpectedly with code ${code}`));
101
+ const hexCode = '0x' + code.toString(16).toUpperCase();
102
+ const errorMsg = driver.powerShellStdErr || 'No error details';
103
+ driver.log.error(`PowerShell exited with code ${code} (${hexCode}). stderr: ${errorMsg}`);
104
+ reject(new base_driver_1.errors.UnknownError(`PowerShell exited with code ${code} (${hexCode})`));
225
105
  }
226
106
  };
227
- powerShell.once('close', onClose);
228
- const onData = (chunk) => {
229
- const magicChar = String.fromCharCode(magicNumber);
230
- if (chunk.toString().includes(magicChar)) {
231
- clearTimeout(timeout);
232
- powerShell.stdout.off('data', onData);
233
- powerShell.off('close', onClose);
234
- if (driver.powerShellStdErr) {
235
- driver.log.error(`PowerShell command failed: ${driver.powerShellStdErr}`);
236
- reject(new base_driver_1.errors.UnknownError(driver.powerShellStdErr));
237
- }
238
- else {
239
- const result = driver.powerShellStdOut.replace(`${magicChar}`, '').trim();
240
- driver.log.debug(`PowerShell command completed. Result length: ${result.length}`);
241
- resolve(result);
242
- }
243
- }
107
+ const cleanup = () => {
108
+ clearTimeout(timeout);
109
+ powerShell.stdout.off('data', onData);
110
+ powerShell.off('close', onClose);
244
111
  };
245
112
  powerShell.stdout.on('data', onData);
113
+ powerShell.once('close', onClose);
114
+ });
115
+ }
116
+ // ============================================================================
117
+ // Main PowerShell Command Execution
118
+ // ============================================================================
119
+ /**
120
+ * Executes a PowerShell command in the persistent session
121
+ */
122
+ async function sendPowerShellCommand(command) {
123
+ if (!this.commandQueue) {
124
+ this.commandQueue = Promise.resolve();
125
+ }
126
+ this.commandQueue = this.commandQueue.then(async () => {
127
+ ensureSessionReady(this);
128
+ this.powerShellStdOut = '';
129
+ this.powerShellStdErr = '';
130
+ try {
131
+ this.powerShell.stdin.write(`${command}\n`);
132
+ this.powerShell.stdin.write(`Write-Output $([char]0x${COMMAND_END_MARKER.toString(16)})\n`);
133
+ }
134
+ catch (e) {
135
+ throw new base_driver_1.errors.UnknownError(`Failed to write to PowerShell: ${e.message}`);
136
+ }
137
+ const timeoutMs = this.caps.powerShellCommandTimeout || 60000;
138
+ return await waitForCommandCompletion(this, this.powerShell, timeoutMs);
139
+ });
140
+ return await this.commandQueue;
141
+ }
142
+ /**
143
+ * Executes a PowerShell command in an isolated session
144
+ */
145
+ async function sendIsolatedPowerShellCommand(command) {
146
+ const powerShell = (0, node_child_process_1.spawn)('powershell.exe', ['-NoProfile', '-Command', command]);
147
+ let stdout = '';
148
+ let stderr = '';
149
+ powerShell.stdout.on('data', chunk => stdout += chunk.toString());
150
+ powerShell.stderr.on('data', chunk => stderr += chunk.toString());
151
+ return new Promise((resolve, reject) => {
152
+ powerShell.on('close', (code) => {
153
+ if (code === 0) {
154
+ resolve(stdout.trim());
155
+ }
156
+ else {
157
+ const exitCode = code || -1;
158
+ const hexCode = '0x' + exitCode.toString(16).toUpperCase();
159
+ const error = stderr || 'No error details';
160
+ this.log.error(`Isolated PowerShell exited with code ${exitCode} (${hexCode}). stderr: ${error}`);
161
+ reject(new base_driver_1.errors.UnknownError(`PowerShell exited with code ${exitCode} (${hexCode})`));
162
+ }
163
+ });
246
164
  });
247
165
  }
248
- async function executeIsolatedRawCommand(driver, command, powerShell, output) {
249
- const magicNumber = 0xF2EE;
250
- powerShell.stdin.write(`${command}\n`);
251
- powerShell.stdin.write(/* ps1 */ `Write-Output $([char]0x${magicNumber.toString(16)})\n`);
252
- return await new Promise((resolve, reject) => {
253
- const timeoutMs = driver.caps.powerShellCommandTimeout || 60000;
166
+ // ============================================================================
167
+ // Session Management
168
+ // ============================================================================
169
+ async function startPowerShellSession() {
170
+ this.log.debug('Starting PowerShell session...');
171
+ // Spawn PowerShell process
172
+ const powerShell = (0, node_child_process_1.spawn)('powershell.exe', ['-NoProfile', '-NoExit', '-Command', '-']);
173
+ powerShell.stdout.setEncoding('utf8');
174
+ powerShell.stderr.setEncoding('utf8');
175
+ powerShell.stdout.on('data', (chunk) => {
176
+ this.powerShellStdOut += chunk.toString();
177
+ });
178
+ powerShell.stderr.on('data', (chunk) => {
179
+ this.powerShellStdErr += chunk.toString();
180
+ });
181
+ this.powerShell = powerShell;
182
+ // Set working directory if specified
183
+ if (this.caps.appWorkingDir) {
184
+ const expandedDir = expandEnvironmentVariables(this.caps.appWorkingDir, this.log);
185
+ this.caps.appWorkingDir = expandedDir;
186
+ await sendPowerShellCommand.call(this, `Set-Location -Path '${expandedDir}'`);
187
+ }
188
+ // Initialize PowerShell environment
189
+ const initScripts = [
190
+ SET_UTF8_ENCODING,
191
+ ADD_NECESSARY_ASSEMBLIES,
192
+ msaa_1.MSAA_HELPER_SCRIPT,
193
+ USE_UI_AUTOMATION_CLIENT,
194
+ INIT_CACHE_REQUEST,
195
+ INIT_ELEMENT_TABLE,
196
+ functions_1.PAGE_SOURCE,
197
+ functions_1.FIND_CHILDREN_RECURSIVELY
198
+ ];
199
+ for (const script of initScripts) {
200
+ await sendPowerShellCommand.call(this, script);
201
+ }
202
+ // Setup root element based on capabilities
203
+ await setupRootElement.call(this);
204
+ this.log.debug('PowerShell session initialization completed');
205
+ }
206
+ /**
207
+ * Sets up the root UI element based on capabilities
208
+ */
209
+ async function setupRootElement() {
210
+ const { app, appTopLevelWindow } = this.caps;
211
+ // No app specified
212
+ if ((!app && !appTopLevelWindow) || (!app || app.toLowerCase() === 'none')) {
213
+ this.log.info('No app specified. Setting root element to null.');
214
+ await sendPowerShellCommand.call(this, NULL_ROOT_ELEMENT);
215
+ return;
216
+ }
217
+ // Desktop root
218
+ if (app && app.toLowerCase() === 'root') {
219
+ this.log.info('Setting root element to desktop root.');
220
+ await sendPowerShellCommand.call(this, INIT_ROOT_ELEMENT);
221
+ return;
222
+ }
223
+ // Launch application
224
+ if (app && app.toLowerCase() !== 'none') {
225
+ const expandedApp = expandEnvironmentVariables(app, this.log);
226
+ this.log.info(`Launching application: ${expandedApp}`);
227
+ await this.changeRootElement(expandedApp);
228
+ }
229
+ // Set by window handle
230
+ if (appTopLevelWindow) {
231
+ const handle = Number(appTopLevelWindow);
232
+ if (isNaN(handle)) {
233
+ throw new base_driver_1.errors.InvalidArgumentError('Invalid appTopLevelWindow: not a valid window handle');
234
+ }
235
+ await this.changeRootElement(handle);
236
+ }
237
+ }
238
+ async function terminatePowerShellSession() {
239
+ if (!this.powerShell) {
240
+ this.log.debug('PowerShell session already terminated');
241
+ return;
242
+ }
243
+ this.log.debug('Terminating PowerShell session...');
244
+ const powerShell = this.powerShell;
245
+ this.powerShell = undefined;
246
+ return new Promise((resolve) => {
254
247
  const timeout = setTimeout(() => {
255
- driver.log.warn(`Isolated PowerShell command timed out after ${timeoutMs}ms. Terminating process...`);
248
+ this.log.warn('PowerShell did not terminate gracefully, killing process');
256
249
  try {
257
- powerShell.kill();
250
+ powerShell.kill('SIGKILL');
258
251
  }
259
252
  catch (e) {
260
- driver.log.warn(`Failed to kill isolated PowerShell process: ${e}`);
253
+ this.log.warn(`Failed to kill PowerShell: ${e}`);
261
254
  }
262
- reject(new base_driver_1.errors.TimeoutError(`Isolated PowerShell command timed out after ${timeoutMs}ms`));
263
- }, timeoutMs);
264
- const onClose = (code) => {
255
+ resolve();
256
+ }, 5000);
257
+ powerShell.once('close', () => {
265
258
  clearTimeout(timeout);
266
- if (code === 0) {
267
- const result = output.stdout.replace(String.fromCharCode(magicNumber), '').trim();
268
- driver.log.debug(`Isolated PowerShell process exited gracefully (0). Result length: ${result.length}`);
269
- resolve(result);
270
- }
271
- else {
272
- reject(new base_driver_1.errors.UnknownError(`Isolated PowerShell process exited unexpectedly with code ${code}`));
273
- }
274
- };
275
- powerShell.once('close', onClose);
276
- const onData = (chunk) => {
277
- const magicChar = String.fromCharCode(magicNumber);
278
- if (chunk.toString().includes(magicChar)) {
279
- clearTimeout(timeout);
280
- powerShell.stdout.off('data', onData);
281
- powerShell.off('close', onClose);
282
- if (output.stderr) {
283
- driver.log.error(`Isolated PowerShell command failed: ${output.stderr}`);
284
- reject(new base_driver_1.errors.UnknownError(output.stderr));
285
- }
286
- else {
287
- const result = output.stdout.replace(`${magicChar}`, '').trim();
288
- driver.log.debug(`Isolated PowerShell command completed. Result length: ${result.length}`);
289
- resolve(result);
290
- }
291
- }
292
- };
293
- powerShell.stdout.on('data', onData);
259
+ this.log.debug('PowerShell session terminated successfully');
260
+ resolve();
261
+ });
262
+ try {
263
+ powerShell.stdin.end();
264
+ }
265
+ catch (e) {
266
+ this.log.warn(`Error closing PowerShell stdin: ${e}`);
267
+ clearTimeout(timeout);
268
+ resolve();
269
+ }
294
270
  });
295
271
  }
296
272
  //# sourceMappingURL=powershell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"powershell.js","sourceRoot":"","sources":["../../../lib/commands/powershell.ts"],"names":[],"mappings":";;AAuBA,wDAqFC;AAED,sEA2CC;AAED,sDAuBC;AAED,gEAgCC;AApND,2DAA2E;AAE3E,qDAA6C;AAC7C,2CAA+F;AAC/F,uGAAuG;AAEvG,MAAM,iBAAiB,GAAG,SAAS,CAAC,qEAAqE,CAAC;AAC1G,MAAM,wBAAwB,GAAG,SAAS,CAAC,0QAA0Q,CAAC;AACtT,MAAM,wBAAwB,GAAG,SAAS,CAAC,2CAA2C,CAAC;AACvF,MAAM,kBAAkB,GAAG,SAAS,CAAC,mQAAmQ,CAAC;AACzS,yCAAyC;AACzC,+OAA+O;AAC/O,wDAAwD;AACxD,gEAAgE;AAChE,qEAAqE;AACrE,6DAA6D;AAC7D,uBAAuB;AACvB,KAAK;AACL,MAAM,iBAAiB,GAAG,SAAS,CAAC,iDAAiD,CAAC;AACtF,MAAM,iBAAiB,GAAG,SAAS,CAAC,sBAAsB,CAAC;AAC3D,MAAM,kBAAkB,GAAG,SAAS,CAAC,kGAAkG,CAAC;AACxI,MAAM,kBAAkB,GAAG,SAAS,CAAC,qIAAqI,CAAC;AAEpK,KAAK,UAAU,sBAAsB;IACxC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAErD,MAAM,UAAU,GAAG,IAAA,0BAAK,EAAC,gBAAgB,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACvF,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAEtC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAU,EAAE,EAAE;QACxC,IAAI,CAAC,gBAAgB,IAAI,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AO,EAAE,GAAG,EAAE;YAC1B,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAC7D,OAAO,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC;YACD,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAmC,CAAC,EAAE,CAAC,CAAC;YACtD,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -2,23 +2,23 @@ import { Enum } from '../enums';
2
2
  import { PSObject } from './core';
3
3
  import { Condition } from './conditions';
4
4
  export declare const TreeScope: Readonly<{
5
- readonly ANCESTORS_OR_SELF: "ancestors-or-self";
6
- readonly FOLLOWING: "following";
7
- readonly FOLLOWING_SIBLING: "following-sibling";
8
- readonly PRECEDING: "preceding";
9
- readonly PRECEDING_SIBLING: "preceding-sibling";
10
- readonly ANCESTORS: "ancestors";
11
- readonly CHILDREN_OR_SELF: "child-or-self";
12
- readonly CHILDREN: "children";
13
- readonly DESCENDANTS: "descendants";
14
- readonly ELEMENT: "element";
15
- readonly SUBTREE: "subtree";
16
- readonly PARENT: "parent";
5
+ ANCESTORS_OR_SELF: "ancestors-or-self";
6
+ FOLLOWING: "following";
7
+ FOLLOWING_SIBLING: "following-sibling";
8
+ PRECEDING: "preceding";
9
+ PRECEDING_SIBLING: "preceding-sibling";
10
+ ANCESTORS: "ancestors";
11
+ CHILDREN_OR_SELF: "child-or-self";
12
+ CHILDREN: "children";
13
+ DESCENDANTS: "descendants";
14
+ ELEMENT: "element";
15
+ SUBTREE: "subtree";
16
+ PARENT: "parent";
17
17
  }>;
18
18
  export type TreeScope = Enum<typeof TreeScope>;
19
19
  export declare const AutomationElementMode: Readonly<{
20
- readonly NONE: "none";
21
- readonly FULL: "full";
20
+ NONE: "none";
21
+ FULL: "full";
22
22
  }>;
23
23
  export type AutomationElementMode = Enum<typeof AutomationElementMode>;
24
24
  export declare class AutomationElement extends PSObject {
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../lib/powershell/elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAS,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAmhBzC,eAAO,MAAM,SAAS;;;;;;;;;;;;;EAaX,CAAC;AAEZ,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAE/C,eAAO,MAAM,qBAAqB;;;EAGvB,CAAC;AAEZ,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,qBAAa,iBAAkB,SAAQ,QAAQ;gBAC/B,OAAO,EAAE,MAAM;IAI3B,MAAM,KAAK,cAAc,IAAI,iBAAiB,CAE7C;IAED,MAAM,KAAK,WAAW,IAAI,iBAAiB,CAE1C;IAED,MAAM,KAAK,cAAc,IAAI,iBAAiB,CAE7C;IAED,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,iBAAiB;IA2BpE,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,iBAAiB;IA2BlE,sBAAsB,IAAI,MAAM;IAIhC,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAgBjD,4BAA4B,IAAI,MAAM;IAItC,0BAA0B,IAAI,MAAM;IAIpC,oBAAoB,IAAI,MAAM;IAI9B,YAAY,IAAI,MAAM;CAGzB;AAED,qBAAa,sBAAuB,SAAQ,iBAAiB;IACzD,QAAQ,CAAC,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