/**
  * Set session meta-info for "Sauce Labs".
  *
  * @return void
  */
 protected function setUp()
 {
     if (!getenv('SAUCE_USERNAME') || !getenv('SAUCE_ACCESS_KEY')) {
         $this->markTestSkipped('SauceLabs integration is not configured');
     }
     parent::setUp();
 }
 protected function setUp()
 {
     // To create regular browser configuration via BrowserConfigurationFactory.
     $browser = $this->createBrowserConfiguration(array());
     // To create "Sauce Labs" browser configuration via BrowserConfigurationFactory.
     $browser = $this->createBrowserConfiguration(array('type' => 'saucelabs', 'api_username' => 'sauce_username', 'api_key' => 'sauce_api_key'));
     // Options can be changed later (optional).
     $browser->setHost('selenium_host')->setPort('selenium_port')->setTimeout(30);
     $browser->setBrowserName('browser name')->setDesiredCapabilities(array('version' => '6.5'));
     $browser->setBaseUrl('http://www.test-host.com');
     // Set browser configuration to test case.
     $this->setBrowser($browser);
     parent::setUp();
 }
예제 #3
0
 /**
  * Creating browser configuration that would listen for events.
  *
  * @return void
  */
 protected function setUp()
 {
     $api_client = m::mock('aik099\\PHPUnit\\APIClient\\IAPIClient');
     $api_client->shouldReceive('updateStatus')->withAnyArgs()->once();
     /** @var IBrowserConfigurationFactory $factory */
     $factory = m::mock('aik099\\PHPUnit\\BrowserConfiguration\\IBrowserConfigurationFactory');
     $factory->shouldReceive('createAPIClient')->once()->andReturn($api_client);
     $browser_config = array('api_username' => 'a', 'api_key' => 'b');
     $browser = new SauceLabsBrowserConfiguration($this->readAttribute($this, '_eventDispatcher'), $factory);
     $factory->shouldReceive('createBrowserConfiguration')->with($browser_config, $this)->once()->andReturn($browser);
     $this->setBrowserConfigurationFactory($factory);
     $this->setBrowserFromConfiguration($browser_config);
     parent::setUp();
 }
예제 #4
0
 /**
  * Creating browser configuration that would listen for events.
  *
  * @return void
  */
 protected function setUp()
 {
     $api_client = m::mock('aik099\\PHPUnit\\APIClient\\IAPIClient');
     $api_client->shouldReceive('updateStatus')->withAnyArgs()->once();
     /** @var IBrowserConfigurationFactory $factory */
     $factory = m::mock('aik099\\PHPUnit\\BrowserConfiguration\\IBrowserConfigurationFactory');
     $browser_config = array('apiUsername' => 'a', 'apiKey' => 'b');
     $browser = m::mock('aik099\\PHPUnit\\BrowserConfiguration\\SauceLabsBrowserConfiguration[getAPIClient]', array($this->readAttribute($this, '_eventDispatcher'), $this->createDriverFactoryRegistry()));
     // These magic methods can't be properly passed through to mocked object otherwise.
     $browser->shouldReceive('getSessionStrategy')->andReturn('isolated');
     $browser->shouldReceive('getDesiredCapabilities')->andReturn(array(SauceLabsBrowserConfiguration::NAME_CAPABILITY => 'something'));
     $browser->shouldReceive('getAPIClient')->once()->andReturn($api_client);
     $factory->shouldReceive('createBrowserConfiguration')->with($browser_config, $this)->once()->andReturn($browser);
     $this->setBrowserConfigurationFactory($factory);
     $this->setBrowserFromConfiguration($browser_config);
     parent::setUp();
 }
 protected function setUp()
 {
     $this->pageFactory = $this->createPageFactory();
     parent::setUp();
 }