diff --git a/tests/Basic/IFrameTest.php b/tests/Basic/IFrameTest.php index 08441a4..52e7025 100644 --- a/tests/Basic/IFrameTest.php +++ b/tests/Basic/IFrameTest.php @@ -6,7 +6,10 @@ final class IFrameTest extends TestCase { - public function testIFrame(): void + /** + * @dataProvider iFrameDataProvider + */ + public function testIFrame($iframeIdentifier): void { $this->getSession()->visit($this->pathTo('/iframe.html')); $webAssert = $this->getAssertSession(); @@ -14,7 +17,7 @@ public function testIFrame(): void $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()); @@ -24,4 +27,12 @@ public function testIFrame(): void $el = $webAssert->elementExists('css', '#text'); $this->assertSame('Main window div text', $el->getText()); } + + public function iFrameDataProvider() + { + return array( + 'by name' => array('subframe'), + 'by index' => array(0), + ); + } }