You are here

class GoutteDriver in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink-goutte-driver/src/GoutteDriver.php \Behat\Mink\Driver\GoutteDriver

Goutte driver.

@author Konstantin Kudryashov <ever.zet@gmail.com>

Hierarchy

Expanded class hierarchy of GoutteDriver

3 files declare their use of GoutteDriver
BrowserTestBase.php in core/modules/simpletest/src/BrowserTestBase.php
Contains \Drupal\simpletest\BrowserTestBase.
GoutteConfig.php in vendor/behat/mink-goutte-driver/tests/GoutteConfig.php
InstantiationTest.php in vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php

File

vendor/behat/mink-goutte-driver/src/GoutteDriver.php, line 21

Namespace

Behat\Mink\Driver
View source
class GoutteDriver extends BrowserKitDriver {

  /**
   * Initializes Goutte driver.
   *
   * @param Client $client Goutte client instance
   */
  public function __construct(Client $client = null) {
    parent::__construct($client ?: new ExtendedClient());
  }

  /**
   * {@inheritdoc}
   */
  public function setBasicAuth($user, $password) {
    if (false === $user) {
      $this
        ->getClient()
        ->resetAuth();
      return;
    }
    $this
      ->getClient()
      ->setAuth($user, $password);
  }

  /**
   * Gets the Goutte client.
   *
   * The method is overwritten only to provide the appropriate return type hint.
   *
   * @return Client
   */
  public function getClient() {
    return parent::getClient();
  }

  /**
   * {@inheritdoc}
   */
  public function reset() {
    parent::reset();
    $this
      ->getClient()
      ->resetAuth();
  }

  /**
   * {@inheritdoc}
   */
  protected function prepareUrl($url) {
    return $url;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BrowserKitDriver::$client private property
BrowserKitDriver::$forms private property
BrowserKitDriver::$removeHostFromUrl private property
BrowserKitDriver::$removeScriptFromUrl private property
BrowserKitDriver::$serverParameters private property
BrowserKitDriver::$started private property
BrowserKitDriver::attachFile public function Attaches file path to file field located by it's XPath query. Overrides CoreDriver::attachFile
BrowserKitDriver::back public function Moves browser backward 1 page. Overrides CoreDriver::back
BrowserKitDriver::canResetForm private function Determines if a node can reset a form.
BrowserKitDriver::canSubmitForm private function Determines if a node can submit a form.
BrowserKitDriver::check public function Checks checkbox by it's XPath query. Overrides CoreDriver::check
BrowserKitDriver::click public function Clicks button or link located by it's XPath query. Overrides CoreDriver::click
BrowserKitDriver::deleteCookie private function Deletes a cookie by name.
BrowserKitDriver::findElementXpaths public function Finds elements with specified XPath query. Overrides CoreDriver::findElementXpaths
BrowserKitDriver::forward public function Moves browser forward 1 page. Overrides CoreDriver::forward
BrowserKitDriver::getAttribute public function Returns element's attribute by it's XPath query. Overrides CoreDriver::getAttribute
BrowserKitDriver::getCheckboxField private function Returns the checkbox field from xpath query, ensuring it is valid.
BrowserKitDriver::getContent public function Returns last response content. Overrides CoreDriver::getContent
BrowserKitDriver::getCookie public function Returns cookie by name. Overrides CoreDriver::getCookie
BrowserKitDriver::getCookiePath private function Returns current cookie path.
BrowserKitDriver::getCrawler private function Returns crawler instance (got from client).
BrowserKitDriver::getCrawlerNode private function Returns DOMElement from crawler instance.
BrowserKitDriver::getCurrentUrl public function Returns current URL address. Overrides CoreDriver::getCurrentUrl
BrowserKitDriver::getFieldPosition private function Gets the position of the field node among elements with the same name
BrowserKitDriver::getFilteredCrawler private function Returns a crawler filtered for the given XPath, requiring at least 1 result.
BrowserKitDriver::getFormField protected function Returns form field from XPath query.
BrowserKitDriver::getFormNode private function
BrowserKitDriver::getFormNodeId private function Returns form node unique identifier.
BrowserKitDriver::getHtml public function Returns element's inner html by it's XPath query. Overrides CoreDriver::getHtml
BrowserKitDriver::getOptionValue private function Gets the value of an option element
BrowserKitDriver::getOuterHtml public function Returns element's outer html by it's XPath query. Overrides CoreDriver::getOuterHtml
BrowserKitDriver::getResponse protected function
BrowserKitDriver::getResponseHeaders public function Returns last response headers. Overrides CoreDriver::getResponseHeaders
BrowserKitDriver::getStatusCode public function Returns last response status code. Overrides CoreDriver::getStatusCode
BrowserKitDriver::getTagName public function Returns element's tag name by it's XPath query. Overrides CoreDriver::getTagName
BrowserKitDriver::getText public function Returns element's text by it's XPath query. Overrides CoreDriver::getText
BrowserKitDriver::getValue public function Returns element's value by it's XPath query. Overrides CoreDriver::getValue
BrowserKitDriver::isChecked public function Checks whether checkbox or radio button located by it's XPath query is checked. Overrides CoreDriver::isChecked
BrowserKitDriver::isSelected public function Checks whether select option, located by it's XPath query, is selected. Overrides CoreDriver::isSelected
BrowserKitDriver::isStarted public function Checks whether driver is started. Overrides CoreDriver::isStarted
BrowserKitDriver::mergeForms private function Merges second form values into first one.
BrowserKitDriver::reload public function Reloads current page. Overrides CoreDriver::reload
BrowserKitDriver::resetForm private function
BrowserKitDriver::selectOption public function Selects option from select field or value in radio group located by it's XPath query. Overrides CoreDriver::selectOption
BrowserKitDriver::setCookie public function Sets cookie. Overrides CoreDriver::setCookie
BrowserKitDriver::setRemoveHostFromUrl Deprecated public function Tells driver to remove hostname from URL.
BrowserKitDriver::setRemoveScriptFromUrl Deprecated public function Tells driver to remove script name from URL.
BrowserKitDriver::setRequestHeader public function Sets specific request header on client. Overrides CoreDriver::setRequestHeader
BrowserKitDriver::setValue public function Sets element's value by it's XPath query. Overrides CoreDriver::setValue
BrowserKitDriver::start public function Starts driver. Overrides CoreDriver::start
BrowserKitDriver::stop public function Stops driver. Overrides CoreDriver::stop
BrowserKitDriver::submit private function
BrowserKitDriver::submitForm public function Submits the form. Overrides CoreDriver::submitForm
BrowserKitDriver::uncheck public function Unchecks checkbox by it's XPath query. Overrides CoreDriver::uncheck
BrowserKitDriver::visit public function Visit specified URL. Overrides CoreDriver::visit
CoreDriver::$session private property 1
CoreDriver::blur public function Removes focus from element. Overrides DriverInterface::blur 1
CoreDriver::doubleClick public function Double-clicks button or link located by it's XPath query. Overrides DriverInterface::doubleClick
CoreDriver::dragTo public function Drag one element onto another. Overrides DriverInterface::dragTo 1
CoreDriver::evaluateScript public function Evaluates JS script. Overrides DriverInterface::evaluateScript
CoreDriver::executeScript public function Executes JS script. Overrides DriverInterface::executeScript
CoreDriver::find public function Finds elements with specified XPath query. Overrides DriverInterface::find 1
CoreDriver::focus public function Brings focus to element. Overrides DriverInterface::focus 1
CoreDriver::getScreenshot public function Capture a screenshot of the current window. Overrides DriverInterface::getScreenshot
CoreDriver::getWindowName public function Return the name of the currently active window. Overrides DriverInterface::getWindowName
CoreDriver::getWindowNames public function Return the names of all open windows. Overrides DriverInterface::getWindowNames
CoreDriver::isVisible public function Checks whether element visible located by it's XPath query. Overrides DriverInterface::isVisible 1
CoreDriver::keyDown public function Pressed down specific keyboard key. Overrides DriverInterface::keyDown
CoreDriver::keyPress public function Presses specific keyboard key. Overrides DriverInterface::keyPress
CoreDriver::keyUp public function Pressed up specific keyboard key. Overrides DriverInterface::keyUp
CoreDriver::maximizeWindow public function Maximizes the window if it is not maximized already. Overrides DriverInterface::maximizeWindow
CoreDriver::mouseOver public function Simulates a mouse over on the element. Overrides DriverInterface::mouseOver
CoreDriver::resizeWindow public function Set the dimensions of the window. Overrides DriverInterface::resizeWindow
CoreDriver::rightClick public function Right-clicks button or link located by it's XPath query. Overrides DriverInterface::rightClick
CoreDriver::setSession public function Sets driver's current session. Overrides DriverInterface::setSession 1
CoreDriver::switchToIFrame public function Switches to specific iFrame. Overrides DriverInterface::switchToIFrame 1
CoreDriver::switchToWindow public function Switches to specific browser window. Overrides DriverInterface::switchToWindow
CoreDriver::wait public function Waits some time or until JS condition turns true. Overrides DriverInterface::wait
GoutteDriver::getClient public function Gets the Goutte client. Overrides BrowserKitDriver::getClient
GoutteDriver::prepareUrl protected function Prepares URL for visiting. Removes "*.php/" from urls and then passes it to BrowserKitDriver::visit(). Overrides BrowserKitDriver::prepareUrl
GoutteDriver::reset public function Resets driver state. Overrides BrowserKitDriver::reset
GoutteDriver::setBasicAuth public function Sets HTTP Basic authentication parameters. Overrides BrowserKitDriver::setBasicAuth
GoutteDriver::__construct public function Initializes Goutte driver. Overrides BrowserKitDriver::__construct