<commit_before>package pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import utils.Log4Test;

public class BasketPage extends BasePage {
    private static final By title = By.className("cart-title");
    private static final By productTitle = By.className("no-visited");
    private static final By productPrice = By.className("cart-uah");
    private static final By productAmount = By.className("cart-amount");
    private static final By priceSum = By.className("cart-uah cart-sum-uah");
    private static final By priceTotal = By.className("cart-total-uah");

    public BasketPage(WebDriver driver) {
        super(driver);
    }

    public Boolean checkProductTitle(String productName) {
        Log4Test.info("Check title of added product.");
        wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(productPrice));
        return driver.findElement(productTitle).getText().equals(productName);
    }

    public Boolean checkProductPrice(String price, String currency) {
        Log4Test.info("Check price of added product.");
        wait.until(ExpectedConditions.visibilityOfElementLocated(productPrice));
        return driver.findElement(productPrice).getText().equals(price + " " + currency);
    }
}<commit_msg>WebElement's with PageFactory pattern are used instead of By's.<commit_after>package pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedConditions;
import utils.Log4Test;

public class BasketPage extends BasePage {
    @FindBy(className = "cart-title")
    private WebElement title;
    @FindBy(className = "no-visited")
    private WebElement productTitle;
    @FindBy(className = "cart-uah")
    private WebElement productPrice;
    @FindBy(className = "cart-amount")
    private WebElement productAmount;
    @FindBy(className = "cart-uah cart-sum-uah")
    private WebElement priceSum;
    @FindBy(className = "cart-total-uah")
    private WebElement priceTotal;

    public BasketPage(WebDriver driver) {
        super(driver);
    }

    public Boolean checkProductTitle(String productName) {
        Log4Test.info("Check title of added product.");
        wait.until(ExpectedConditions.visibilityOf(productPrice));
        return productTitle.getText().equals(productName);
    }

    public Boolean checkProductPrice(String price, String currency) {
        Log4Test.info("Check price of added product.");
        wait.until(ExpectedConditions.visibilityOf(productPrice));
        return productPrice.getText().equals(price + " " + currency);
    }
}
{'fraction_non_alphanumeric': 0.10510948905109489, 'fraction_numerical': 0.0021897810218978104, 'mean_word_length': 4.16195856873823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '956224', 'n_tokens_mistral': 767, 'n_tokens_neox': 752, 'n_words': 172}