Skip to content

Instantly share code, notes, and snippets.

@msanroman
Created February 27, 2012 15:35
Show Gist options
  • Save msanroman/1924704 to your computer and use it in GitHub Desktop.
Save msanroman/1924704 to your computer and use it in GitHub Desktop.
FeatureContext
<?php
namespace Runroom\BaseBundle\Features\Context;
use Behat\BehatBundle\Context\BehatContext,
Behat\BehatBundle\Context\MinkContext;
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
//
// Require 3rd-party libraries here:
//
// require_once 'PHPUnit/Autoload.php';
// require_once 'PHPUnit/Framework/Assert/Functions.php';
//
/**
* Feature context.
*/
class FeatureContext extends MinkContext //MinkContext if you want to test web
{
/**
* @When /^I click on the "([^"]*)" logo$/
*/
public function iClickOnTheLogo($sectionName)
{
$session = $this->getSession();
$page = $session->getPage();
$logo = $page->find('css', 'h2.Playground'.$sectionName)->find('xpath', '..');
$logo->click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment