forked from vendo/vendo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BDD Tests: Getting tests working with newest behat
- Loading branch information
Showing
11 changed files
with
73 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
paths: | ||
features: %behat.paths.base%/vendo | ||
support: %behat.paths.base%/vendo/support | ||
steps: | ||
- %behat.paths.base%/vendo/steps | ||
- %behat.paths.base%/default/steps | ||
#paths: | ||
# features: %behat.paths.base%/vendo | ||
# support: %behat.paths.base%/vendo/support | ||
# steps: | ||
# - %behat.paths.base%/vendo/steps | ||
# - %behat.paths.base%/default/steps | ||
|
||
default: | ||
# formatter: | ||
# name: progress | ||
environment: | ||
parameters: | ||
start_url: http://vendo/ | ||
|
||
paths: | ||
features: '%%BEHAT_BASE_PATH%%/vendo' | ||
support: '%%BEHAT_BASE_PATH%%/vendo/support' | ||
steps: | ||
- '%%BEHAT_BASE_PATH%%/vendo/steps' | ||
|
||
imports: | ||
- mink/behat.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@code | ||
Feature: Ensure core classes function properly | ||
|
||
# Scenario: I can read a product's variants | ||
# Given the following product exists: | ||
# | name | price | description | order | | ||
# | Foo | 9.99 | This is a test | 1 | | ||
# And the following variant exists | ||
# | name | price | description | order | | ||
# | Foo - Var | | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
<?php | ||
|
||
$steps->Given('/^there are items in my cart$/', function($world) { | ||
$world->visit('cart/add?id=105'); | ||
assertTrue($world->response->filter('.total_items')->extract(array('_text')) > 0); | ||
$product = Model::factory('vendo_product')->load( | ||
db::select()->where('name', '=', 'Foobar') | ||
); | ||
$world->getSession()->visit('/cart/add?id='.$product->id); | ||
$node = $world->getSession()->getPage()->find('xpath', '//td[@id="total_items"]'); | ||
|
||
assertTrue($node->getText() > 0); | ||
}); | ||
|
||
$steps->Then('/^I should see the "(.+)" page$/', function($world, $title) { | ||
$text = $world->response->filter('div#content > h2')->extract(array('_text')); | ||
assertSame(current($text), $title); | ||
$node = $world->getSession()->getPage()->find('xpath', '//div[@id="content"]/h2'); | ||
assertSame($title, $node->getText()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
|
||
$steps->Given('/^I log in$/', function($world) use($steps) { | ||
$steps->Given('I am logged out', $world); | ||
$steps->When('I click the "Login" link', $world); | ||
$steps->When('I follow "Login"', $world); | ||
$steps->And('I fill in "email" with "[email protected]"', $world); | ||
$steps->And('I fill in "password" with "test"', $world); | ||
$steps->And('I press "Login"', $world); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
// Init kohana | ||
require_once '../modules/unittest/bootstrap.php'; | ||
|
||
require_once 'mink/autoload.php'; | ||
require_once 'Zend/Registry.php'; | ||
require_once 'PHPUnit/Autoload.php'; | ||
require_once 'PHPUnit/Framework/Assert/Functions.php'; | ||
|
||
// Ignore facebook html errors | ||
libxml_use_internal_errors(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters