This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge branch 'release/0.1.1'

  • Loading branch information...
2 parents 75beacf + d6d38fc commit ac47d15003d51596ff880b2ec2b3dcdab17c1d78 @everzet everzet committed Apr 6, 2011
View
@@ -1,3 +1,11 @@
+0.1.1 / 2011-04-06
+==================
+
+ * Fixed should/should_not steps
+ * Added spanish translation
+ * Fixed forms to use <base> element
+ * Fixed small UnsupportedByDriverException issue
+
0.1.0 / 2011-04-04
==================
@@ -430,8 +430,20 @@ private function getField($xpath)
throw new ElementNotFoundException('form submit button');
}
+ $base = $this->client->getCrawler()->filter('base')->extract(array('href'));
+ if (count($base)) {
+ $base = current($base);
+ } else {
+ $base = NULL;
+ }
+
// init form
- $button = new Crawler($buttonNode, $this->client->getRequest()->getUri());
+ $button = new Crawler(
+ $buttonNode,
+ $this->client->getRequest()->getUri(),
+ $base
+ );
+
$this->forms[] = $form = $button->form();
return $form[$fieldNode->getAttribute('name')];
@@ -2,6 +2,8 @@
namespace Behat\Mink\Exception;
+use Behat\Mink\Driver\DriverInterface;
+
/*
* This file is part of the Behat\Mink.
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
@@ -0,0 +1,79 @@
+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
+ <file original="global" source-language="en" target-language="es" datatype="plaintext">
+ <header />
+ <body>
+ <trans-unit id="i-am-on-page">
+ <source><![CDATA[/^(?:|I )am on (?P<page>.+)$/]]></source>
+ <target><![CDATA[/^(?:|Yo )estoy en (?P<page>.+)$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-go-to-page">
+ <source><![CDATA[/^(?:|I )go to (?P<page>.+)$/]]></source>
+ <target><![CDATA[/^(?:|Yo )voy a (?P<page>.+)$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-press-button">
+ <source><![CDATA[/^(?:|I )press "(?P<button>[^"]*)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )presiono "(?P<button>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-follow-link">
+ <source><![CDATA[/^(?:|I )follow "(?P<link>[^"]*)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )sigo "(?P<link>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-fill-in-field-with-value">
+ <source><![CDATA[/^(?:|I )fill in "(?P<field>[^"]*)" with "(?P<value>[^"]*)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )relleno "(?P<field>[^"]*)" con "(?P<value>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-fill-in-value-for-field">
+ <source><![CDATA[/^(?:|I )fill in "(?P<value>[^"]*)" for "(?P<field>[^"]*)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )relleno "(?P<value>[^"]*)" para "(?P<field>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-fill-in-the-following">
+ <source><![CDATA[/^(?:|I )fill in the following:$/]]></source>
+ <target><![CDATA[/^(?:|Yo )relleno el siguiente:$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-select-option-from-select">
+ <source><![CDATA[/^(?:|I )select "(?P<option>[^"]*)" from "(?P<select>[^"]*)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )selecciono "(?P<option>[^"]*)" desde "(?P<select>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-check-option">
+ <source><![CDATA[/^(?:|I )check "(?P<option>[^"]*)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )chequeo "(?P<option>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-uncheck-option">
+ <source><![CDATA[/^(?:|I )uncheck "(?P<option>[^"]*)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )dechequeo "(?P<option>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-attach-the-file-to-field">
+ <source><![CDATA[/^(?:|I )attach the file "(?P<path>[^"]*)" to "(?P<field>[^"]*)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )adjunto el archivo "(?P<path>[^"]*)" a "(?P<field>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-should-see-text">
+ <source><![CDATA[/^(?:|I )should see "(?P<text>[^"]*+)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )debo ver "(?P<text>[^"]*+)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-should-not-see-text">
+ <source><![CDATA[/^(?:|I )should not see "(?P<text>[^"]*+)"$/]]></source>
+ <target><![CDATA[/^(?:|Yo )no debo ver "(?P<text>[^"]*+)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="the-field-should-contain-value">
+ <source><![CDATA[/^the "(?P<field>[^"]*)" field should contain "(?P<value>[^"]*)"$/]]></source>
+ <target><![CDATA[/^el campo "(?P<field>[^"]*)" debe contener "(?P<value>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="the-field-should-not-contain-value">
+ <source><![CDATA[/^the "(?P<field>[^"]*)" field should not contain "(?P<value>[^"]*)"$/]]></source>
+ <target><![CDATA[/^el campo "(?P<field>[^"]*)" no debe contener "(?P<value>[^"]*)"$/]]></target>
+ </trans-unit>
+ <trans-unit id="the-checkbox-should-be-checked">
+ <source><![CDATA[/^the "(?P<checkbox>[^"]*)" checkbox should be checked$/]]></source>
+ <target><![CDATA[/^el checkbox "(?P<checkbox>[^"]*) debe estar seleccionado" $/]]></target>
+ </trans-unit>
+ <trans-unit id="the-checkbox-should-not-be-checked">
+ <source><![CDATA[/^the "(?P<checkbox>[^"]*)" checkbox should not be checked$/]]></source>
+ <target><![CDATA[/^el checkbox "(?P<checkbox>[^"]*)" no debe estar seleccionado$/]]></target>
+ </trans-unit>
+ <trans-unit id="i-should-be-on-page">
+ <source><![CDATA[/^(?:|I )should be on (?P<page>.+)$/]]></source>
+ <target><![CDATA[/^(?:|Yo )debo estar en (?P<page>.+)$/]]></target>
+ </trans-unit>
+ </body>
+ </file>
+</xliff>
@@ -1,5 +1,5 @@
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
- <file original="global" source-language="en" target-language="ru" datatype="plaintext">
+ <file original="global" source-language="en" target-language="fr" datatype="plaintext">
<header />
<body>
<trans-unit id="i-am-on-page">
@@ -47,12 +47,12 @@
<target><![CDATA[/^(?:|J' )attache le fichier "(?P<path>[^"]*)" à "(?P<field>[^"]*)"$/]]></target>
</trans-unit>
<trans-unit id="i-should-see-text">
- <source><![CDATA[/^(?:|I )should see "(?P<text>[^"]*)"$/]]></source>
- <target><![CDATA[/^(?:|je )devrais voir "(?P<text>[^"]*)"$/]]></target>
+ <source><![CDATA[/^(?:|I )should see "(?P<text>[^"]*+)"$/]]></source>
+ <target><![CDATA[/^(?:|je )devrais voir "(?P<text>[^"]*+)"$/]]></target>
</trans-unit>
<trans-unit id="i-should-not-see-text">
- <source><![CDATA[/^(?:|I )should not see "(?P<text>[^"]*)"$/]]></source>
- <target><![CDATA[/^(?:|je )ne devrais pas voir "(?P<text>[^"]*)"$/]]></target>
+ <source><![CDATA[/^(?:|I )should not see "(?P<text>[^"]*+)"$/]]></source>
+ <target><![CDATA[/^(?:|je )ne devrais pas voir "(?P<text>[^"]*+)"$/]]></target>
</trans-unit>
<trans-unit id="the-field-should-contain-value">
<source><![CDATA[/^the "(?P<field>[^"]*)" field should contain "(?P<value>[^"]*)"$/]]></source>
@@ -47,12 +47,12 @@
<target><![CDATA[/^(?:|я )выбираю файл "(?P<path>[^"]*)" в поле "(?P<field>[^"]*)"$/]]></target>
</trans-unit>
<trans-unit id="i-should-see-text">
- <source><![CDATA[/^(?:|I )should see "(?P<text>[^"]*)"$/]]></source>
- <target><![CDATA[/^(?:|я )должен видеть "(?P<text>[^"]*)"$/]]></target>
+ <source><![CDATA[/^(?:|I )should see "(?P<text>[^"]*+)"$/]]></source>
+ <target><![CDATA[/^(?:|я )должен видеть "(?P<text>[^"]*+)"$/]]></target>
</trans-unit>
<trans-unit id="i-should-not-see-text">
- <source><![CDATA[/^(?:|I )should not see "(?P<text>[^"]*)"$/]]></source>
- <target><![CDATA[/^(?:|я )не должен видеть "(?P<text>[^"]*)"$/]]></target>
+ <source><![CDATA[/^(?:|I )should not see "(?P<text>[^"]*+)"$/]]></source>
+ <target><![CDATA[/^(?:|я )не должен видеть "(?P<text>[^"]*+)"$/]]></target>
</trans-unit>
<trans-unit id="the-field-should-contain-value">
<source><![CDATA[/^the "(?P<field>[^"]*)" field should contain "(?P<value>[^"]*)"$/]]></source>
@@ -57,12 +57,12 @@
$world->getSession()->getPage()->attachFileToField($field, $path);
});
-$steps->Then('/^(?:|I )should see "(?P<text>[^"]*)"$/', function($world, $text) {
- assertTrue($world->getSession()->getPage()->hasContent($text));
+$steps->Then('/^(?:|I )should see "(?P<text>[^"]*+)"$/', function($world, $text) {
+ assertRegExp('/'.preg_quote($text).'/', $world->getSession()->getPage()->getContent());
});
-$steps->Then('/^(?:|I )should not see "(?P<text>[^"]*)"$/', function($world, $text) {
- assertFalse($world->getSession()->getPage()->hasContent($text));
+$steps->Then('/^(?:|I )should not see "(?P<text>[^"]*+)"$/', function($world, $text) {
+ assertRegExp('/(?!'.preg_quote($text).')/', $world->getSession()->getPage()->getContent());
});
$steps->Then('/^the "(?P<field>[^"]*)" field should contain "(?P<value>[^"]*)"$/', function($world, $field, $value) {

0 comments on commit ac47d15

Please sign in to comment.