Skip to content

Commit

Permalink
Added tests to verify, that iframe switching by an index works
Browse files Browse the repository at this point in the history
  • Loading branch information
aik099 committed Feb 18, 2024
1 parent e02c787 commit a865a51
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/Basic/IFrameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@

final class IFrameTest extends TestCase
{
public function testIFrame(): void
/**
* @dataProvider iFrameDataProvider
*/
public function testIFrame($iframeIdentifier): void

Check failure on line 12 in tests/Basic/IFrameTest.php

View workflow job for this annotation

GitHub Actions / Static analysis

Method Behat\Mink\Tests\Driver\Basic\IFrameTest::testIFrame() has parameter $iframeIdentifier with no type specified.
{
$this->getSession()->visit($this->pathTo('/iframe.html'));
$webAssert = $this->getAssertSession();

$el = $webAssert->elementExists('css', '#text');
$this->assertSame('Main window div text', $el->getText());

$this->getSession()->switchToIFrame('subframe');
$this->getSession()->switchToIFrame($iframeIdentifier);

$el = $webAssert->elementExists('css', '#text');
$this->assertSame('iFrame div text', $el->getText());
Expand All @@ -24,4 +27,12 @@ public function testIFrame(): void
$el = $webAssert->elementExists('css', '#text');
$this->assertSame('Main window div text', $el->getText());
}

public function iFrameDataProvider()

Check failure on line 31 in tests/Basic/IFrameTest.php

View workflow job for this annotation

GitHub Actions / Static analysis

Method Behat\Mink\Tests\Driver\Basic\IFrameTest::iFrameDataProvider() has no return type specified.
{
return array(
'by name' => array('subframe'),
'by index' => array(0),
);
}
}

0 comments on commit a865a51

Please sign in to comment.