3 namespace Zumba\GastonJS\Tests;
5 use Zumba\GastonJS\Browser\Browser;
8 * Class BrowserCommandsTestCase
9 * @package Zumba\GastonJS\Tests
11 class BrowserCommandsTestCase extends \PHPUnit_Framework_TestCase {
13 const LOCAL_SERVER_HOSTNAME = "127.0.0.1";
14 const LOCAL_SERVER_PORT = 6789;
19 protected $testPageBaseUrl;
21 protected function setUp() {
22 $this->browser = new Browser("http://127.0.0.1:8510/");
23 $this->browser->reset();
24 $this->testPageBaseUrl = sprintf("http://%s:%d", BrowserCommandsTestCase::LOCAL_SERVER_HOSTNAME, BrowserCommandsTestCase::LOCAL_SERVER_PORT);
28 * Helper to visit a specific url
31 protected function visitUrl($url) {
32 $this->assertNotEmpty($url);
33 $cmdResponse = $this->browser->visit($url);
34 $this->assertTrue(is_array($cmdResponse), true);
35 $this->assertEquals("success", $cmdResponse["status"]);
41 public function getTestPageBaseUrl() {
42 return $this->testPageBaseUrl;