3 namespace Zumba\GastonJS\Browser;
6 * Class BrowserWindowTrait
7 * @package Zumba\GastonJS\Browser
9 trait BrowserWindowTrait {
11 * Returns the current window handle name in the browser
15 public function windowHandle($name = null) {
16 return $this->command('window_handle', $name);
20 * Returns all the window handles present in the browser
23 public function windowHandles() {
24 return $this->command('window_handles');
28 * Change the browser focus to another window
29 * @param $windowHandleName
32 public function switchToWindow($windowHandleName) {
33 return $this->command('switch_to_window', $windowHandleName);
37 * Opens a new window on the browser
40 public function openNewWindow() {
41 return $this->command('open_new_window');
45 * Closes a window on the browser by a given handler name
46 * @param $windowHandleName
49 public function closeWindow($windowHandleName) {
50 return $this->command('close_window', $windowHandleName);
54 * Gets the current request window name
56 * @throws \Zumba\GastonJS\Exception\BrowserError
59 public function windowName() {
60 return $this->command('window_name');
64 * Zoom factor for a web page
68 public function setZoomFactor($zoomFactor) {
69 return $this->command('set_zoom_factor', $zoomFactor);
73 * Gets the window size
74 * @param $windowHandleName
77 public function windowSize($windowHandleName) {
78 return $this->command('window_size', $windowHandleName);