package com.intland.codebeamer.functionaltest.page.trackers.documentview;

import org.openqa.selenium.By;

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 license agreement
 * you entered into with Intland.
 */
public class RatingDialog {


    public void clickOnRateButton() {
        //$(".ratingDialog").click(); //for some strange reason first you have to activate the dialog to be able to find elements on it
        $("input[value=Rate]").click();
    }

    /**
     * @param value 1-5
     */
    public void clickOnRateStar(int value) {
        //$(".ratingDialog").click();
        $(By.xpath(".//div[contains(@class, 'myRating')]//div[@class='star ']["+value+"]")).click();
    }

    public void fillComment(CharSequence text){
        $("textarea.ratingComment").sendKeys(text);
    }
}
