WebDriver mobile emulation switcher for Codeception
, (*1)
This Codeception module can be able mobile emulation on browser. Currently support only chrome browser., (*2)
Installation
You can install this plugin into your applicaion using composer., (*3)
The recommended way to install composer packages is:, (*4)
composer require --dev elstc/codeception-mobileemulation
Then enable this module in your test suite configration file (eg: acceptance.suite.yml and etc...):, (*5)
modules:
enabled:
- MobileEmulation
- WebDriver
See: 06-ModulesAndHelpers - Codeception - Documentation, (*6)
[IMPORTANT] MobileEmulation module should be load before WebDriver module., (*7)
Usage
In your Cest test case, write $mobileEmulation property:, (*8)
```(php)
class AwesomeCest
{
public $mobileEmulation = true;, (*9)
// ...
}, (*10)
When `$mobileEmulation = true`, within this testcase, mobile emulation is enabled.
And you can use `emulationMobile()` method:
```(php)
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., (*11)
default: 'iPhone 6', (*12)