|
6 | 6 | import * as playwright from '@playwright/test';
|
7 | 7 | // eslint-disable-next-line local/code-import-patterns
|
8 | 8 | import type { Protocol } from 'playwright-core/types/protocol';
|
9 |
| -import { dirname, join } from 'path'; |
| 9 | +import path, { dirname, join } from 'path'; |
10 | 10 | import { promises } from 'fs';
|
11 | 11 | import { IWindowDriver } from './driver';
|
12 | 12 | // eslint-disable-next-line local/code-import-patterns
|
@@ -186,6 +186,23 @@ export class PlaywrightDriver {
|
186 | 186 |
|
187 | 187 | // Desktop: exit via `driver.exitApplication`
|
188 | 188 | else {
|
| 189 | + |
| 190 | + // Log all files in extensionsPath |
| 191 | + const extensionsPath = this.options.extensionsPath; |
| 192 | + this.options.logger.log(`Listing files in: ${extensionsPath}`); |
| 193 | + |
| 194 | + const files = await promises.readdir(extensionsPath); |
| 195 | + this.options.logger.log(`Files in extensionsPath: ${files.join(', ')}`); |
| 196 | + |
| 197 | + // Read and log contents of extensions.json (if it exists) |
| 198 | + const extensionsJsonPath = path.join(extensionsPath, 'extensions.json'); |
| 199 | + try { |
| 200 | + const extensionsJsonContent = await promises.readFile(extensionsJsonPath, 'utf-8'); |
| 201 | + this.options.logger.log(`Contents of extensions.json:\n${extensionsJsonContent}`); |
| 202 | + } catch (jsonError) { |
| 203 | + this.options.logger.log(`extensions.json not found or cannot be read: ${jsonError}`); |
| 204 | + } |
| 205 | + |
189 | 206 | try {
|
190 | 207 | await measureAndLog(() => this.evaluateWithDriver(([driver]) => driver.exitApplication()), 'driver.exitApplication()', this.options.logger);
|
191 | 208 | } catch (error) {
|
|
0 commit comments