Skip to content

Commit b686c5f

Browse files
authored
Add close command for a window (#14)
1 parent 40762a7 commit b686c5f

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

lib/WebDriver/LegacyWindow.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,16 @@ public function getHandle()
8282

8383
return $this->windowHandle;
8484
}
85+
86+
/**
87+
* Close window: /session/:sessionId/window (DELETE)
88+
*
89+
* @return mixed
90+
*/
91+
public function close()
92+
{
93+
$result = $this->curl('DELETE', '');
94+
95+
return $result['value'];
96+
}
8597
}

lib/WebDriver/Window.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,16 @@ public function getHandle()
9393

9494
return $this->windowHandle;
9595
}
96+
97+
/**
98+
* Close window: /session/:sessionId/window (DELETE)
99+
*
100+
* @return mixed
101+
*/
102+
public function close()
103+
{
104+
$result = $this->curl('DELETE', '');
105+
106+
return $result['value'];
107+
}
96108
}

0 commit comments

Comments
 (0)