<commit_before><?php

namespace Facebook\WebDriver;

/**
 * @covers \Facebook\WebDriver\WebDriverWindow
 */
class WebDriverWindowTest extends WebDriverTestCase
{
    public function testShouldGetPosition()
    {
        $position = $this->driver->manage()
            ->window()
            ->getPosition();

        $this->assertGreaterThanOrEqual(0, $position->getX());
        $this->assertGreaterThanOrEqual(0, $position->getY());
    }

    public function testShouldGetSize()
    {
        $size = $this->driver->manage()
            ->window()
            ->getSize();

        $this->assertGreaterThan(0, $size->getWidth());
        $this->assertGreaterThan(0, $size->getHeight());
    }

    public function testShouldMaximizeWindow()
    {
        $sizeBefore = $this->driver->manage()
            ->window()
            ->getSize();

        $this->driver->manage()
            ->window()
            ->maximize();

        $sizeAfter = $this->driver->manage()
            ->window()
            ->getSize();

        $this->assertGreaterThanOrEqual($sizeBefore->getWidth(), $sizeAfter->getWidth());
        $this->assertGreaterThanOrEqual($sizeBefore->getHeight(), $sizeAfter->getHeight());
    }

    public function testShouldSetSize()
    {
        $sizeBefore = $this->driver->manage()
            ->window()
            ->getSize();
        $this->assertNotSame(500, $sizeBefore->getWidth());
        $this->assertNotSame(666, $sizeBefore->getHeight());

        $this->driver->manage()
            ->window()
            ->setSize(new WebDriverDimension(500, 666));

        $sizeAfter = $this->driver->manage()
            ->window()
            ->getSize();

        $this->assertSame(500, $sizeAfter->getWidth());
        $this->assertSame(666, $sizeAfter->getHeight());
    }

    public function testShouldSetWindowPosition()
    {
        $this->driver->manage()
            ->window()
            ->setPosition(new WebDriverPoint(33, 66));

        $positionAfter = $this->driver->manage()
            ->window()
            ->getPosition();

        $this->assertSame(33, $positionAfter->getX());
        $this->assertSame(66, $positionAfter->getY());
    }
}
<commit_msg>Exclude window tests on Saucelabs, because they are not sane<commit_after><?php

namespace Facebook\WebDriver;

/**
 * @covers \Facebook\WebDriver\WebDriverWindow
 */
class WebDriverWindowTest extends WebDriverTestCase
{
    /**
     * @group exclude-saucelabs
     */
    public function testShouldGetPosition()
    {
        $position = $this->driver->manage()
            ->window()
            ->getPosition();

        $this->assertGreaterThanOrEqual(0, $position->getX());
        $this->assertGreaterThanOrEqual(0, $position->getY());
    }

    public function testShouldGetSize()
    {
        $size = $this->driver->manage()
            ->window()
            ->getSize();

        $this->assertGreaterThan(0, $size->getWidth());
        $this->assertGreaterThan(0, $size->getHeight());
    }

    public function testShouldMaximizeWindow()
    {
        $sizeBefore = $this->driver->manage()
            ->window()
            ->getSize();

        $this->driver->manage()
            ->window()
            ->maximize();

        $sizeAfter = $this->driver->manage()
            ->window()
            ->getSize();

        $this->assertGreaterThanOrEqual($sizeBefore->getWidth(), $sizeAfter->getWidth());
        $this->assertGreaterThanOrEqual($sizeBefore->getHeight(), $sizeAfter->getHeight());
    }

    /**
     * @group exclude-saucelabs
     */
    public function testShouldSetSize()
    {
        $sizeBefore = $this->driver->manage()
            ->window()
            ->getSize();
        $this->assertNotSame(500, $sizeBefore->getWidth());
        $this->assertNotSame(666, $sizeBefore->getHeight());

        $this->driver->manage()
            ->window()
            ->setSize(new WebDriverDimension(500, 666));

        $sizeAfter = $this->driver->manage()
            ->window()
            ->getSize();

        $this->assertSame(500, $sizeAfter->getWidth());
        $this->assertSame(666, $sizeAfter->getHeight());
    }

    public function testShouldSetWindowPosition()
    {
        $this->driver->manage()
            ->window()
            ->setPosition(new WebDriverPoint(33, 66));

        $positionAfter = $this->driver->manage()
            ->window()
            ->getPosition();

        $this->assertSame(33, $positionAfter->getX());
        $this->assertSame(66, $positionAfter->getY());
    }
}

{'fraction_non_alphanumeric': 0.168098700154219, 'fraction_numerical': 0.013218770654329148, 'mean_word_length': 2.2244318181818183, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5204254', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1258, 'n_words': 191}