Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add config.browser options #373

Merged
merged 1 commit into from
Mar 2, 2025
Merged

Conversation

rmarescu
Copy link
Member

@rmarescu rmarescu commented Mar 2, 2025

Adds browser.contextOptions to pass custom Playwright browser context options.

  • Allows configuring browser behavior (ignore HTTPS errors, permissions, geolocation)
  • Apply options when initializing browser context

Sample config with browser option:

export default {
  headless: false,
  baseUrl: "http://localhost:3000",
  browser: {
    contextOptions: {
      ignoreHTTPSErrors: true,
    },
  },
  testPattern: "**/*.test.ts",
  ai: {
    provider: "anthropic",
  },
} satisfies ShortestConfig;

@rmarescu rmarescu added this to the v0.4.5 milestone Mar 2, 2025
@rmarescu rmarescu self-assigned this Mar 2, 2025
Copy link

vercel bot commented Mar 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
shortest ⬜️ Ignored (Inspect) Mar 2, 2025 1:23am

@rmarescu rmarescu marked this pull request as ready for review March 2, 2025 04:09
Copy link
Member Author

@rmarescu rmarescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Flexile CI.

*/
contextOptions: z.custom<BrowserContextOptions>().optional(),
});

export const configSchema = z
.object({
headless: z.boolean().default(true),
baseUrl: z.string().url("must be a valid URL"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved into browserSchema, and ideally made optional (with default about:blank).

@rmarescu rmarescu merged commit 0f8798f into main Mar 2, 2025
6 checks passed
@rmarescu rmarescu deleted the rmarescu/context-options branch March 2, 2025 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant