package ru.otus.mobile.component;

import com.codeborne.selenide.SelenideElement;

import static com.codeborne.selenide.Condition.text;

public final class WishlistItemComponent extends BaseMobileComponent {
    private final SelenideElement title = byIdInRoot("title");
    private final SelenideElement editButton = byIdInRoot("edit_button");

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

    public String titleText() {
        return title.getText();
    }

    public void shouldHaveTitle(String value) {
        title.shouldHave(text(value));
    }

    public void open() {
        title.click();
    }

    public void edit() {
        editButton.click();
    }
}
