orange-buffalo / testcontainers-playwright

Testcontainers-based container for Playwright
Apache License 2.0
2 stars 1 forks source link

Configurable browser launch options #113

Open danielFesenmeyer opened 7 months ago

danielFesenmeyer commented 7 months ago

Hi @orange-buffalo,

it seems like currently the browsers are started with default launch options. Would you accept a PR that supports to specify arbitrary launch options such as slowMo or headless?

I think about adding these launchOptions to the "launch request" and evaluating it here: https://github.com/orange-buffalo/testcontainers-playwright/blob/c8374a5cb7a2c126931098dea7b7fcd1ee1ee6b6/src/main/resources/playwright-server.js#L18

orange-buffalo commented 7 months ago

Hi there,

Yes, we can do that. Initially I was concerned that some of the launch options are not compatible with the container mode, e.g. executablePath, so either we need to maintain a sub-set of options that can be used with both local and container modes, or we allow to fail when incompatible option is passed (and potentially cause users' frustration), or we maintain a blacklist of incompatible options (and provide a user-friendly message instead of later unclear failures); hence delayed implementation of this feature.

Maybe it is also partially driven by the way we implement passing the options throughout the layers.

I am open to proposals here :)

orange-buffalo commented 1 month ago

I was thinking about this request, and so far my conclusions are the following:

Having said that, I am inclining to close this issue without providing changes. Perhaps if we collect more details about the use cases for this request, we could make a better decision.

danielFesenmeyer commented 1 month ago

@orange-buffalo Thanks for your detailed explanation.

The idea of "slowMo" rather was to have a simple means to check whether a test failure might be caused by timing issues. (Might be the case when the test passes with "slowMo", but fails otherwise.) I wanted to use it for flaky tests, but found another way to handle those in the mean time.