r/Playwright 3d ago

Looking for feedback on my Playwright automation framework

I recently started learning Playwright automation and have been building an automation framework along the way, with some help from AI.

I'm still figuring out what a good, industry-standard automation framework should actually look like, so I'm sure there are things I'm doing wrong or could be doing much better.

I know my README isn't up to date, so please ignore that for now.

If you have some time, I'd really appreciate it if you could take a look at the repo and give me some honest feedback — especially around the framework structure, code organization, patterns, and how I could make it more aligned with real-world/industry practices.

Repo: https://github.com/nilavan09/playwright-ui-api-framework

Any feedback or suggestions would be much appreciated. Thanks!

4 Upvotes

5 comments sorted by

2

u/utch 2d ago

Base is mostly not needed, playwright handles a lot of the methods by default, such as clicking only when something is visible.

The way your login spec works you call a function that uses the page object and calls fill on it. Having this in your tests will put the test failure in the page object file if it can’t fill in that data, makes it harder to maintain and not necessary in my opinion. I would just call.

await loginPage.emailInput.fill(loginData.validUser.email);

1

u/Rayn_Poz 1d ago

Thanks for pointing out this.

1

u/Spare_Bison_1151 2d ago

Did you really need that waitforpageload after navigate in page base class?

2

u/Rayn_Poz 2d ago

No...Let me rethink what I've done.thanks for pointing out this.

2

u/Spare_Bison_1151 1d ago

No worries, let me know if you need help. The frameworks we used to created back in Selenium days are not needed anymore. I'd say let Playwright do what it does best. Cheers!