Overview

Namespaces

  • Peridot
    • WebDriverManager
      • Binary
        • Decompression
        • Request
      • Console
      • Event
      • OS
      • Process
      • Test
  • PHP

Classes

  • AbstractManagerCommand
  • CleanCommand
  • StartCommand
  • StatusCommand
  • UpdateCommand
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Peridot\WebDriverManager\Console;
 3: 
 4: use Symfony\Component\Console\Input\ArrayInput;
 5: use Symfony\Component\Console\Input\InputArgument;
 6: use Symfony\Component\Console\Input\InputInterface;
 7: use Symfony\Component\Console\Output\OutputInterface;
 8: 
 9: /**
10:  * StartCommand is used to start Selenium Server in the foreground. If drivers and binaries
11:  * are not up to date, the start command will update before starting.
12:  *
13:  * @package Peridot\WebDriverManager\Console
14:  */
15: class StartCommand extends AbstractManagerCommand
16: {
17:     protected function configure()
18:     {
19:         $this
20:             ->setName('start')
21:             ->setDescription('Start Selenium Server')
22:             ->addArgument(
23:                 'port',
24:                 InputArgument::OPTIONAL,
25:                 'The port you want to start Selenium Server on'
26:             );
27:     }
28: 
29:     /**
30:      * @param InputInterface $input
31:      * @param OutputInterface $output
32:      * @return int|null
33:      */
34:     protected function execute(InputInterface $input, OutputInterface $output)
35:     {
36:         $port = $input->getArgument('port');
37:         if (! $port) {
38:             $port = 4444;
39:         }
40: 
41:         $update = $this->getApplication()->find('update');
42:         $update->run(new ArrayInput(['command' => 'update']), $output);
43: 
44:         $output->writeln('<info>Starting Selenium Server...</info>');
45:         $this->manager->startInForeground($port);
46:         return 0;
47:     }
48: } 
49: 
WebDriver Manager API documentation generated by ApiGen