Skip to content

Instantly share code, notes, and snippets.

@jverdeyen
Created January 27, 2015 07:16
Show Gist options
  • Save jverdeyen/1cc07b47950c245f5fd9 to your computer and use it in GitHub Desktop.
Save jverdeyen/1cc07b47950c245f5fd9 to your computer and use it in GitHub Desktop.
Robo: Starting WebDriver in Docker container, starting PHP server, running acceptance tests
<?php
public function testWebdriver($args = '', $opt = ['test|t' => null])
{
$test = $opt['test'] ? ':'.$opt['test'] : '';
$container = $this->taskDockerRun('davert/selenium-env')
->detached()
->publish(4444,4444)
->env('APP_PORT', 8000)
->run();
$this->taskServer(8000)
->dir('tests/data/app')
->background()
->host('0.0.0.0')
->run();
sleep(3); // wait for selenium to launch
$this->taskCodecept('./codecept')
->test('tests/unit/Codeception/Module/WebDriverTest.php'.$test)
->args($args)
->run();
$this->taskDockerStop($container)->run();
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment