forked from minkphp/MinkSelenium2Driver
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from alexpott/FIX-firefox-click-and-move-pointer
Scroll into view before moving pointer to make Firefox behave the same as Chrome
- Loading branch information
Showing
4 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |