You are here

class NavigationTest in Zircon Profile 8.0

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

Hierarchy

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

Expanded class hierarchy of NavigationTest

File

vendor/behat/mink/driver-testsuite/tests/Basic/NavigationTest.php, line 7

Namespace

Behat\Mink\Tests\Driver\Basic
View source
class NavigationTest extends TestCase {
  public function testRedirect() {
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/redirector.php'));
    $this
      ->assertEquals($this
      ->pathTo('/redirect_destination.html'), $this
      ->getSession()
      ->getCurrentUrl());
  }
  public function testPageControls() {
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/randomizer.php'));
    $number1 = $this
      ->getAssertSession()
      ->elementExists('css', '#number')
      ->getText();
    $this
      ->getSession()
      ->reload();
    $number2 = $this
      ->getAssertSession()
      ->elementExists('css', '#number')
      ->getText();
    $this
      ->assertNotEquals($number1, $number2);
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/links.html'));
    $this
      ->getSession()
      ->getPage()
      ->clickLink('Random number page');
    $this
      ->assertEquals($this
      ->pathTo('/randomizer.php'), $this
      ->getSession()
      ->getCurrentUrl());
    $this
      ->getSession()
      ->back();
    $this
      ->assertEquals($this
      ->pathTo('/links.html'), $this
      ->getSession()
      ->getCurrentUrl());
    $this
      ->getSession()
      ->forward();
    $this
      ->assertEquals($this
      ->pathTo('/randomizer.php'), $this
      ->getSession()
      ->getCurrentUrl());
  }
  public function testLinks() {
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/links.html'));
    $page = $this
      ->getSession()
      ->getPage();
    $link = $page
      ->findLink('Redirect me to');
    $this
      ->assertNotNull($link);
    $this
      ->assertRegExp('/redirector\\.php$/', $link
      ->getAttribute('href'));
    $link
      ->click();
    $this
      ->assertEquals($this
      ->pathTo('/redirect_destination.html'), $this
      ->getSession()
      ->getCurrentUrl());
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/links.html'));
    $page = $this
      ->getSession()
      ->getPage();
    $link = $page
      ->findLink('basic form image');
    $this
      ->assertNotNull($link);
    $this
      ->assertRegExp('/basic_form\\.html$/', $link
      ->getAttribute('href'));
    $link
      ->click();
    $this
      ->assertEquals($this
      ->pathTo('/basic_form.html'), $this
      ->getSession()
      ->getCurrentUrl());
    $this
      ->getSession()
      ->visit($this
      ->pathTo('/links.html'));
    $page = $this
      ->getSession()
      ->getPage();
    $link = $page
      ->findLink('Link with a ');
    $this
      ->assertNotNull($link);
    $this
      ->assertRegExp('/links\\.html\\?quoted$/', $link
      ->getAttribute('href'));
    $link
      ->click();
    $this
      ->assertEquals($this
      ->pathTo('/links.html?quoted'), $this
      ->getSession()
      ->getCurrentUrl());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NavigationTest::testLinks public function
NavigationTest::testPageControls public function
NavigationTest::testRedirect 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