behat-chrome/behat-chrome-extension 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

behat-chrome/behat-chrome-extension

最新稳定版本:1.3.0

Composer 安装命令:

composer require behat-chrome/behat-chrome-extension

包简介

Behat extension for controlling chrome without selenium

README 文档

README

Please continue to use dmore/behat-chrome-extension via Packagist

See https://gitlab.com/behat-chrome/chrome-mink-driver/-/issues/121 for details.

In short: I created placeholder Packagist packages in the behat-chrome/* namespace as part of that issue. DMore and I then decided to retain the original Packagist name , but a few folks appear to have picked up on the new Packagist name.

The Gitlab projects only are moved to https://gitlab.com/behat-chrome/

To undo the composer change:

composer remove behat-chrome/behat-chrome-extension behat-chrome/chrome-mink-driver
composer require dmore/behat-chrome-extension dmore/chrome-mink-driver

The behat-chrome/ packages on Packagist are now marked abandoned and point people back to dmore/

README continues

Behat extension for controlling chrome without the overhead of selenium.

It communicates directly with chrome over HTTP and WebSockets, which allows it to work at least twice as fast as chrome with selenium.

For chrome 59+ it supports headless mode, eliminating the need to install a display server, and the overhead that comes with it.

This driver is tested and benchmarked against a behat suite of 1800 scenarios and 19000 steps. It can successfully run it in less than 18 minutes with chrome 60 headless.

The same suite running against chrome 58 with xvfb and selenium takes ~60 minutes.

Installation:

composer require dmore/behat-chrome-extension

Requirements:

  • Google chrome or chromium running with remote debugging

Example:

google-chrome-stable --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222

or headless (59+):

google-chrome-unstable --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222

The official docker image includes chrome 60 running headless.

See https://gitlab.com/DMore/behat-chrome-skeleton for a fully working example.

Usage:

default:
    extensions:
        DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
        Behat\MinkExtension:
            browser_name: chrome
            base_url: http://localhost
            sessions:
                default:
                    chrome:
                        api_url: "http://localhost:9222"

Configuration

The following optional configuration settings are available

validate_certificate

Default: true

Set to false to ignore invalid ssl certificates.

socket_timeout

Default: 10

Timeout in seconds before the HTTP or WebSocket connection to the chrome browser is considered dead.

download_behavior

Default: falls back to browser configuration

Set to 'allow' to allow downloads.

dom_wait_timeout

Default: 3000

How many milliseconds we should wait for DOM to be ready after each action/transition

download_path

Default: /tmp

Set to a directory path where you would like files to be downloaded. Requires download_behavior: allow

Example:

default:
    extensions:
        DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
        Behat\MinkExtension:
            browser_name: chrome
            base_url: http://localhost
            sessions:
                default:
                    chrome:
                        api_url: "http://localhost:9222"
                        download_behavior: allow
                        download_path: /download
                        validate_certificate: false

Contributing

You are encouraged to fork this repository and contribute your own improvements.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-20