Exemple #1
0
 /**
  * @param  Webdriver                 $driver    Driver for this test.
  * @param  JoomlaWebdriverTestClass  $test      Test class object (needed to create page class objects)
  * @param  string                    $url       Optional URL to load when object is created. Only use for initial page load.
  */
 public function __construct(Webdriver $driver, $test, $url = null)
 {
     $this->driver = $driver;
     $this->test = $test;
     $cfg = new SeleniumConfig();
     $this->cfg = $cfg;
     // save current configuration
     if ($url) {
         $this->driver->get($url);
     }
     $element = $driver->waitForElementUntilIsPresent(By::xPath($this->waitForXpath), 5);
     if (isset($this->url)) {
         $test->assertStringEndsWith($this->url, $driver->getCurrentPageUrl(), 'URL for page does not match expected value.');
     }
 }
Exemple #2
0
 /**
  * constructor function
  *
  * @param   Webdriver                 $driver  Driver for this test.
  * @param   JoomlaWebdriverTestClass  $test    Test class object (needed to create page class objects)
  * @param   string                    $url     Optional URL to load when object is created. Only use for initial page load.
  */
 public function __construct(Webdriver $driver, $test, $url = null)
 {
     $this->driver = $driver;
     /* @var $test JoomlaWebdriverTestCase */
     $this->test = $test;
     $cfg = new SeleniumConfig();
     // Save current configuration
     $this->cfg = $cfg;
     if ($url) {
         $this->driver->get($url);
     }
     $element = $driver->waitForElementUntilIsPresent(By::xPath($this->waitForXpath), 5);
     if (isset($this->url)) {
         $test->assertContains($this->url, $driver->getCurrentPageUrl(), 'URL for page does not match expected value.');
     }
 }