package ru.otus.mobile.component;

import com.codeborne.selenide.SelenideElement;

public final class TopBarComponent extends BaseMobileComponent {
    public TopBarComponent(SelenideElement root) {
        super(root);
    }

    public void openUsersFilter() {
        if (byId("filter").exists()) {
            byId("filter").click();
            return;
        }
        if (byId("users_filter").exists()) {
            byId("users_filter").click();
            return;
        }
        if (byId("filter_button").exists()) {
            byId("filter_button").click();
            return;
        }
        if (byId("action_filter").exists()) {
            byId("action_filter").click();
            return;
        }
        throw new IllegalStateException("Filter button was not found on Users screen.");
    }
}
