Advertisement
Guest User

Untitled

a guest
Dec 11th, 2013
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  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.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement