package ru.otus.mobile.component;

import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.SelenideElement;
import io.appium.java_client.AppiumBy;
import ru.otus.mobile.page.AbsPageObject;

public abstract class BaseMobileComponent extends AbsPageObject {
    protected final SelenideElement root;

    protected BaseMobileComponent(SelenideElement root) {
        this.root = root;
    }

    protected SelenideElement byIdInRoot(String id) {
        return root.$(AppiumBy.id(fullIdValue(id)));
    }

    protected ElementsCollection allByIdInRoot(String id) {
        return root.$$(AppiumBy.id(fullIdValue(id)));
    }
}
