Qytera-Gmbh / QTAF

QTAF is a Java test framework based on TestNG and offers easy setup of Selenium and fast extensibility.
https://qytera-gmbh.github.io
MIT License
10 stars 0 forks source link

Added Standard Page Objects #297

Open qytera-development opened 3 months ago

qytera-development commented 3 months ago

Added Standard Page Objects

csvtuda commented 3 months ago

I'm not a reviewer here, but I would like to point out a few things for your consideration.

Assertions

I don't think moving assertions into the page objects is going to make your life easier. You'll sooner or later be faced with assertions that cannot be easily built with the ones you've added. For example, how are users going to assert that:

Probably through first retrieving the raw SelenideElement using element() and by then writing the assertions outside of the element's class themselves. So why bother with the elements' assertions at all? Writing:

assertEquals(element().getText(), "hello");

is not that much longer compared to:

element.assertInnerTextEquals("hello");

Rigid page objects

All QTAF elements can be clicked, which is good. But:

Well, they can. By first retrieving the raw SelenideElement using element() and by then writing the interactions themselves using said Selenide element. Or by writing the method for retrieving the String and converting it into a date object themselves.

These page objects are way too rigid in my opinion. And some feel very arbitrary, like the NumberElement for Double only. Where's the Integer parsing? And with text and numbers covered, do we also need an ImageElement? There will be a lot of confusion for QTAF users when raw Selenide elements are scattered across the application, only because QTAF's elements do not offer the required flexibility.

There's a reason that more or less all HTML-based UI testing frameworks only provide a single type of Element, be it WebElement in plain Selenium, SelenideElement in Selenide, Locator in Playwright or even Cypress with its subject chains. Applications aren't homogeneous enough to divide them into less than ten page objects. And adding more page objects would just lead to greater maintenance and design efforts, both from QTAF developers and QTAF users. Do I need a FormElement or a FormInputElement? What happens if a ButtonElement needs to become a FormElement? Do all tests need to adapted?


All in all I think what bothers me is the following. If:

Why should they bother sticking to QTAF elements?