定制 yawik/behat 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

yawik/behat

Composer 安装命令:

composer require yawik/behat

包简介

This package provide a Behat tests utility for yawik

README 文档

README

Yawik use behat to do browser testing. Here's how to run behat tests:

WARNING!!!

In order to perform installation tests, behat will create config/autoload/install.module.php file. If you have your yawik installation always go to install page, please remove this file manually and restore backup file:

$ cd path/to/yawik
$ rm config/autoload/install.module.php
$ mv config/autoload/yawik.backup config/autoload/yawik.config.global.php

Behat Configuration

Copy default behat configuration file:

$ cp behat.yml.dist behat.yml

Edit base_url in behat.yml configuration files to match your local yawik installation url:

# change base url to match your location
default:
    ...
    extensions:
        ...
        Behat\MinkExtension:
            # change this base url value to match
            # your local development server url:
            base_url: "http://localhost:8000"
            files_path: "%paths.base%/module/Behat/resources/fixtures/"

Run Behat tests

Start selenium standalone server with chrome driver:

$ cd path/to/yawik
$ ./bin/start-selenium.sh

You can run all scenario with this command:

$ cd path/to/yawik
$ ./vendor/bin/behat

To run behat only for specific feature:

$ ./vendor/bin/behat features/install.feature

To run behat only for specific scenario:

$ ./vendor/bin/behat features/install.feature:12

That command above will run only scenario in features/install.feature line 12

Screenshot

Because by default behat will perform test in headless mode, you can see screenshot for behat failed test in build/behat directory. The *.png files will show browser screenshot, and *.log files will show actual html output during tests.

Mail and Social Profile Feature

By default behat will skip mail and social profile tests, because this will cause error in travis. To perform this skipped tests you need to be sure that your mail and social login configuration is valid, and configure social profile user to be used during tests:

# path/to/yawik/behat.yml
default:
    suites:
        user:
            contexts:
                - Yawik\Behat\UserContext:
                      parameters:
                          social_login_info:
                              facebook:
                                  email:  <test-facebook-user>
                                  pass:   <test-facebook-password>
                              linkedin:
                                  session_key-login:      <test-linked-in-user>
                                  session_password-login: <test-linked-in-password>

You can run this skipped tests by using this command:

# to run mail tests:
$ cd path/to/yawik
$ ./vendor/bin/behat --tags=@mail

# to run social profile tests
$ cd path/to/yawik
$ ./vendor/bin/behat --tags=@social-profile

yawik/behat 适用场景与选型建议

yawik/behat 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.15k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 10 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Behat」 「module」 「yawik」 「laminas」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 yawik/behat 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 yawik/behat 我们能提供哪些服务?
定制开发 / 二次开发

基于 yawik/behat 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-22