Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Page Object Model #10

Open
wurzelkuchen opened this issue Sep 13, 2024 · 0 comments
Open

Improve Page Object Model #10

wurzelkuchen opened this issue Sep 13, 2024 · 0 comments

Comments

@wurzelkuchen
Copy link
Contributor

As discussed previously our page object model has some design flaws which could be handled more elegantly.

Please rework the abstract components and abstract page objects to better match the java naming conventions and offer a slightly different set of methods.



public abstract class AbstractComponent<T extends AbstractComponent<T>>
{
    abstract public boolean isComponentAvailable();

    abstract public T validateStructure();
}

and

public abstract class AbstractPageObject<T extends AbstractPageObject<T>>
{
    //....

    public abstract boolean isExpectedPage();

    public T assertExcpectedPage()
    {
        SelenideAddons.wrapAssertionError(() -> {
            Assert.assertTrue("Page could not be identified", isExpectedPage());
        });
        return (T) this;
    }

    public abstract T validateStructure();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant