Skip to content

StuDocu/codeception-mobileemulation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebDriver mobile emulation switcher for Codeception

Software License Build Status Latest Stable Version

This Codeception module can be able mobile emulation on browser. Currently support only chrome browser.

Installation

You can install this plugin into your applicaion using composer.

The recommended way to install composer packages is:

composer require --dev studocu/codeception-mobileemulation

Then enable this module in your test suite configration file (eg: acceptance.suite.yml and etc...):

modules:
    enabled:
        - MobileEmulation
        - WebDriver

See: 06-ModulesAndHelpers - Codeception - Documentation

[IMPORTANT] MobileEmulation module should be load before WebDriver module.

Usage

In your Cest test case, write $mobileEmulation property:

class AwesomeCest
{
    public $mobileEmulation = true;

    // ...
}

When $mobileEmulation = true, within this testcase, mobile emulation is enabled.

And you can use emulationMobile() method:

class AwesomeCest
{
    public function tryYourSenario($I)
    {
        // enable mobile emulation manually, (with specific device name)
        $I->emulationMobile('iPhone 8 Plus');
        // ...
    }
}

Configuration options

defaultDeviceName

Default emulate device name.

default: 'iPhone 6'

About

WebDriver mobile emulation switcher for Codeception

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.5%
  • Shell 0.5%