package ru.otus.mobile.component;

import com.codeborne.selenide.SelenideElement;

public final class GiftFormComponent extends BaseMobileComponent {
    private final SelenideElement nameInput = byIdInRoot("name_input");
    private final SelenideElement priceInput = byIdInRoot("price_input");
    private final SelenideElement saveButton = byIdInRoot("save_button");

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

    public void save(String name, String price) {
        nameInput.click();
        nameInput.clear();
        nameInput.sendKeys(name);
        priceInput.click();
        priceInput.clear();
        priceInput.sendKeys(price);
        saveButton.click();
    }
}
