承接 yawik/behat 相关项目开发

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

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

yawik/behat

最新稳定版本:1.0.5

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

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固