Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpott committed Jul 23, 2024
1 parent 97e54c6 commit 5695798
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/Custom/LargePageClickTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Behat\Mink\Tests\Driver\Custom;

use Behat\Mink\Tests\Driver\TestCase;

class LargePageClickTest extends TestCase
{
public function testLargePageClick(): void
{
$this->getSession()->visit($this->pathTo('/multi_input_form.html'));

// Add a large amount of br tags so that the button is not in view.
$large_page = str_repeat('<br />', 2000);
$script = <<<JS
const p = document.createElement("div");
p.innerHTML = "$large_page";
document.body.insertBefore(p, document.body.firstChild);
JS;
$this->getSession()->executeScript($script);

$page = $this->getSession()->getPage();
$page->pressButton('Register');
$this->assertStringContainsString('no file', $page->getContent());
}
}

0 comments on commit 5695798

Please sign in to comment.