IFrameTest.php 762 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Behat\Mink\Tests\Driver\Basic;
  3. use Behat\Mink\Tests\Driver\TestCase;
  4. class IFrameTest extends TestCase
  5. {
  6. public function testIFrame()
  7. {
  8. $this->getSession()->visit($this->pathTo('/iframe.html'));
  9. $webAssert = $this->getAssertSession();
  10. $el = $webAssert->elementExists('css', '#text');
  11. $this->assertSame('Main window div text', $el->getText());
  12. $this->getSession()->switchToIFrame('subframe');
  13. $el = $webAssert->elementExists('css', '#text');
  14. $this->assertSame('iFrame div text', $el->getText());
  15. $this->getSession()->switchToIFrame();
  16. $el = $webAssert->elementExists('css', '#text');
  17. $this->assertSame('Main window div text', $el->getText());
  18. }
  19. }