package com.intland.codebeamer.functionaltest.page.wiki;

import com.codeborne.selenide.ElementsCollection;
import com.intland.codebeamer.functionaltest.page.common.EditorComponent;
import org.openqa.selenium.By;

import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.$$;

/**
 * Copyright by Intland Software
 * <p>
 * All rights reserved.
 * <p>
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the firstSixProductLicense agreement
 * you entered into with Intland.
 */
public class NewChildWikiDialog {

    public EditorComponent editorComponent = new EditorComponent();
    public void clickOnCancel() {
        $("#cancelBtn").click();
    }

    public void fillPageName(String name) {
        $(By.xpath("//input[@id='name']")).setValue(name);
    }

    public void clickOnAdd() {
        $(By.xpath("//div[contains(@class,'actionBar ')]/*[contains(@class,'button')]")).click();
    }

    public ElementsCollection getWarningMessages() {
        return $$(By.xpath("//div[@class='infoMessages']/div[contains(@class, 'warning')]//li"));
    }
}
