So I am debating a bit on whether it makes sense to have a sort of isLoaded
or similar method in a page object. I know there is some debate on having assertions in page objects (Most say no, some say yes) but I guess that's not what my question is necessarily about.
I think classes like LoadableComponent
were built in selenium to reduce flakiness (which makes sense) but with newer frameworks having auto-waiting functionality/etc... that makes less sense to use.
My question I suppose is if it makes sense to have a function (say isLoaded
) that purely acts as an assertion method on the key elements of a page and less of a flakiness band-aid. Sort of a method you can call to ensure that page "generally" looks and has the elements you need (Without using visual regression or anything heavier).
However when I think about something like this, you would only ever want to call it once right? Since there isn't a need to do multiple assertions on the same thing you've asserted. In that case does it make more sense to just have a test case that runs multiple assertions on key elements of a page?
Hopefully what im asking makes sense, and im curious if people have something similar in newer frameworks (like Playwright/Selenium) where we don't rely on an isLoaded
type method to combat flakiness.