Skip to content

Conversation

@jf-x-dev
Copy link
Collaborator

@jf-x-dev jf-x-dev commented Dec 1, 2025

This PR changes how we extract and share functionality between page objects. Previously, we were creating mixins with locators and methods, which were then inherited by page objects. Our mixins also relied on the Playwright page object, which means they needed to be initialised.

This does not scale very well. When page objects want to use multiple mixins, they have to inherit from each. This requires handling multi-inheritance and ensuring constructors for each mixin are called correctly. This starts to require extra handling as the number of mixins grows, which is not ideal.

We should use composition instead. Our mixins are now components, and page objects that use their functionality now just set a field (e.g. self.tabs = ChildRecordTabs(page)) which can then be accessed whenever this functionality is required. It's much easier to scale this up and will help with some upcoming PRs.

@jf-x-dev jf-x-dev requested a review from a team as a code owner December 1, 2025 17:16
@jf-x-dev jf-x-dev mentioned this pull request Dec 1, 2025
@jf-x-dev jf-x-dev merged commit 2f995d0 into main Dec 1, 2025
5 checks passed
@jf-x-dev jf-x-dev deleted the use-components branch December 1, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants