1 | <?php |
||
15 | class ResponsiveContext extends RawMinkContext { |
||
16 | |||
17 | /** |
||
18 | * Default list of device definitions. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $defaultDevices = [ |
||
23 | 'mobile_portrait' => '360x640', |
||
24 | 'mobile_landscape' => '640x360', |
||
25 | 'tablet_portrait' => '768x1024', |
||
26 | 'tablet_landscape' => '1024x768', |
||
27 | 'laptop' => '1280x800', |
||
28 | 'desktop' => '2560x1440', |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * Contains list of processed devices. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $devices = []; |
||
37 | |||
38 | /** |
||
39 | * ResponsiveContext constructor. |
||
40 | * |
||
41 | * @param array $devices |
||
42 | * List of devices. |
||
43 | */ |
||
44 | public function __construct($devices = []) { |
||
48 | |||
49 | /** |
||
50 | * Get device resolution. |
||
51 | * |
||
52 | * @param string $name |
||
53 | * Device name. |
||
54 | * |
||
55 | * @return \NuvoleWeb\Drupal\DrupalExtension\Component\ResolutionComponent |
||
56 | * Resolution object. |
||
57 | */ |
||
58 | protected function getDeviceResolution($name) { |
||
64 | |||
65 | /** |
||
66 | * Resize browser window according to the specified device. |
||
67 | * |
||
68 | * @param string $device |
||
69 | * Device name as specified in behat.yml. |
||
70 | * |
||
71 | * @Given I view the site on a :device device |
||
72 | */ |
||
73 | public function assertDeviceScreenResize($device) { |
||
77 | |||
78 | /** |
||
79 | * Resize browser window width. |
||
80 | * |
||
81 | * @param string $size |
||
82 | * Size in pixel. |
||
83 | * |
||
84 | * @throws \Behat\Mink\Exception\ExpectationException |
||
85 | * |
||
86 | * @Then the browser window width should be :size |
||
87 | */ |
||
88 | public function assertBrowserWindowWidth($size) { |
||
94 | |||
95 | /** |
||
96 | * Resize browser window height. |
||
97 | * |
||
98 | * @param string $size |
||
99 | * Size in pixel. |
||
100 | * |
||
101 | * @throws \Behat\Mink\Exception\ExpectationException |
||
102 | * |
||
103 | * @Then the browser window height should be :size |
||
104 | */ |
||
105 | public function assertBrowserWindowHeight($size) { |
||
111 | |||
112 | } |
||
113 |