<commit_before>package com.codeborne.selenide.integrationtests;

import com.codeborne.selenide.ex.DialogTextMismatch;
import com.codeborne.selenide.junit.ScreenShooter;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.openqa.selenium.By;

import java.util.Arrays;
import java.util.List;

import static com.codeborne.selenide.Condition.empty;
import static com.codeborne.selenide.Condition.text;
import static com.codeborne.selenide.Selectors.byText;
import static com.codeborne.selenide.Selenide.*;
import static com.codeborne.selenide.WebDriverRunner.isHeadless;
import static java.lang.Thread.currentThread;
import static org.junit.Assert.fail;

@RunWith(Parameterized.class)
public class ConfirmTest {
  @Parameterized.Parameters
  public static List<Object[]> names() {
    return Arrays.asList(new Object[]{"<NAME>"}, new String[]{"Lucie"});
  }

  @Rule
  public ScreenShooter failedTests = ScreenShooter.failedTests();

  private final String userName;

  public ConfirmTest(String userName) {
    this.userName = userName;
  }

  @Before
  public void openTestPage() {
    open(currentThread().getContextClassLoader().getResource("page_with_alerts.html"));
    $("h1").shouldHave(text("Page with alerts"));
    $(By.name("username")).val(userName);
  }

  @Test
  public void canSubmitConfirmDialog() {
    onConfirmReturn(true);
    $(byText("Confirm button")).click();
    confirm("Get out of this page, " + userName + '?');<commit_msg>Test confirm dialog with cyrillic text<commit_after>package com.codeborne.selenide.integrationtests;

import com.codeborne.selenide.ex.DialogTextMismatch;
import com.codeborne.selenide.junit.ScreenShooter;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.openqa.selenium.By;

import java.util.Arrays;
import java.util.List;

import static com.codeborne.selenide.Condition.empty;
import static com.codeborne.selenide.Condition.text;
import static com.codeborne.selenide.Selectors.byText;
import static com.codeborne.selenide.Selenide.*;
import static com.codeborne.selenide.WebDriverRunner.isHeadless;
import static com.codeborne.selenide.junit.ScreenShooter.failedTests;
import static java.lang.Thread.currentThread;
import static org.junit.Assert.fail;

@RunWith(Parameterized.class)
public class ConfirmTest {
  @Parameterized.Parameters
  public static List<Object[]> names() {
    return Arrays.asList(new Object[]{"<NAME>"}, new String[]{"<NAME>"}, new String[]{"Серафим"});
  }

  @Rule
  public ScreenShooter screenshots = failedTests().succeededTests();

  private final String userName;

  public ConfirmTest(String userName) {
    this.userName = userName;
  }

  @Before
  public void openTestPage() {
    open(currentThread().getContextClassLoader().getResource("page_with_alerts.html"));
    $("h1").shouldHave(text("Page with alerts"));
    $(By.name("username")).val(userName);
  }

  @Test
  public void canSubmitConfirmDialog() {
    onConfirmReturn(true);
    $(byText("Confirm button")).click();
    confirm("Get out of this page, " + userName + '?');
{'fraction_non_alphanumeric': 0.12856257744733582, 'fraction_numerical': 0.0006195786864931846, 'mean_word_length': 5.483935742971887, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '7322340', 'n_tokens_mistral': 1034, 'n_tokens_neox': 1009, 'n_words': 196}