Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 11th, 2013  |  syntax: PHP  |  size: 1.14 KB  |  views: 48  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class GoogleTest extends \PHPUnit_Extensions_Selenium2TestCase
  2.     {
  3.  
  4.     private static $first = true;
  5.  
  6.     function setUp()
  7.         {
  8.         if (self::$first)
  9.             {
  10.             $this->setBrowser("firefox");
  11.             $this->setBrowserUrl("https://www.google.com/");
  12.             $this->setHost("127.0.0.1");
  13.             $this->setPort(4444);
  14.             $this->shareSession(TRUE);
  15.             $this->prepareSession();
  16.             self::$first = false;
  17.             }
  18.         }
  19.  
  20.     public function onNotSuccessfulTest(Exception $e)
  21.         {
  22.         //$this->getStrategy()->notSuccessfulTest();
  23.         throw $e;
  24.         }
  25.  
  26.     function testGoogle()
  27.         {
  28.         $this->url('/');
  29.         $this->assertTrue((bool) true);
  30.         }
  31.  
  32.     function testGoogle2()
  33.         {
  34.         $this->url('/');
  35.         $this->assertFalse((bool) true); // fail
  36.         }
  37.  
  38.     function testGoogle3()
  39.         {
  40.         $this->url('/');
  41.         $this->byId("not_exists")->click(); // error
  42.         }
  43.  
  44.     function testGoogle4()
  45.         {
  46.         $this->url('/');
  47.         $this->assertTrue((bool) true);
  48.         }
  49.  
  50.     }
clone this paste RAW Paste Data