Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

edno/codeception-browsermob

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
docs
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Codeception BrowserMob Proxy

Latest Version Dependency Status Build Status SensioLabs Insight Scrutinizer Code Quality Coverage Status GitHub license

The Codeception module for BrowserMob Proxy.

Roadmap

Minimum Requirements

  • Codeception 2.2
  • PHP 7.2
  • BrowserMob Proxy 2.0

Installation

The module can be installed using Composer.

$ composer require edno/codeception-browsermob

Be sure to enable the module as shown in configuration below.

Configuration

Enabling BrowserMob is done in your configuration file .yml.

module:
    enabled:
        - Codeception\Extension\BrowserMob
            host: 'localhost'
            port: 8080

Parameters

BrowserMob support following configuration parameters:

Parameter Type Description
host string BrowserMob Proxy host
port integer BrowserMob Proxy port
autostart boolean Start a new proxy instance automatically [default = false]
whitelist array

URLs whitelisting

code: HTTP status code for URLs that do not match patterns

patterns: array of whitelisted URLs patterns

blacklist array

URLs blacklisting

code: HTTP status code for URLs that match patterns

patterns: array of blacklisted URLs patterns

limits array Bandwidth limits through the proxy (see BrowserMob Proxy REST API)
timeouts array Proxy timeouts (see BrowserMob Proxy REST API)
basicAuth array

Sets automatic basic authentication a list of domains

domain: domain name

options:HTTP authentication parameters using format name: value (see BrowserMob Proxy REST API)

dns array

Internal proxy DNS using pairs of domain/IP to map

domain: domain name

ip: matching IP

retry integer Number of times a method will be retried [default = 0]

Example

modules:
    config:
        Codeception\Extension\BrowserMob:
            host: 'localhost'
            port: 9090
            autostart: true
            whitelist:
                code: 404
                patterns:
                    - 'http://codeception.com/'
            limits:
                downstreamKbps: 12
                upstreamKbps: 12
                latency: 1
            timeouts:
                request: 10
                read: 10
                connection: 10
                dns: 10
            basicAuth:
                - domain: example.local
                  options:
                      username: myUsername
                      password: myPassword
            dns:
                - domain: example.local
                  ip: 127.0.0.1
                - domain: wikipedia.org
                  ip: 192.168.1.1
            retry: 3

Documentation

The module documentation is available in the wiki.

For more information on how to use BrowserMob proxy, refer to BrowserMob Proxy REST API documentation.