Exemplo n.º 1
0
 /**
  * Helper to visit a specific url
  * @param string $url
  */
 protected function visitUrl($url)
 {
     $this->assertNotEmpty($url);
     $cmdResponse = $this->browser->visit($url);
     $this->assertTrue(is_array($cmdResponse), true);
     $this->assertEquals("success", $cmdResponse["status"]);
 }
Exemplo n.º 2
0
 /**
  * Helper to find a node element given an xpath
  * @param string $xpath
  * @param int    $max
  * @returns int
  * @throws DriverException
  */
 protected function findElement($xpath, $max = 1)
 {
     $elements = $this->browser->find("xpath", $xpath);
     if (!isset($elements["page_id"]) || !isset($elements["ids"]) || count($elements["ids"]) !== $max) {
         throw new DriverException("Failed to get elements with given {$xpath}");
     }
     return $elements;
 }