Moving Nala to POMs over .selectors.js module exports #589
Closed
amauch-adobe
started this conversation in
Ideas
Replies: 4 comments
-
Here is Playwright's documentation on POMs: https://playwright.dev/docs/pom |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
This is good, we should have as soon as possible |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think the addition would be beneficial for those who'll need it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wanted to start a location for going over everyone's opinions, thoughts, and hopefully a decision on how things should be set up going forward for Nala in regards to the usage of POMs (Page Object Models) or the .selectors.js module export files.
Daniel Chivescu from the FEDS team has proposed a few templates and proposed methods for having POMs (which Playwright out-of-the-box supports) for organizing, minimalizing, and page reuse for methods and selectors. This would remove having tons of lib methods for different test cases across multiple test files. I think the original idea for selectors module exports was great for testing milo blocks/features, which was how Nala was first put together, but for testing different applications that span functionality across different pages, it isn't as robust, clean, and scalable.
I propose we use POMs when it makes sense, as Daniel put out in his first template PR for FEDS. POMs I believe should not become bulky, cluttered, or have massive amounts of multi-inheritance since that makes tests also difficult to understand since there are so many pages to drive through. Daniel made a good argument here:
I do think selector files work for some cases, i.e. quick block tests, but for Federated services having POMs to me makes more sense and probably should be contributed to Nala Core since all Milo-based sites will probably use them. That being said I do believe there needs to be careful consideration as to what things go inside POMs, when a POM should be created, and meticulous discretion/forbearance on testing templated pages/functionality over and over again.
Beta Was this translation helpful? Give feedback.
All reactions