Completed
Push — develop ( 7c60a0...5a505b )
by Carlo
8s
created

WindowResizer::resizeToDesktopWindow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
nc 1
cc 1
eloc 2
nop 1
1
<?php
2
3
namespace Magefix\Plugin;
4
5
use Behat\Mink\Driver\DriverInterface;
6
7
/**
8
 * Class WindowResizer
9
 * 
10
 * @package Magefix\Plugin
11
 * @author  Carlo Tasca <[email protected]>
12
 */
13
trait WindowResizer
14
{
15
    private $desktopWidth = 1920;
16
    private $desktopHeight = 1080;
17
    private $mobileWidth = 320;
18
    private $mobileHeight = 568;
19
20
    /**
21
     * Resize window to desktop size
22
     *
23
     * @param DriverInterface $driver
24
     */
25
    public function resizeToDesktopWindow(DriverInterface $driver)
26
    {
27
        $driver->resizeWindow($this->desktopWidth, $this->desktopHeight);
28
    }
29
30
    /**
31
     * Resize window to mobile size
32
     *
33
     * @param DriverInterface $driver
34
     */
35
    public function resizeToMobileWindow(DriverInterface $driver)
36
    {
37
        $driver->resizeWindow($this->desktopWidth, $this->desktopHeight);
38
    }
39
}
40