You are here

class JavascriptTest in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/driver-testsuite/tests/Js/JavascriptTest.php \Behat\Mink\Tests\Driver\Js\JavascriptTest

Hierarchy

  • class \Behat\Mink\Tests\Driver\TestCase extends \Behat\Mink\Tests\Driver\PHPUnit_Framework_TestCase

Expanded class hierarchy of JavascriptTest

File

vendor/behat/mink/driver-testsuite/tests/Js/JavascriptTest.php, line 7

Namespace

Behat\Mink\Tests\Driver\Js
View source
class JavascriptTest extends TestCase {
  public function testAriaRoles() {
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/aria_roles.html'));
    $this
      ->getSession()
      ->wait(5000, '$("#hidden-element").is(":visible") === false');
    $this
      ->getSession()
      ->getPage()
      ->pressButton('Toggle');
    $this
      ->getSession()
      ->wait(5000, '$("#hidden-element").is(":visible") === true');
    $this
      ->getSession()
      ->getPage()
      ->clickLink('Go to Index');
    $this
      ->assertEquals($this
      ->pathTo('/index.html'), $this
      ->getSession()
      ->getCurrentUrl());
  }
  public function testDragDrop() {
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/js_test.html'));
    $webAssert = $this
      ->getAssertSession();
    $draggable = $webAssert
      ->elementExists('css', '#draggable');
    $droppable = $webAssert
      ->elementExists('css', '#droppable');
    $draggable
      ->dragTo($droppable);
    $this
      ->assertEquals('Dropped!', $this
      ->getAssertSession()
      ->elementExists('css', 'p', $droppable)
      ->getText());
  }

  // test accentuated char in button
  public function testIssue225() {
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/issue225.html'));
    $this
      ->getSession()
      ->getPage()
      ->pressButton('Créer un compte');
    $this
      ->getSession()
      ->wait(5000, '$("#panel").text() != ""');
    $this
      ->assertContains('OH AIH!', $this
      ->getSession()
      ->getPage()
      ->getText());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
JavascriptTest::testAriaRoles public function
JavascriptTest::testDragDrop public function
JavascriptTest::testIssue225 public function
TestCase::$config private static property
TestCase::$mink private static property Mink session manager.
TestCase::checkRequirements protected function
TestCase::createDriver protected function Creates a new driver instance.
TestCase::findById protected function
TestCase::getAssertSession protected function Returns assert session.
TestCase::getConfig private static function
TestCase::getSession protected function Returns session.
TestCase::mapRemoteFilePath protected function Map remote file path.
TestCase::onNotSuccessfulTest protected function
TestCase::pathTo protected function
TestCase::safePageWait protected function Waits for a condition to be true, considering than it is successful for drivers not supporting wait().
TestCase::setUpBeforeClass public static function Initializes the test case.
TestCase::tearDown protected function