Skip to content

Commit

Permalink
Add close command for a window (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpott authored Jul 17, 2024
1 parent 40762a7 commit b686c5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/WebDriver/LegacyWindow.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,16 @@ public function getHandle()

return $this->windowHandle;
}

/**
* Close window: /session/:sessionId/window (DELETE)
*
* @return mixed
*/
public function close()
{
$result = $this->curl('DELETE', '');

return $result['value'];
}
}
12 changes: 12 additions & 0 deletions lib/WebDriver/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,16 @@ public function getHandle()

return $this->windowHandle;
}

/**
* Close window: /session/:sessionId/window (DELETE)
*
* @return mixed
*/
public function close()
{
$result = $this->curl('DELETE', '');

return $result['value'];
}
}

0 comments on commit b686c5f

Please sign in to comment.