Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'release/0.2.4'

  • Loading branch information...
commit faa900739843e3e2996ca97e4b401f51e2be9b40 2 parents c78aa76 + 9e527bc
@everzet everzet authored
View
8 CHANGES.md
@@ -1,3 +1,11 @@
+0.2.4 / 2011-05-12
+==================
+
+ * Fixed wrong url locator function
+ * Fixed wrong regex in `should see` step
+ * Fixed delimiters use in `should see` step
+ * Added url-match step for checking urls against regex
+
0.2.3 / 2011-05-01
==================
View
4 src/Behat/Mink/Integration/MinkEnvironment.php
@@ -37,7 +37,9 @@ public function __construct()
$world->drivers = array();
$world->getPathTo = function($path) use($world) {
- return 0 !== strpos('http', $path) ? $world->getParameter('start_url') . $path : $path;
+ $startUrl = rtrim($world->getParameter('start_url'), '/') . '/';
+
+ return 0 !== strpos('http', $path) ? $startUrl . ltrim($path, '/') : $path;
};
}
View
8 src/Behat/Mink/Integration/steps/i18n/es.xliff
@@ -47,12 +47,12 @@
<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>
+ <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>
+ <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>
View
8 src/Behat/Mink/Integration/steps/i18n/fr.xliff
@@ -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>
View
8 src/Behat/Mink/Integration/steps/i18n/ja.xliff
@@ -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>
View
12 src/Behat/Mink/Integration/steps/i18n/ru.xliff
@@ -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>
@@ -74,6 +74,10 @@
<source><![CDATA[/^(?:|I )should be on (?P<page>.+)$/]]></source>
<target><![CDATA[/^(?:|я )должен быть на странице (?P<page>.+)$/]]></target>
</trans-unit>
+ <trans-unit id="the-url-should-match">
+ <source><![CDATA[/^the url should match (?P<pattern>.+)$/]]></source>
+ <target><![CDATA[/^(?:url|адрес) должен соответствовать (?P<pattern>.+)$/]]></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>
View
16 src/Behat/Mink/Integration/steps/mink_steps.php
@@ -57,12 +57,12 @@
$world->getSession()->getPage()->attachFileToField($field, $path);
});
-$steps->Then('/^(?:|I )should see "(?P<text>[^"]*+)"$/', function($world, $text) {
- assertRegExp('/'.preg_quote($text).'/', $world->getSession()->getPage()->getContent());
+$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) {
- assertNotRegExp('/'.preg_quote($text).'/', $world->getSession()->getPage()->getContent());
+$steps->Then('/^(?:|I )should not see "(?P<text>[^"]*)"$/', function($world, $text) {
+ assertNotRegExp('/'.preg_quote($text, '/').'/', $world->getSession()->getPage()->getContent());
});
$steps->Then('/^the "(?P<field>[^"]*)" field should contain "(?P<value>[^"]*)"$/', function($world, $field, $value) {
@@ -112,6 +112,14 @@
);
});
+$steps->Then('/^the url should match (?P<pattern>.+)$/', function($world, $pattern) use ($steps) {
+ if (preg_match('/^\/.*\/$', $pattern)) {
+ assertRegExp($pattern, parse_url($world->getSession()->getCurrentUrl(), PHP_URL_PATH));
+ } else {
+ $steps->Then("I should be on $pattern");
+ }
+});
+
$steps->Then('/^the "(?P<element>[^"]*)" element should contain "(?P<value>[^"]*)"$/', function($world, $element, $value) {
$node = $world->getSession()->getPage()->find('xpath', $element);
Please sign in to comment.
Something went wrong with that request. Please try again.