protected function buildProcess(string $fileName, array $phpunitArgs = []): Process
    {
        $capabilities = (new KeyValueCapabilityOptionsParser())
            ->parse($this->input->getOption(RunCommand::OPTION_CAPABILITY));

        $env = [
            'BROWSER_NAME' => $this->input->getArgument(RunCommand::ARGUMENT_BROWSER),
            'ENV' => mb_strtolower($this->input->getArgument(RunCommand::ARGUMENT_ENVIRONMENT)),
            'CAPABILITY' => json_encode($capabilities),
            'CAPABILITIES_RESOLVER' => $this->config[ConfigOptions::CAPABILITIES_RESOLVER],
            'SERVER_URL' => $this->input->getOption(RunCommand::OPTION_SERVER_URL),
            'LOGS_DIR' => $this->config[ConfigOptions::LOGS_DIR],
            'DEBUG' => $this->output->isDebug() ? '1' : '0',
        ];

        $dispatcher = $this->command->getDispatcher();
        $dispatcher->dispatch(
            CommandEvents::RUN_TESTS_PROCESS,
            $processEvent = new RunTestsProcessEvent(
                $this->command,
                $this->input,
                $this->output,
                $env,
                $phpunitArgs
            )
        );

        $phpunitExecutable = realpath(__DIR__ . '/../../bin/phpunit-steward');

        $commandLine = array_merge([PHP_BINARY, $phpunitExecutable], $processEvent->getArgs(), [$fileName]);

        return new Process($commandLine, STEWARD_BASE_DIR, $processEvent->getEnvironmentVars(), null, 3600);
    }