mercredi 31 décembre 2014

getting error in behat - Call to undefined method FeatureContext:visit

Getting the following error:


Scenario:


Feature: Admin In order to login admin


Scenario: User fills out Given I am on "admin/login" And I fill in "username" with "sivaganesh" And I fill in "password" with "demodemo" Then I should see "Hello Admin"






In order to login admin


Scenario: User fills out # features/admin.feature:4 PHP Fatal error: Call to undefined method FeatureContext::visit() in /home/vagrant/Sites/moore/features/bootstrap/FeatureContext.php on line 30 PHP Stack trace: PHP 1. {main}() /home/vagrant/Sites/moore/vendor/behat/behat/bin/behat:0 PHP 2. Symfony\Component\Console\Application->run() /home/vagrant/Sites/moore/vendor/behat/behat/bin/behat:31 PHP 3. Behat\Testwork\Cli\Application->doRun() /home/vagrant/Sites/moore/vendor/symfony/console/Symfony/Component/Console/Application.php:124 PHP 4. Symfony\Component\Console\Application->doRun() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php:102 PHP 5. Symfony\Component\Console\Application->doRunCommand() /home/vagrant/Sites/moore/vendor/symfony/console/Symfony/Component/Console/Application.php:193 PHP 6. Symfony\Component\Console\Command\Command->run() /home/vagrant/Sites/moore/vendor/symfony/console/Symfony/Component/Console/Application.php:889 PHP 7. Behat\Testwork\Cli\Command->execute() /home/vagrant/Sites/moore/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252 PHP 8. Behat\Testwork\Tester\Cli\ExerciseController->execute() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Cli/Command.php:63 PHP 9. Behat\Testwork\Tester\Cli\ExerciseController->testSpecifications() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:108 PHP 10. Behat\Testwork\EventDispatcher\Tester\EventDispatchingExercise->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:146 PHP 11. Behat\Testwork\Tester\Runtime\RuntimeExercise->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php:70 PHP 12. Behat\Testwork\EventDispatcher\Tester\EventDispatchingSuiteTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeExercise.php:71 PHP 13. Behat\Testwork\Hook\Tester\HookableSuiteTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php:72 PHP 14. Behat\Testwork\Tester\Runtime\RuntimeSuiteTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Hook/Tester/HookableSuiteTester.php:73 PHP 15. Behat\Behat\EventDispatcher\Tester\EventDispatchingFeatureTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeSuiteTester.php:63 PHP 16. Behat\Behat\Hook\Tester\HookableFeatureTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php:71 PHP 17. Behat\Behat\Tester\Runtime\RuntimeFeatureTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableFeatureTester.php:72 PHP 18. Behat\Behat\EventDispatcher\Tester\EventDispatchingScenarioTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeFeatureTester.php:83 PHP 19. Behat\Behat\Hook\Tester\HookableScenarioTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php:103 PHP 20. Behat\Behat\Tester\Runtime\RuntimeScenarioTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableScenarioTester.php:74 PHP 21. Behat\Behat\Tester\StepContainerTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php:76 PHP 22. Behat\Behat\EventDispatcher\Tester\EventDispatchingStepTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php:59 PHP 23. Behat\Behat\Hook\Tester\HookableStepTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php:73 PHP 24. Behat\Behat\Tester\Runtime\RuntimeStepTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableStepTester.php:74 PHP 25. Behat\Behat\Tester\Runtime\RuntimeStepTester->testDefinition() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php:73 PHP 26. Behat\Testwork\Call\CallCenter->makeCall() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php:125 PHP 27. Behat\Testwork\Call\CallCenter->handleCall() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php:80 PHP 28. Behat\Testwork\Call\Handler\RuntimeCallHandler->handleCall() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php:125 PHP 29. Behat\Testwork\Call\Handler\RuntimeCallHandler->executeCall() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:54 PHP 30. call_user_func_array:{/home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:99}() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:99 PHP 31. FeatureContext->iAmOn() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:99


Fatal error: Call to undefined method FeatureContext::visit() in /home/vagrant/Sites/moore/features/bootstrap/FeatureContext.php on line 30


Call Stack: 0.0009 226968 1. {main}() /home/vagrant/Sites/moore/vendor/behat/behat/bin/behat:0 0.4982 3792304 2. Symfony\Component\Console\Application->run() /home/vagrant/Sites/moore/vendor/behat/behat/bin/behat:31 0.5856 4173464 3. Behat\Testwork\Cli\Application->doRun() /home/vagrant/Sites/moore/vendor/symfony/console/Symfony/Component/Console/Application.php:124 2.4532 11607912 4. Symfony\Component\Console\Application->doRun() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php:102 2.4532 11608784 5. Symfony\Component\Console\Application->doRunCommand() /home/vagrant/Sites/moore/vendor/symfony/console/Symfony/Component/Console/Application.php:193 2.4533 11609256 6. Symfony\Component\Console\Command\Command->run() /home/vagrant/Sites/moore/vendor/symfony/console/Symfony/Component/Console/Application.php:889 2.4535 11612224 7. Behat\Testwork\Cli\Command->execute() /home/vagrant/Sites/moore/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252 2.4708 11694560 8. Behat\Testwork\Tester\Cli\ExerciseController->execute() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Cli/Command.php:63 2.4971 11758920 9. Behat\Testwork\Tester\Cli\ExerciseController->testSpecifications() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:108 2.5340 11801008 10. Behat\Testwork\EventDispatcher\Tester\EventDispatchingExercise->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:146 2.5340 11801240 11. Behat\Testwork\Tester\Runtime\RuntimeExercise->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php:70 2.6797 12008104 12. Behat\Testwork\EventDispatcher\Tester\EventDispatchingSuiteTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeExercise.php:71 2.6797 12008152 13. Behat\Testwork\Hook\Tester\HookableSuiteTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php:72 2.6798 12008320 14. Behat\Testwork\Tester\Runtime\RuntimeSuiteTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Hook/Tester/HookableSuiteTester.php:73 2.7868 12163840 15. Behat\Behat\EventDispatcher\Tester\EventDispatchingFeatureTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeSuiteTester.php:63 2.7868 12163888 16. Behat\Behat\Hook\Tester\HookableFeatureTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php:71 2.7868 12164096 17. Behat\Behat\Tester\Runtime\RuntimeFeatureTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableFeatureTester.php:72 2.8154 12228624 18. Behat\Behat\EventDispatcher\Tester\EventDispatchingScenarioTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeFeatureTester.php:83 2.8154 12228672 19. Behat\Behat\Hook\Tester\HookableScenarioTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php:103 2.8154 12228784 20. Behat\Behat\Tester\Runtime\RuntimeScenarioTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableScenarioTester.php:74 2.8154 12229128 21. Behat\Behat\Tester\StepContainerTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php:76 2.8405 12272376 22. Behat\Behat\EventDispatcher\Tester\EventDispatchingStepTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php:59 2.8405 12272424 23. Behat\Behat\Hook\Tester\HookableStepTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php:73 2.8405 12272488 24. Behat\Behat\Tester\Runtime\RuntimeStepTester->test() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableStepTester.php:74 2.8713 12364856 25. Behat\Behat\Tester\Runtime\RuntimeStepTester->testDefinition() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php:73 2.8882 12391240 26. Behat\Testwork\Call\CallCenter->makeCall() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php:125 2.8883 12391944 27. Behat\Testwork\Call\CallCenter->handleCall() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php:80 2.8883 12392040 28. Behat\Testwork\Call\Handler\RuntimeCallHandler->handleCall() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php:125 2.8884 12409808 29. Behat\Testwork\Call\Handler\RuntimeCallHandler->executeCall() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:54 2.8884 12410656 30. call_user_func_array:{/home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:99}() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:99 2.8884 12411032 31. FeatureContext->iAmOn() /home/vagrant/Sites/moore/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:99





ContextFeature.php File



use Behat\Behat\Context\Context; use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode;


/** * Defines application features from the specific context. */ class FeatureContext implements Context, SnippetAcceptingContext { /** * Initializes context. * * Every scenario gets its own context instance. * You can also pass arbitrary arguments to the * context constructor through behat.yml. */ public function __construct() { }



/**
* @Given I am on :arg1
*/
public function iAmOn($arg1)
{
$this->visit('GET', '/');
#throw new PendingException();
}

/**
* @Given I fill in :arg1 with :arg2
*/
public function iFillInWith($arg1, $arg2)
{
throw new PendingException();
}

/**
* @Then I should see :arg1
*/
public function iShouldSee($arg1)
{
throw new PendingException();
} }




"behat/behat": "3.0.@dev", "behat/mink": "1.6.@dev", "behat/mink-extension": "2.0.@dev", "behat/mink-goutte-driver": "1.1.@dev"


Aucun commentaire:

Enregistrer un commentaire