<commit_before>package integration;

import org.junit.Before;
import org.junit.Test;

import static com.codeborne.selenide.Selenide.$;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class ImageTest extends IntegrationTest {
  @Before
  public void openTestPageWithImages() {
    openFile("page_with_images.html");
  }

  @Test
  public void userCanCheckIfImageIsLoadedCorrectly() {
    assertTrue($("#valid-image img").isImage());
    assertFalse($("#invalid-image img").isImage());
  }

  @Test(expected = IllegalArgumentException.class)
  public void isImageIsOnlyApplicableForImages() {
    $("h1").isImage();
  }
}<commit_msg>image check does not work in htmlunit<commit_after>package integration;

import org.junit.Before;
import org.junit.Test;

import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.WebDriverRunner.isHtmlUnit;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;

public class ImageTest extends IntegrationTest {
  @Before
  public void openTestPageWithImages() {
    openFile("page_with_images.html");
  }

  @Test
  public void userCanCheckIfImageIsLoadedCorrectly() {
    assumeFalse(isHtmlUnit());
    
    assertTrue($("#valid-image img").isImage());
    assertFalse($("#invalid-image img").isImage());
  }

  @Test(expected = IllegalArgumentException.class)
  public void isImageIsOnlyApplicableForImages() {
    $("h1").isImage();
  }
}
{'fraction_non_alphanumeric': 0.1219672131147541, 'fraction_numerical': 0.0013114754098360656, 'mean_word_length': 5.254098360655738, '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': '5701999', 'n_tokens_mistral': 463, 'n_tokens_neox': 457, 'n_words': 91}