示例#1
0
 /**
  * @group curl_opts
  * @group actionchains
  */
 public function testActionChangeWithArgs()
 {
     $this->session = self::$driver->session();
     // firefox
     $this->session->open("https://github.com/element-34/php-webdriver");
     $ac = new \PHPWebDriver_WebDriverActionChains($this->session);
     $ac->moveToElement($this->session->element("css selector", ".watch-button a.minibutton"), array(CURLOPT_VERBOSE => true));
     $ac->perform();
     sleep(4);
 }
 /**
  * @group doubleclick
  */
 public function testDoubleClick()
 {
     $this->session = self::$driver->session();
     $this->session->open("http://api.jquery.com/dblclick/");
     // switch to our frame
     $iframe = $this->session->element(PHPWebDriver_WebDriverBy::CSS_SELECTOR, "iframe");
     $this->session->moveto(array("element" => $iframe->getID()));
     $this->session->switch_to_frame($iframe);
     // masure sure that things are in the state we want
     $e = $this->session->element(PHPWebDriver_WebDriverBy::CSS_SELECTOR, "div");
     $clazz = $e->attribute('class');
     $this->assertEquals(null, $clazz);
     $ac = new PHPWebDriver_WebDriverActionChains($this->session);
     $ac->doubleClick($this->session->element(PHPWebDriver_WebDriverBy::CSS_SELECTOR, "div"));
     $ac->perform();
     $e = $this->session->element(PHPWebDriver_WebDriverBy::CSS_SELECTOR, "div");
     $clazz = $e->attribute('class');
     $this->assertEquals('dbl', $clazz);
     $this->session->switch_to_frame();
 }
 public function __construct($session)
 {
     parent::__construct($session);
 }