8

Click here to load reader

Regression Tests with Symfony - Example

Embed Size (px)

Citation preview

Page 1: Regression Tests with Symfony - Example

Regression Testing with Symfony Tools and techniques for building your test suite

Page 2: Regression Tests with Symfony - Example

Part 2: Utilizing the tools

Functional tests with the BehatBundle

Components of the MinkBundle

Selection of Browser Drivers

Zombie JS Driver

Sahi Driver

Page 3: Regression Tests with Symfony - Example

BDD Test Specification

Scenario: Put item in shopping cart

Given the case, the customer wants to buy a movie

And his shopping cart is empty

And there are 2 movies in stock

When he puts the item in the shopping cart

Then the item should show up in the shopping cart

And the shopping cart counter should show 1

And 1 movie should be in stock

Page 4: Regression Tests with Symfony - Example

Gherkin Language

Formal language to define functional tests

Entry points using defined keywords

Feature: Set of functional test for a specific domain

Background: Steps that will be executed for each scenario

Scenario: Steps to test a certain behaviour

Page 5: Regression Tests with Symfony - Example

Gherkin Language

Keywords for step definitions

Given: Pre-condition for the scenario

When: Action/Operation to perform

Then: Test for expected result

And: Chaining of step definitions

Page 6: Regression Tests with Symfony - Example

Behat + Bundle

BehatBundle integrates Behat in Symfony

Setup of kernel

Access to DIC

Mapping of Gherkin

Located in own directory structure

.feature file to define step definitions

FeatureContext to match the steps

Page 7: Regression Tests with Symfony - Example

Mink + Bundle

MinkBundle integrates Mink into Symfony

Encapsulation of various browser drives

GoutteDriver: headless pure-php driver

SahiDriver: JS browser driver with GUI installer

ZombieDriver: Bridge for Zombie.js browser emulator

SeleniumDriver: Bridge to Selenium

FeatureContext for common browser operations

Setup of application kernel

Page 8: Regression Tests with Symfony - Example

Thank you for your attiontion!