承接 fonsecas72/behat-failurehook-extension 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fonsecas72/behat-failurehook-extension

Composer 安装命令:

composer require fonsecas72/behat-failurehook-extension

包简介

Exposes stuff when a test fails

README 文档

README

This behat extension will trigger actions when your test failed that you can use e.g. to take a screenshot, save the html content, or something more specific as it allows you to add your own thing.

How your behat.yml should look like:

default:
    extensions:
        Fonsecas72\FailureExpoExtension:
            expounds:
                - Features\FailureHooks\MySQLDumpExpound

You should not need anything else to make it work.

Adding your own hooks:

E.g. of a hook:

<?php

namespace Features\FailureHooks;

class MySQLDumpExpound extends \Fonsecas72\FailureExpoExtension\Expounds\Expound
{
    public function expose()
    {
        $fs = new \Symfony\Component\Filesystem\Filesystem();
        $destination = 'build/'.$this->description;
        $fs->mkdir($destination);
        shell_exec('mysqldump -uuser -ppass db > '.$destination.'/dbdump.sql');
        echo PHP_EOL.'| MysqlDump captured ~> '.$destination.'/dbdump.sql';
    }
}

How it works

Your failure-hook should extend \Fonsecas72\FailureExpoExtension\Expounds\Expound and implement expose method. This method will be called when a failure occurs. Failure-hook extension will then expose a special "description" property that identifies the failing scenairo.

统计信息

  • 总下载量: 29.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache2
  • 更新时间: 2016-08-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固