Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for sending Chrome DevTools commands
- Loading branch information
Showing
4 changed files
with
96 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Facebook\WebDriver\Chrome; | ||
|
||
class ChromeDriverCommand | ||
{ | ||
// Chrome DevTools API | ||
const SEND_COMMAND = 'sendCommand'; | ||
const SEND_COMMAND_AND_GET_RESULT = 'sendCommandAndGetResult'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Facebook\WebDriver\Chrome; | ||
|
||
use Facebook\WebDriver\Remote\Service\DriverCommandExecutor; | ||
use Facebook\WebDriver\Remote\Service\DriverService; | ||
|
||
class ChromeDriverCommandExecutor extends DriverCommandExecutor | ||
{ | ||
public function __construct(DriverService $service) | ||
{ | ||
parent::__construct($service); | ||
|
||
self::$commands = array_merge(self::$commands, [ | ||
ChromeDriverCommand::SEND_COMMAND => [ | ||
'method' => 'POST', | ||
'url' => '/session/:sessionId/chromium/send_command', | ||
], | ||
ChromeDriverCommand::SEND_COMMAND_AND_GET_RESULT => [ | ||
'method' => 'POST', | ||
'url' => '/session/:sessionId/chromium/send_command_and_get_result', | ||
], | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters