| 241 | } |
| 242 | |
| 243 | private kill(pid: number): void { |
| 244 | try { |
| 245 | process.kill(pid, 0); // throws an exception if the process doesn't exist anymore. |
| 246 | } catch (e) { |
| 247 | this.logger.log('Smoke test kill(): returning early because process does not exist anymore'); |
| 248 | return; |
| 249 | } |
| 250 | |
| 251 | try { |
| 252 | this.logger.log(`Smoke test kill(): Trying to SIGTERM process: ${pid}`); |
| 253 | process.kill(pid); |
| 254 | } catch (e) { |
| 255 | this.logger.log('Smoke test kill(): SIGTERM failed', e); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | async getElement(selector: string): Promise<IElement | undefined> { |
| 260 | return (await this.driver.getElements(selector))?.[0]; |