<commit_before><?php
namespace Xi\Test\Selenium;
use Xi\Test\Selenium\PHPUnit\WebDriverTest;

abstract class LibraryTestCase extends \PHPUnit_Framework_TestCase implements WebDriverTest
{
    /**
     * @var WebDriver
     */
    public $browser; // public for use in PHP 5.3 closures

    /**
     * @var string
     */
    protected $testFileBaseUrl;

    public function setUpWebDriver(WebDriver $browser)
    {
        $this->browser = $browser;
    }

    public function setUp()
    {
        $this->testFileBaseUrl = 'file://' . PROJECT_ROOT . '/tests/testpages';

        $this->browser->visit($this->getTestFileUrl('index.html'));
    }

    public function getTestFileUrl($name)
    {
        return $this->testFileBaseUrl . '/' . $name;
    }

    public function tearDown()
    {
        $this->browser->clearCookies();

        // With the current (2.5.0) version of Selenium,
        // dismissAlert fails very slowly so we won't do the following :(
        // Hopefully this is fixed in later version of Selenium.
        /*
        try {
            $this->browser->dismissAlert();<commit_msg>Checked that the slow dismissAlert() problem still exists.<commit_after><?php
namespace Xi\Test\Selenium;
use Xi\Test\Selenium\PHPUnit\WebDriverTest;

abstract class LibraryTestCase extends \PHPUnit_Framework_TestCase implements WebDriverTest
{
    /**
     * @var WebDriver
     */
    public $browser; // public for use in PHP 5.3 closures

    /**
     * @var string
     */
    protected $testFileBaseUrl;

    public function setUpWebDriver(WebDriver $browser)
    {
        $this->browser = $browser;
    }

    public function setUp()
    {
        $this->testFileBaseUrl = 'file://' . PROJECT_ROOT . '/tests/testpages';

        $this->browser->visit($this->getTestFileUrl('index.html'));
    }

    public function getTestFileUrl($name)
    {
        return $this->testFileBaseUrl . '/' . $name;
    }

    public function tearDown()
    {
        $this->browser->clearCookies();

        // With the current (2.32.0) version of Selenium,
        // dismissAlert fails very slowly so we won't do the following :(
        // Hopefully this is fixed in later version of Selenium.
        /*
        try {
            $this->browser->dismissAlert();
{'fraction_non_alphanumeric': 0.12058303886925795, 'fraction_numerical': 0.004858657243816254, 'mean_word_length': 2.3856502242152464, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '5205884', 'n_tokens_mistral': 677, 'n_tokens_neox': 641, 'n_words': 164}