Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'release/0.2.0'

  • Loading branch information...
commit 1d5c8655aa995b0863aef57538fa102f94d40a70 2 parents d92d6c6 + 14f4fed
@everzet everzet authored
View
9 CHANGES.md
@@ -1,3 +1,12 @@
+0.2.0 / 2011-04-21
+==================
+
+ * Additional step definitions
+ * Support for extended drivers configuration through behat.yml environment parameters
+ * Lots of new named selectors
+ * Bug fixes
+ * Small improvements
+
0.1.2 / 2011-04-08
==================
View
60 README.md
@@ -6,35 +6,37 @@ Behat\Mink
Usage
-----
- <?php
-
- use Behat\Mink\Mink,
- Behat\Mink\Driver\GoutteDriver,
- Behat\Mink\Driver\SahiDriver;
-
- $startUrl = 'http://example.com';
-
- // init Mink and register drivers
- $mink = new Mink();
- $mink->registerDriver('goutte', new GoutteDriver($startUrl), true); // last argument === isDefault
- $mink->registerDriver('javascript', new SahiDriver($startUrl, 'firefox'));
- $mink->registerDriver('symfony2', new GoutteDriver($startUrl, $container->get('client')));
- $mink->registerDriver('custom', new MyCustomDriver($startUrl));
-
- // run in default driver ("goutte" is default driver - last argument to registerDriver())
- $mink->switchToDefaultDriver();
- $mink->getSession()->getPage()->findLink('Downloads')->click();
- echo $mink->getSession()->getPage()->getContent();
-
- // run in javascript (Sahi) driver
- $mink->switchToDriver('javascript');
- $mink->getSession()->getPage()->findLink('Downloads')->click();
- echo $mink->getSession()->getPage()->getContent();
-
- // run in custom driver
- $mink->switchToDriver('custom');
- $mink->getSession()->getPage()->findLink('Downloads')->click();
- echo $mink->getSession()->getPage()->getContent();
+``` php
+<?php
+
+use Behat\Mink\Mink,
+ Behat\Mink\Driver\GoutteDriver,
+ Behat\Mink\Driver\SahiDriver;
+
+$startUrl = 'http://example.com';
+
+// init Mink and register drivers
+$mink = new Mink();
+$mink->registerDriver('goutte', new GoutteDriver($startUrl), true); // last argument === isDefault
+$mink->registerDriver('javascript', new SahiDriver($startUrl, 'firefox'));
+$mink->registerDriver('symfony2', new GoutteDriver($startUrl, $container->get('client')));
+$mink->registerDriver('custom', new MyCustomDriver($startUrl));
+
+// run in default driver ("goutte" is default driver - last argument to registerDriver())
+$mink->switchToDefaultDriver();
+$mink->getSession()->getPage()->findLink('Downloads')->click();
+echo $mink->getSession()->getPage()->getContent();
+
+// run in javascript (Sahi) driver
+$mink->switchToDriver('javascript');
+$mink->getSession()->getPage()->findLink('Downloads')->click();
+echo $mink->getSession()->getPage()->getContent();
+
+// run in custom driver
+$mink->switchToDriver('custom');
+$mink->getSession()->getPage()->findLink('Downloads')->click();
+echo $mink->getSession()->getPage()->getContent();
+```
Copyright
---------
View
4 package.xml.tpl
@@ -5,9 +5,9 @@
http://pear.php.net/dtd/package-2.0.xsd">
<name>mink</name>
<channel>pear.behat.org</channel>
- <summary>Mink is an browser emulation framework for php5.3</summary>
+ <summary>Behat\Mink is an browser emulation framework for PHP</summary>
<description>
- Mink is an open source browser emulation framework for php 5.3.
+ Behat\Mink is an open source browser emulation framework for php 5.3.
</description>
<lead>
<name>Konstantin Kudryashov</name>
View
125 phpdoc.ini.dist
@@ -0,0 +1,125 @@
+; Default configuration file for PHPDoctor
+
+; This config file will cause PHPDoctor to generate API documentation of
+; itself.
+
+
+; PHPDoctor settings
+; -----------------------------------------------------------------------------
+
+; Names of files to parse. This can be a single filename, or a comma separated
+; list of filenames. Wildcards are allowed.
+
+files = "*.php"
+
+; Names of files or directories to ignore. This can be a single filename, or a
+; comma separated list of filenames. Wildcards are NOT allowed.
+
+ignore = "CVS, .svn, .git, _compiled"
+
+; The directory to look for files in, if not used the PHPDoctor will look in
+; the current directory (the directory it is run from).
+
+source_path = "./src"
+
+; If you do not want PHPDoctor to look in each sub directory for files
+; uncomment this line.
+
+;subdirs = off
+
+; Set how loud PHPDoctor is as it runs. Quiet mode suppresses all output other
+; than warnings and errors. Verbose mode outputs additional messages during
+; execution.
+
+;quiet = on
+;verbose = on
+
+; Select the doclet to use for generating output.
+
+doclet = standard
+;doclet = debug
+
+; The directory to find the doclet in. Doclets are expected to be in a
+; directory named after themselves at the location given.
+
+;doclet_path = ./doclets
+
+; The directory to find taglets in. Taglets allow you to make PHPDoctor handle
+; new tags and to alter the behavour of existing tags and their output.
+
+;taglet_path = ./taglets
+
+; If the code you are parsing does not use package tags or not all elements
+; have package tags, use this setting to place unbound elements into a
+; particular package.
+
+default_package = "Behat\Mink"
+
+; Specifies the name of a HTML file containing text for the overview
+; documentation to be placed on the overview page. The path is relative to
+; "source_path" unless an absolute path is given.
+
+overview = readme.html
+
+; Package comments will be looked for in a file named package.html in the same
+; directory as the first source file parsed in that package or in the directory
+; given below. If package comments are placed in the directory given below then
+; they should be named "<packageName>.html".
+
+package_comment_dir = ./
+
+; Parse out global variables and/or global constants?
+
+;globals = off
+;constants = off
+
+; Generate documentation for all class members
+
+;private = on
+
+; Generate documentation for public and protected class members
+
+;protected = on
+
+; Generate documentation for only public class members
+
+public = on
+
+; Use the PEAR compatible handling of the docblock first sentence
+
+;pear_compat = on
+
+; Standard doclet settings
+; -----------------------------------------------------------------------------
+
+; The directory to place generated documentation in. If the given path is
+; relative to it will be relative to "source_path".
+
+d = "api"
+
+; Specifies the title to be placed in the HTML <title> tag.
+
+windowtitle = "Behat\Mink"
+
+; Specifies the title to be placed near the top of the overview summary file.
+
+doctitle = "Behat\Mink: browser emulators abstraction library for PHP"
+
+; Specifies the header text to be placed at the top of each output file. The
+; header will be placed to the right of the upper navigation bar.
+
+header = "Behat\Mink"
+
+; Specifies the footer text to be placed at the bottom of each output file. The
+; footer will be placed to the right of the lower navigation bar.
+
+footer = "Behat\Mink"
+
+; Specifies the text to be placed at the bottom of each output file. The text
+; will be placed at the bottom of the page, below the lower navigation bar.
+
+;bottom = "This document was generated by <a href="http://phpdoctor.sourceforge.net/">PHPDoctor: The PHP Documentation Creator</a>"
+
+; Create a class tree?
+
+tree = on
View
81 src/Behat/Mink/Integration/MinkEnvironment.php
@@ -8,6 +8,11 @@
Behat\Mink\Driver\GoutteDriver,
Behat\Mink\Driver\SahiDriver;
+use Goutte\Client as GoutteClient;
+
+use Behat\SahiClient\Connection as SahiConnection,
+ Behat\SahiClient\Client as SahiClient;
+
/*
* This file is part of the Behat\Mink.
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
@@ -30,21 +35,9 @@ public function __construct()
{
$world = $this;
- $world->initGoutteDriver = function() use($world) {
- return new GoutteDriver(
- $world->getParameter('start_url') ?: 'http://behat.org/'
- );
- };
-
- $world->initSahiDriver = function() use($world) {
- return new SahiDriver(
- $world->getParameter('start_url') ?: 'http://behat.org/',
- $world->getParameter('browser') ?: 'firefox'
- );
- };
-
+ $world->drivers = array();
$world->getPathTo = function($path) use($world) {
- return ($world->getParameter('start_url') ?: 'http://behat.org/') . $path;
+ return 0 !== strpos('http', $path) ? $world->getParameter('start_url') . $path : $path;
};
}
@@ -76,45 +69,37 @@ public function getSession()
}
/**
- * Returns default Mink driver name.
- *
- * @return string
- */
- public function getDefaultDriverName()
- {
- return $this->getParameter('default_driver') ?: 'goutte';
- }
-
- /**
- * Returns default javascript driver name.
- *
- * @return string
- */
- public function getJavascriptDriverName()
- {
- return $this->getParameter('javascript_driver') ?: 'sahi';
- }
-
- /**
* Registers drivers on mink.
*
* @param Behat\Mink\Mink $mink
*/
- protected function registerMinkDrivers(Mink $mink)
+ private function registerMinkDrivers(Mink $mink)
{
- foreach ($this->getDrivers() as $driver) {
- $builder = 'init' . ucfirst($driver) . 'Driver';
- $mink->registerDriver($driver, $this->$builder(), $driver === $this->getDefaultDriverName());
+ if (null === $this->getParameter('start_url')) {
+ throw new \InvalidArgumentException('Specify start_url environment parameter');
+ }
+ $startUrl = $this->getParameter('start_url');
+ $defaultDriver = $this->getParameter('default_driver') ?: 'goutte';
+ $browser = $this->getParameter('browser') ?: 'firefox';
+
+ $config = $this->getParameter('goutte', array());
+ $goutte = new GoutteClient(
+ isset($config['zend_config']) ? $config['zend_config'] : array(),
+ isset($config['server_parameters']) ? $config['server_parameters'] : array()
+ );
+ $mink->registerDriver('goutte', new GoutteDriver($startUrl, $goutte), 'goutte' === $defaultDriver);
+
+ $config = $this->getParameter('sahi', array());
+ $client = new SahiClient(new SahiConnection(
+ isset($config['sid']) ? $config['sid'] : uniqid(),
+ isset($config['host']) ? $config['host'] : 'localhost',
+ isset($config['port']) ? $config['port'] : 9999
+ ));
+ $mink->registerDriver('sahi', new SahiDriver($startUrl, $browser, $client), 'sahi' === $defaultDriver);
+
+
+ foreach ($this->drivers as $alias => $driver) {
+ $mink->registerDriver($alias, $driver, $driver === $this->getDefaultDriverName());
}
- }
-
- /**
- * Returns drivers list (available_drivers parameter).
- *
- * @return array
- */
- private function getDrivers()
- {
- return (array) ($this->getParameter('available_drivers') ?: array('goutte', 'sahi'));
}
}
View
20 src/Behat/Mink/Integration/steps/i18n/ru.xliff
@@ -74,6 +74,26 @@
<source><![CDATA[/^(?:|I )should be on (?P<page>.+)$/]]></source>
<target><![CDATA[/^(?:|я )должен быть на странице (?P<page>.+)$/]]></target>
</trans-unit>
+ <trans-unit id="the-element-should-contain">
+ <source><![CDATA[/^the "(?P<element>[^"]*)" element should contain "(?P<value>[^"]*)"$/]]></source>
+ <target><![CDATA[/^элемент "(?P<element>[^"]*)" должен содержать "(?P<value>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-should-see-element">
+ <source><![CDATA[/^(?:|I )should see "(?P<element>[^"]*)" element$/]]></source>
+ <target><![CDATA[/^(?:|Я )должен видеть элемент "(?P<element>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="the-element-should-link-to">
+ <source><![CDATA[/^the "(?P<element>[^"]*)" element should link to (?P<href>.*)$/]]></source>
+ <target><![CDATA[/^элемент "(?P<element>[^"]*)" должен вести на страницу (?P<href>.*)$/]]></target>
+ </trans-unit>
+ <trans-unit id="the-element-should-have-attribute-of">
+ <source><![CDATA[/^the "(?P<element>[^"]*)" element should have a "(?P<attribute>[a-zA-Z\-\_]*)" attribute of "(?P<value>[^"]*)"$/]]></source>
+ <target><![CDATA[/^элемент "(?P<element>[^"]*)" должен иметь аттрибут "(?P<attribute>[a-zA-Z\-\_]*)", содержащий "(?P<value>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="">
+ <source><![CDATA[/the response status code should be (?P<code>\d+)/]]></source>
+ <target><![CDATA[/код ответа сервера должен быть (?P<code>\d+)/]]></target>
+ </trans-unit>
</body>
</file>
</xliff>
View
48 src/Behat/Mink/Integration/steps/mink_steps.php
@@ -111,3 +111,51 @@
parse_url($world->getSession()->getCurrentUrl(), PHP_URL_PATH)
);
});
+
+$steps->Then('/^the "(?P<element>[^"]*)" element should contain "(?P<value>[^"]*)"$/', function($world, $element, $value) {
+ $node = $world->getSession()->getPage()->find('xpath', $element);
+
+ if (null === $node) {
+ throw new ElementNotFoundException('element', $element);
+ }
+
+ assertContains($value, preg_replace('/\s+/', ' ', str_replace("\n", '', $node->getText())));
+});
+
+$steps->Then('/^(?:|I )should see "(?P<element>[^"]*)" element$/', function($world, $element) {
+ $node = $world->getSession()->getPage()->find('xpath', $element);
+
+ if (null === $node) {
+ throw new ElementNotFoundException('element', $element);
+ }
+});
+
+$steps->Then('/^the "(?P<element>[^"]*)" element should link to (?P<href>.*)$/', function($world, $element, $href) {
+ $node = $world->getSession()->getPage()->find('xpath', $element);
+
+ if (null === $node) {
+ throw new ElementNotFoundException('element', $element);
+ }
+
+ $href_parts = parse_url($href);
+ $href = array_merge(
+ parse_url($world->getParameter('start_url')),
+ $href_parts
+ );
+
+ assertSame($href['scheme'].'://'.$href['host'].$href['path'], $node->getAttribute('href'));
+});
+
+$steps->Then('/^the "(?P<element>[^"]*)" element should have a "(?P<attribute>[a-zA-Z\-\_]*)" attribute of "(?P<value>[^"]*)"$/', function($world, $element, $attribute, $value) {
+ $node = $world->getSession()->getPage()->find('xpath', $element);
+
+ if (null === $node) {
+ throw new ElementNotFoundException('element', $element);
+ }
+
+ assertSame($value, $node->getAttribute($attribute));
+});
+
+$steps->Then('/the response status code should be (?P<code>\d+)/', function($world, $code) {
+ assertSame($world->getSession()->getStatusCode(), (int) $code);
+});
View
10 src/Behat/Mink/Integration/support/hooks.php
@@ -14,15 +14,19 @@
$scenario = $event instanceof ScenarioEvent ? $event->getScenario() : $event->getOutline();
$environment = $event->getEnvironment();
- $driver = $environment->getDefaultDriverName();
+ $driver = null;
foreach ($scenario->getTags() as $tag) {
if ('javascript' === $tag) {
- $driver = $environment->getJavascriptDriverName();
+ $driver = 'sahi';
} elseif (preg_match('/^mink\:([^\n]+)/', $tag, $matches)) {
$driver = $matches[1];
}
}
+ if (null !== $driver) {
+ $environment->getMink()->switchToDriver($driver);
+ } else {
+ $environment->getMink()->switchToDefaultDriver();
+ }
- $environment->getMink()->switchToDriver($driver);
$environment->getMink()->resetDriver();
});
View
18 src/Behat/Mink/Mink.php
@@ -44,11 +44,7 @@ public function __construct(SelectorsHandler $selectorsHandler = null)
*/
public function __destruct()
{
- foreach ($this->drivers as $driver) {
- if ($driver->isStarted()) {
- $driver->stop();
- }
- }
+ $this->stopDrivers();
}
/**
@@ -110,6 +106,18 @@ public function resetDriver()
}
/**
+ * Stop all started drivers.
+ */
+ public function stopDrivers()
+ {
+ foreach ($this->drivers as $driver) {
+ if ($driver->isStarted()) {
+ $driver->stop();
+ }
+ }
+ }
+
+ /**
* Returns mink session, initialized with current (or default) driver.
*
* @return Behat\Mink\Session
View
29 src/Behat/Mink/Selector/NamedSelector.php
@@ -18,20 +18,41 @@
class NamedSelector implements SelectorInterface
{
private $selectors = array(
- 'field' => <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = %locator% or ./@name = %locator%) or ./@id = //label[contains(normalize-space(string(.)), %locator%)]/@for)] | .//label[contains(normalize-space(string(.)), %locator%)]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+ 'fieldset' => <<<XPATH
+.//fieldset[(./@id = %locator% or .//legend[contains(normalize-space(string(.)), %locator%)])]
+XPATH
+ ,'field' => <<<XPATH
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = %locator% or ./@name = %locator%) or ./@id = //label[contains(normalize-space(string(.)), %locator%)]/@for) or ./@placeholder = %locator%)] | .//label[contains(normalize-space(string(.)), %locator%)]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH
,'link' => <<<XPATH
.//a[./@href][(((./@id = %locator% or contains(normalize-space(string(.)), %locator%)) or contains(./@title, %locator%)) or .//img[contains(./@alt, %locator%)])]
XPATH
,'button' => <<<XPATH
-.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][(./@id = %locator% or contains(./@value, %locator%))] | .//input[./@type = 'image'][contains(./@alt, %locator%)] | .//button[((./@id = %locator% or contains(./@value, %locator%)) or contains(normalize-space(string(.)), %locator%))] | .//input[./@type = 'image'][contains(./@alt, %locator%)]
+.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = %locator% or contains(./@value, %locator%)) or contains(./@title, %locator%))] | .//input[./@type = 'image'][contains(./@alt, %locator%)] | .//button[(((./@id = %locator% or contains(./@value, %locator%)) or contains(normalize-space(string(.)), %locator%)) or contains(./@title, %locator%))] | .//input[./@type = 'image'][contains(./@alt, %locator%)]
+XPATH
+ ,'link_or_button' => <<<XPATH
+.//a[./@href][(((./@id = %locator% or contains(normalize-space(string(.)), %locator%)) or contains(./@title, %locator%)) or .//img[contains(./@alt, %locator%)])] | .//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = %locator% or contains(./@value, %locator%)) or contains(./@title, %locator%))] | .//input[./@type = 'image'][contains(./@alt, %locator%)] | .//button[(((./@id = %locator% or contains(./@value, %locator%)) or contains(normalize-space(string(.)), %locator%)) or contains(./@title, %locator%))] | .//input[./@type = 'image'][contains(./@alt, %locator%)]
XPATH
,'content' => <<<XPATH
./descendant-or-self::*[contains(normalize-space(.), %locator%)]
XPATH
,'select' => <<<XPATH
-.//select[((./@id = %locator% or ./@name = %locator%) or ./@id = //label[contains(normalize-space(string(.)), %locator%)]/@for)] | .//label[contains(normalize-space(string(.)), %locator%)]//.//select
+.//select[(((./@id = %locator% or ./@name = %locator%) or ./@id = //label[contains(normalize-space(string(.)), %locator%)]/@for) or ./@placeholder = %locator%)] | .//label[contains(normalize-space(string(.)), %locator%)]//.//select
+XPATH
+ ,'checkbox' => <<<XPATH
+.//input[./@type = 'checkbox'][(((./@id = %locator% or ./@name = %locator%) or ./@id = //label[contains(normalize-space(string(.)), %locator%)]/@for) or ./@placeholder = %locator%)] | .//label[contains(normalize-space(string(.)), %locator%)]//.//input[./@type = 'checkbox']
+XPATH
+ ,'radio' => <<<XPATH
+.//input[./@type = 'radio'][(((./@id = %locator% or ./@name = %locator%) or ./@id = //label[contains(normalize-space(string(.)), %locator%)]/@for) or ./@placeholder = %locator%)] | .//label[contains(normalize-space(string(.)), %locator%)]//.//input[./@type = 'radio']
+XPATH
+ ,'file' => <<<XPATH
+.//input[./@type = 'file'][(((./@id = %locator% or ./@name = %locator%) or ./@id = //label[contains(normalize-space(string(.)), %locator%)]/@for) or ./@placeholder = %locator%)] | .//label[contains(normalize-space(string(.)), %locator%)]//.//input[./@type = 'file']
+XPATH
+ ,'optgroup' => <<<XPATH
+.//optgroup[contains(./@label, %locator%)]
+XPATH
+ ,'option' => <<<XPATH
+.//option[contains(normalize-space(string(.)), %locator%)]
XPATH
,'table' => <<<XPATH
.//table[(./@id = %locator% or contains(.//caption, %locator%))]
View
26 tests/Behat/Mink/Element/DocumentElementTest.php
@@ -69,7 +69,7 @@ public function testFind()
public function testFindField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for)] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for) or ./@placeholder = 'some field')] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$this->session->getDriver()
@@ -101,7 +101,7 @@ public function testFindLink()
public function testFindButton()
{
$xpath = <<<XPATH
-.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][(./@id = 'some button' or contains(./@value, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')] | .//button[((./@id = 'some button' or contains(./@value, 'some button')) or contains(normalize-space(string(.)), 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')]
+.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'some button' or contains(./@value, 'some button')) or contains(./@title, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')] | .//button[(((./@id = 'some button' or contains(./@value, 'some button')) or contains(normalize-space(string(.)), 'some button')) or contains(./@title, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')]
XPATH;
$this->session->getDriver()
@@ -177,7 +177,7 @@ public function testHasLink()
public function testHasButton()
{
$xpath = <<<XPATH
-.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][(./@id = 'some button' or contains(./@value, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')] | .//button[((./@id = 'some button' or contains(./@value, 'some button')) or contains(normalize-space(string(.)), 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')]
+.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'some button' or contains(./@value, 'some button')) or contains(./@title, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')] | .//button[(((./@id = 'some button' or contains(./@value, 'some button')) or contains(normalize-space(string(.)), 'some button')) or contains(./@title, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')]
XPATH;
$this->session->getDriver()
@@ -193,7 +193,7 @@ public function testHasButton()
public function testHasField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for)] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for) or ./@placeholder = 'some field')] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$this->session->getDriver()
@@ -209,7 +209,7 @@ public function testHasField()
public function testHasCheckedField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some checkbox' or ./@name = 'some checkbox') or ./@id = //label[contains(normalize-space(string(.)), 'some checkbox')]/@for)] | .//label[contains(normalize-space(string(.)), 'some checkbox')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some checkbox' or ./@name = 'some checkbox') or ./@id = //label[contains(normalize-space(string(.)), 'some checkbox')]/@for) or ./@placeholder = 'some checkbox')] | .//label[contains(normalize-space(string(.)), 'some checkbox')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$checkbox = $this->getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
@@ -233,7 +233,7 @@ public function testHasCheckedField()
public function testHasUncheckedField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some checkbox' or ./@name = 'some checkbox') or ./@id = //label[contains(normalize-space(string(.)), 'some checkbox')]/@for)] | .//label[contains(normalize-space(string(.)), 'some checkbox')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some checkbox' or ./@name = 'some checkbox') or ./@id = //label[contains(normalize-space(string(.)), 'some checkbox')]/@for) or ./@placeholder = 'some checkbox')] | .//label[contains(normalize-space(string(.)), 'some checkbox')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$checkbox = $this->getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
@@ -257,7 +257,7 @@ public function testHasUncheckedField()
public function testHasSelect()
{
$xpath = <<<XPATH
-.//select[((./@id = 'some select field' or ./@name = 'some select field') or ./@id = //label[contains(normalize-space(string(.)), 'some select field')]/@for)] | .//label[contains(normalize-space(string(.)), 'some select field')]//.//select
+.//select[(((./@id = 'some select field' or ./@name = 'some select field') or ./@id = //label[contains(normalize-space(string(.)), 'some select field')]/@for) or ./@placeholder = 'some select field')] | .//label[contains(normalize-space(string(.)), 'some select field')]//.//select
XPATH;
$this->session->getDriver()
@@ -317,7 +317,7 @@ public function testClickLink()
public function testClickButton()
{
$xpath = <<<XPATH
-.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][(./@id = 'some button' or contains(./@value, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')] | .//button[((./@id = 'some button' or contains(./@value, 'some button')) or contains(normalize-space(string(.)), 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')]
+.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'some button' or contains(./@value, 'some button')) or contains(./@title, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')] | .//button[(((./@id = 'some button' or contains(./@value, 'some button')) or contains(normalize-space(string(.)), 'some button')) or contains(./@title, 'some button'))] | .//input[./@type = 'image'][contains(./@alt, 'some button')]
XPATH;
$node = $this->getMockBuilder('Behat\Mink\Element\NodeElement')
@@ -345,7 +345,7 @@ public function testClickButton()
public function testFillField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for)] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for) or ./@placeholder = 'some field')] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$node = $this->getMockBuilder('Behat\Mink\Element\NodeElement')
@@ -373,7 +373,7 @@ public function testFillField()
public function testCheckField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for)] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for) or ./@placeholder = 'some field')] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$node = $this->getMockBuilder('Behat\Mink\Element\NodeElement')
@@ -401,7 +401,7 @@ public function testCheckField()
public function testUncheckField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for)] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for) or ./@placeholder = 'some field')] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$node = $this->getMockBuilder('Behat\Mink\Element\NodeElement')
@@ -429,7 +429,7 @@ public function testUncheckField()
public function testSelectField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for)] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for) or ./@placeholder = 'some field')] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$node = $this->getMockBuilder('Behat\Mink\Element\NodeElement')
@@ -457,7 +457,7 @@ public function testSelectField()
public function testAttachFileToField()
{
$xpath = <<<XPATH
-.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for)] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
+.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'some field' or ./@name = 'some field') or ./@id = //label[contains(normalize-space(string(.)), 'some field')]/@for) or ./@placeholder = 'some field')] | .//label[contains(normalize-space(string(.)), 'some field')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]
XPATH;
$node = $this->getMockBuilder('Behat\Mink\Element\NodeElement')
2  vendor/Buzz
@@ -1 +1 @@
-Subproject commit d8a1aee9d2cb0c43bd3ab28d5ed16bee0719287a
+Subproject commit d44e1d58807f714c10029ac0192b54360d3e713c
2  vendor/Goutte
@@ -1 +1 @@
-Subproject commit 5583ce5296ebad22e535f911c99a6d21f5c69406
+Subproject commit 0ed3eed9b16d305508c25715771bba841be39da2
2  vendor/SahiClient
@@ -1 +1 @@
-Subproject commit cc8d33354d98f4353dc79a4d0c2e5c03de02b830
+Subproject commit dddcfa3cc323bbc85f2c6d7ffb512210a984a240
2  vendor/Symfony/Component/CssSelector
@@ -1 +1 @@
-Subproject commit 5afebb6d327a351c2ca4a069efad80b96ec6deb0
+Subproject commit d09a6649ec46eb626d67345dcdfff9b219ddfe9b

0 comments on commit 1d5c865

Please sign in to comment.
Something went wrong with that request. Please try again.