Skip to content

Instantly share code, notes, and snippets.

@michalochman
michalochman / gist:3175175
Created July 25, 2012 08:53
Take screenshot with Behat/Mink after failed step
/**
* Take screenshot when step fails.
* Works only with Selenium2Driver.
*
* @AfterStep
*/
public function takeScreenshotAfterFailedStep($event)
{
if (4 === $event->getResult()) {
$driver = $this->getSession()->getDriver();
@callado4
callado4 / behat-phantomjs-webdriver.md
Last active January 24, 2021 17:10
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub" 
@Padam87
Padam87 / ffmpeg-singleaudiostream.sh
Last active October 7, 2019 15:57
Remove unnecessary audio streams from video files using ffmpeg.
#!/bin/bash
files=${1-"*.avi"};
audio_stream=${2-"0:1"};
video_stream=${3-"0:0"};
output_dir=${4-output};
echo -e "\e[0;33m";
echo " Files: $files";
echo "Video stream: $video_stream";
@Padam87
Padam87 / AppKernel.php
Last active August 29, 2015 13:56
Symfony2 bundle functional test suite with Doctrine
<?php
// Tests/App/app/AppKernel.php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
@Padam87
Padam87 / app_prod.yml
Created October 9, 2014 13:10
Symfony autogenerate assets_version
imports:
- { resource: ../../assets_version.yml }
framework:
templating:
assets_version: %assets_version%