package ru.otus.mobile.component;

import com.codeborne.selenide.SelenideElement;

public final class AlertDialogComponent extends BaseMobileComponent {
    private final SelenideElement positiveButton = byIdInRoot("android:id/button1");

    public AlertDialogComponent(SelenideElement root) {
        super(root);
    }

    public void acceptIfVisible() {
        if (positiveButton.exists()) {
            positiveButton.click();
        }
    }
}
