This document provides instructions for setting up and running user acceptance tests with Behat and Mink in PHP. It outlines installing necessary Behat and Mink dependencies, configuring a Behat YAML configuration file to define suites and contexts, writing a sample feature file with scenarios, defining a context class to implement step definitions, and executing tests by running Behat. The goal is to demonstrate how to test a Google search functionality by automating browser interactions and assertions.
9. HOW #3
define feature
# features/TestGoogle.feature
Feature: Test Google
In order to search for something
Scenario: Search for how google works
Given I am on "/"
When I fill in "q" with "how google works"
And I press "btnG"
Then I wait for the next step
Then I should see "How Google Works"
10. HOW #4
define context
<?php
use BehatMinkExtensionContextMinkContext;
class TestGoogleContext extends MinkContext
{
/**
* @Then /^I wait for the next step$/
*/
public function iWaitForTheNextStep()
{
$this->getSession()->wait(1000);
}
}
Why we need acceptance test ( uat, refactor, unit test ,integration test)
One step before manually testing (CI flow)
Where, when, in which situation should we applied ?