Skip to content

Conversation

edeandrea
Copy link
Contributor

@edeandrea edeandrea commented Jan 31, 2025

This would also open up a pattern to be able to further customize the BrowserContext, or other things within Playwright.

I initially tried to do it via properties (i.e. quarkus.playwright.*), but unfortunately a QuarkusTestResourceConfigurableLifecycleManager doesn't have access to @ConfigMappings (I checked with Georgios).

This would also open up a pattern to be able to further customize the `BrowserContext`, or other things within Playwright.

I initially tried to do it via properties (i.e. `quarkus.playwright.*`, but unfortunately a `QuarkusTestResourceConfigurableLifecycleManager` doesn't have access to `@ConfigMapping`s (I checked with Georgios).
Copy link
Contributor

@melloware melloware left a comment

Choose a reason for hiding this comment

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

nice!

@melloware melloware added the enhancement New feature or request label Jan 31, 2025
@edeandrea
Copy link
Contributor Author

edeandrea commented Jan 31, 2025

@melloware this doesn't actually fix #60. It has something in common, but doesn't solve that problem.

See #60 (comment)

@melloware
Copy link
Contributor

OK I removed the tag. I love this PR though when you get it working.

@edeandrea
Copy link
Contributor Author

This PR is working and complete. I only provided a couple of options for now. I didn't want to have to mirror the entire Playwright API.

A QuarkusTestResourceConfigurableLifecycleManager doesn't have access to a ConfigMapping class (because the QuarkusTestResourceConfigurableLifecycleManager is not a bean itself).

Even trying to unwrap it with ConfigProvider.getConfig().unwrap(SmallryeConfig.class).getConfigMapping() doesn't work. It has something to do with the ordering in which things happen. The config classes aren't yet available when a QuarkusTestResourceConfigurableLifecycleManager is instantiated and its start method is called.

If we want to move to a properties-based configuration model then we will have to move away from having the implementation using a QuarkusTestResourceConfigurableLifecycleManager.

@melloware melloware merged commit 1fe11d7 into quarkiverse:main Jan 31, 2025
1 check passed
@melloware
Copy link
Contributor

want me to publish a release?

@melloware
Copy link
Contributor

@all-contributors add @edeandrea for code

Copy link
Contributor

@melloware

I've put up a pull request to add @edeandrea! 🎉

@edeandrea edeandrea deleted the customizing-context branch January 31, 2025 21:11
@edeandrea
Copy link
Contributor Author

want me to publish a release?

That's up to you. Would be nice to have this feature! I was implementing it myself with JUnit on the BrowserContext and figured having it on the framework would be a better place.

@melloware
Copy link
Contributor

publishing 2.1.0 now!

@melloware
Copy link
Contributor

2.1.0 is in Maven Central

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants