What’s the Best Project Structure for UI Automation with Playwright + Cucumber?

We’re in the process of designing a UI automation framework using Playwright with Cucumber (BDD). The main goal is to keep the test suite highly maintainable and quick to update — since our project often faces frequent UI and requirement changes.

We’re looking for the best possible project structure and design patterns that can handle:

:white_check_mark: Rapid updates to locators and test data

:white_check_mark: Reusability of step definitions and page objects

:white_check_mark: Clear separation between feature files, steps, and business logic

:white_check_mark: AI-assisted or intelligent script updates (in line with current AI-driven testing trends)

Would love to hear from the community:

What folder structure and conventions work best for you?

Any best practices to future-proof Playwright+Cucumber automation in this fast-changing AI era?

Should we still use the Page Object Model, or move to Screenplay or Component-based patterns for more agility?

Looking forward to your insights and examples!

Rather than mandating cucumber, if you are looking at AI assisted tests, have you consider embracing the Playwright agents? Agents | Playwright

I think the trio of Planner, Generator, and Healer sound like they will give you the type of framework you are looking for.

I would like to know why do you need the Cucumber framework to be added?

Note: “intelligent script updates”….good luck with it :slight_smile: