<commit_before>package com.atlassian.webdriver.it.tests;

import com.atlassian.pageobjects.browser.Browser;
import com.atlassian.pageobjects.browser.IgnoreBrowser;
import com.atlassian.pageobjects.browser.RequireBrowser;
import com.atlassian.webdriver.AtlassianWebDriver;
import com.atlassian.webdriver.it.AbstractFileBasedServerTest;
import com.atlassian.webdriver.it.pageobjects.page.JavaScriptUtilsPage;
import com.atlassian.webdriver.utils.MouseEvents;
import com.atlassian.webdriver.utils.element.ElementIsVisible;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebElement;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/**
 * Test for checking ByJquery functionality in Atlassian WebDriver.
 */
@IgnoreBrowser(Browser.HTMLUNIT_NOJS)
public class TestJavaScriptUtils extends AbstractFileBasedServerTest
{

    public static final int TIMEOUT = 5;

    private JavaScriptUtilsPage javascriptUtilsPage;
    private AtlassianWebDriver driver;

    @Before
    public void init()
    {
        javascriptUtilsPage = product.visit(JavaScriptUtilsPage.class);
        driver = product.getTester().getDriver();
    }

    /**
     * This test is testing that css psuedo class :hover will display an element
     */
    @Test
    @IgnoreBrowser(value = {Browser.FIREFOX, Browser.HTMLUNIT, Browser.IE}, reason = "CSS hovering on elements does not work.")
    public void testCssHoverRespondsToMouseover()
    {
        WebElement hoveringDiv = driver.findElement(By.id("hovering-element"));
        assertTrue(hoveringDiv.isDisplayed());
        assertFalse(driver.elementIsVisible(By.id("child-element-one")));
        assertFalse(driver.elementIsVisible(By.id("child-element-two")));
        assertFalse(driver.elementIsVisible(By.id("child-element-three")));
        // now hover over div to show the children

        MouseEvents.hover(hoveringDiv, driver);

        driver.waitUntilElementIsVisible(By.id("child-element-one"));
        assertTrue(driver.elementIsVisible(By.id("child-element-one")));
        assertTrue(driver.elementIsVisible(By.id("child-element-two")));
        assertTrue(driver.elementIsVisible(By.id("child-element-three")));
    }

    @Test
    @IgnoreBrowser(value = {Browser.IE}, reason = "jQuery hovering on elements does not work.")
    public void testJQueryHoverRespondsToMouseover()
    {
        WebElement hoveringDiv = driver.findElement(By.id("hovering-jquery-element"));
        assertTrue(hoveringDiv.isDisplayed());

        driver.waitUntilElementIsNotVisible(By.id("child-jquery-element-one"));
        assertFalse(driver.elementIsVisible(By.id("child-jquery-element-one")));
        assertFalse(driver.elementIsVisible(By.id("child-jquery-element-two")));
        assertFalse(driver.elementIsVisible(By.id("child-jquery-element-three")));

        // now hover over div to show the children
        MouseEvents.hover(hoveringDiv, driver);

        driver.waitUntilElementIsVisible(By.id("child-jquery-element-one"));
        assertTrue(driver.elementIsVisible(By.id("child-jquery-element-one")));
        assertTrue(driver.elementIsVisible(By.id("child-jquery-element-two")));
        assertTrue(driver.elementIsVisible(By.id("child-jquery-element-three")));
    }
<commit_msg>SELENIUM-210 IE: hover seems to be working now<commit_after>package com.atlassian.webdriver.it.tests;

import com.atlassian.pageobjects.browser.Browser;
import com.atlassian.pageobjects.browser.IgnoreBrowser;
import com.atlassian.pageobjects.browser.RequireBrowser;
import com.atlassian.webdriver.AtlassianWebDriver;
import com.atlassian.webdriver.it.AbstractFileBasedServerTest;
import com.atlassian.webdriver.it.pageobjects.page.JavaScriptUtilsPage;
import com.atlassian.webdriver.utils.MouseEvents;
import com.atlassian.webdriver.utils.element.ElementIsVisible;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebElement;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/**
 * Test for checking ByJquery functionality in Atlassian WebDriver.
 */
@IgnoreBrowser(Browser.HTMLUNIT_NOJS)
public class TestJavaScriptUtils extends AbstractFileBasedServerTest
{

    public static final int TIMEOUT = 5;

    private JavaScriptUtilsPage javascriptUtilsPage;
    private AtlassianWebDriver driver;

    @Before
    public void init()
    {
        javascriptUtilsPage = product.visit(JavaScriptUtilsPage.class);
        driver = product.getTester().getDriver();
    }

    /**
     * This test is testing that css psuedo class :hover will display an element
     */
    @Test
    @IgnoreBrowser(value = {Browser.FIREFOX, Browser.HTMLUNIT}, reason = "CSS hovering on elements does not work.")
    public void testCssHoverRespondsToMouseover()
    {
        WebElement hoveringDiv = driver.findElement(By.id("hovering-element"));
        assertTrue(hoveringDiv.isDisplayed());
        assertFalse(driver.elementIsVisible(By.id("child-element-one")));
        assertFalse(driver.elementIsVisible(By.id("child-element-two")));
        assertFalse(driver.elementIsVisible(By.id("child-element-three")));

        // now hover over div to show the children
        MouseEvents.hover(hoveringDiv, driver);

        driver.waitUntilElementIsVisible(By.id("child-element-one"));
        assertTrue(driver.elementIsVisible(By.id("child-element-one")));
        assertTrue(driver.elementIsVisible(By.id("child-element-two")));
        assertTrue(driver.elementIsVisible(By.id("child-element-three")));
    }

    @Test
    public void testJQueryHoverRespondsToMouseover()
    {
        WebElement hoveringDiv = driver.findElement(By.id("hovering-jquery-element"));
        assertTrue(hoveringDiv.isDisplayed());

        driver.waitUntilElementIsNotVisible(By.id("child-jquery-element-one"));
        assertFalse(driver.elementIsVisible(By.id("child-jquery-element-one")));
        assertFalse(driver.elementIsVisible(By.id("child-jquery-element-two")));
        assertFalse(driver.elementIsVisible(By.id("child-jquery-element-three")));

        // now hover over div to show the children
        MouseEvents.hover(hoveringDiv, driver);

        driver.waitUntilElementIsVisible(By.id("child-jquery-element-one"));
        assertTrue(driver.elementIsVisible(By.id("child-jquery-element-one")));
        assertTrue(driver.elementIsVisible(By.id("child-jquery-element-two")));
        assertTrue(driver.elementIsVisible(By.id("child-jquery-element-three")));
    }

{'fraction_non_alphanumeric': 0.11842298109336069, 'fraction_numerical': 0.0007328154770628756, 'mean_word_length': 4.352156862745098, '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': '1379999', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1951, 'n_words': 316}