|
| 1 | +import { z } from "zod"; |
| 2 | + |
| 3 | +export const attachToBrowserSchema = { |
| 4 | + session: z |
| 5 | + .object({ |
| 6 | + sessionId: z.string().describe("Unique identifier for the session"), |
| 7 | + sessionCaps: z |
| 8 | + .object({ |
| 9 | + acceptInsecureCerts: z |
| 10 | + .boolean() |
| 11 | + .describe("Whether the session accepts insecure certificates") |
| 12 | + .optional(), |
| 13 | + browserName: z.string().describe("Name of the browser being automated"), |
| 14 | + browserVersion: z.string().describe("Version of the browser"), |
| 15 | + chrome: z |
| 16 | + .object({ |
| 17 | + chromedriverVersion: z.string().describe("Version of ChromeDriver being used"), |
| 18 | + userDataDir: z.string().describe("Path to Chrome's user data directory"), |
| 19 | + }) |
| 20 | + .describe("Chrome-specific capabilities") |
| 21 | + .optional(), |
| 22 | + "fedcm:accounts": z.boolean().describe("FedCM accounts API support flag").optional(), |
| 23 | + "goog:chromeOptions": z |
| 24 | + .object({ |
| 25 | + debuggerAddress: z.string().describe("Address for Chrome debugger"), |
| 26 | + }) |
| 27 | + .describe("Chrome options") |
| 28 | + .optional(), |
| 29 | + networkConnectionEnabled: z.boolean().describe("Network connection capability flag").optional(), |
| 30 | + pageLoadStrategy: z.string().describe("Strategy for page loading").optional(), |
| 31 | + platformName: z.string().describe("Name of the platform").optional(), |
| 32 | + proxy: z.object({}).describe("Proxy configuration").optional(), |
| 33 | + setWindowRect: z.boolean().describe("Window resizing capability flag"), |
| 34 | + strictFileInteractability: z.boolean().describe("Strict file interaction flag").optional(), |
| 35 | + timeouts: z |
| 36 | + .object({ |
| 37 | + implicit: z.number().describe("Implicit wait timeout in ms"), |
| 38 | + pageLoad: z.number().describe("Page load timeout in ms"), |
| 39 | + script: z.number().describe("Script execution timeout in ms"), |
| 40 | + }) |
| 41 | + .describe("Timeout configurations") |
| 42 | + .optional(), |
| 43 | + unhandledPromptBehavior: z.string().describe("Behavior for unhandled prompts").optional(), |
| 44 | + "webauthn:extension:credBlob": z |
| 45 | + .boolean() |
| 46 | + .describe("WebAuthn credBlob extension support") |
| 47 | + .optional(), |
| 48 | + "webauthn:extension:largeBlob": z |
| 49 | + .boolean() |
| 50 | + .describe("WebAuthn largeBlob extension support") |
| 51 | + .optional(), |
| 52 | + "webauthn:extension:minPinLength": z |
| 53 | + .boolean() |
| 54 | + .describe("WebAuthn minPinLength extension support") |
| 55 | + .optional(), |
| 56 | + "webauthn:extension:prf": z.boolean().describe("WebAuthn prf extension support").optional(), |
| 57 | + "webauthn:virtualAuthenticators": z.boolean().describe("Virtual authenticators support").optional(), |
| 58 | + }) |
| 59 | + .describe("Session capabilities"), |
| 60 | + sessionOpts: z |
| 61 | + .object({ |
| 62 | + protocol: z.string().describe("Protocol used for connection"), |
| 63 | + hostname: z.string().describe("Hostname for WebDriver server"), |
| 64 | + port: z.number().describe("Port for WebDriver server"), |
| 65 | + path: z.string().describe("Base path for WebDriver endpoints"), |
| 66 | + queryParams: z.object({}).describe("Additional query parameters").optional(), |
| 67 | + capabilities: z |
| 68 | + .object({ |
| 69 | + browserName: z.string().describe("Requested browser name"), |
| 70 | + "wdio:enforceWebDriverClassic": z |
| 71 | + .boolean() |
| 72 | + .describe("Flag to enforce classic WebDriver protocol"), |
| 73 | + "goog:chromeOptions": z |
| 74 | + .object({ |
| 75 | + binary: z.string().describe("Path to Chrome binary"), |
| 76 | + }) |
| 77 | + .describe("Chrome-specific options"), |
| 78 | + }) |
| 79 | + .describe("Requested capabilities") |
| 80 | + .optional(), |
| 81 | + logLevel: z.string().describe("Logging level").optional(), |
| 82 | + connectionRetryTimeout: z.number().describe("Connection retry timeout in ms").optional(), |
| 83 | + connectionRetryCount: z.number().describe("Maximum connection retry attempts").optional(), |
| 84 | + enableDirectConnect: z.boolean().describe("Flag for direct connection to browser").optional(), |
| 85 | + strictSSL: z.boolean().describe("Strict SSL verification flag"), |
| 86 | + requestedCapabilities: z |
| 87 | + .object({ |
| 88 | + browserName: z.string().describe("Originally requested browser name"), |
| 89 | + "wdio:enforceWebDriverClassic": z |
| 90 | + .boolean() |
| 91 | + .describe("Originally requested protocol enforcement"), |
| 92 | + "goog:chromeOptions": z.object({ |
| 93 | + binary: z.string().describe("Originally requested Chrome binary path"), |
| 94 | + }), |
| 95 | + }) |
| 96 | + .describe("Originally requested capabilities") |
| 97 | + .optional(), |
| 98 | + automationProtocol: z.string().describe("Automation protocol being used").optional(), |
| 99 | + baseUrl: z.string().describe("Base URL for tests").optional(), |
| 100 | + waitforInterval: z.number().describe("Wait interval in ms").optional(), |
| 101 | + waitforTimeout: z.number().describe("Wait timeout in ms").optional(), |
| 102 | + }) |
| 103 | + .describe("Session options") |
| 104 | + .optional(), |
| 105 | + }) |
| 106 | + .describe("Attach to browser json object from console after --keep-browser testplane run"), |
| 107 | +}; |
0 commit comments