package com.intland.codebeamer.functionaltest.page;

import com.intland.codebeamer.functionaltest.page.baselines.NewBaselineDialog;
import org.openqa.selenium.By;

import static com.codeborne.selenide.Selectors.byText;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.page;

public class BaselinesPage extends BasePage {

    public NewBaselineDialog clickOnNewBaseline() {
        $(By.linkText("New Baseline")).click();
        return page(NewBaselineDialog.class);
    }

    public void setName(String name) {
        $(By.id("createArtifactPopup")).$(By.name("name")).setValue(name);
    }

    public void setDescription(String description) {
        $(By.id("createArtifactPopup")).$(By.name("description")).setValue(description);
    }

    public void clickOnOk() {
        $(By.className("ui-dialog-buttonpane")).$(byText("OK")).click();
    }

}
