Closed lsdkjflasjflkdasj closed 4 years ago
"Do not despair! I will also show an alternative to page objects that I call “Application Actions” that our end-to-end tests can use. I believe application actions solve the above problems very well, making end-to-end tests fast and productive."
Here is the other offending text which basically implies that "Application Actions" are actually an alternative to page objects. They don't replace the behavior of page objects at all.
Hey @lsdkjflasjflkdasj, Cypress as a product and a team are opinionated. It's part of our culture and we often recommend pathways that we feel are best to use or best to avoid. Being an opinionated product, we also hear lots of opposing opinions from the community and are listening.
I would not take the blog as the end all truth on Cypress. If you find that Page Objects work best for your team then go for it. Thanks for sharing your opinion. It'd be great to see a blog on the solutions you come up with and how Page Objects work for you.
Issues in our GitHub repo are reserved for potential bugs or feature requests, so this issue will be closed since it is neither a bug nor a feature request.
The documentation clearly states that page object is not to be used and that application actions are the alternative. Yes, this may be an opinion, but when the VP of engineering turns around and says, "yes you can use page object", people are going to be confused. If you say "yes" and "no" at the same time, it's meaningless.
Logical contradictions in actual officially written documentation should not be there. The bug is this.
@lsdkjflasjflkdasj Please feel free to share my above comment with your team. I speak for the Cypress team in saying that if you find Page Objects work best for your team then use them. The blog was an opinion piece.
After spending many many hours discussing architecture with the team, I feel that this article has misled them to believe that page objects should not be used AT ALL. There are many use cases of us needing to write tests with a heavily reused final (UI) step in tests. This re-used final step is checkout (like filling out first/last/credit card info etc). To have an app action for this complete credit card form checkout is pretty bad. Each field needs to be filled out atomically due to security concerns (storing info). We need this reusable "form fill out" function somewhere in our testing repo but the article only provided A LOT of confusion.
Here is what we discussed:
In short, the article is misleading and harmful. Please at least change the title of it.