Example #1
0
 /**
  * Wait until page title exactly matches given string
  *
  * @param string $title The expected title, which must be an exact match.
  * @return \RemoteWebElement|array
  */
 public function waitForTitle($title)
 {
     return $this->wd->wait()->until(\WebDriverExpectedCondition::titleIs($title));
 }
 public function testBuildUpload()
 {
     $this->driver->get('http://localhost:80/builds/upload.php');
     $status = $this->driver->findElement(WebDriverBy::id("uploadStatus"));
     $this->assertContains("Upload a Build", $status->getText());
     $buildname = $this->driver->findElement(WebDriverBy::id("buildname"));
     $buildname->sendKeys("asdf");
     $filename = $this->driver->findElement(WebDriverBy::id("filename"));
     $filename->sendKeys("gioeunfa");
     $description = $this->driver->findElement(WebDriverBy::id("description"));
     $description->sendKeys("ghaseguiahgkareguhlgiuwf");
     $this->assertEquals("gioeunfa.bls", $filename->getAttribute("value"));
     $filename->sendKeys(KEYS::ENTER);
     $this->driver->wait(5, 250)->until(WebDriverExpectedCondition::textToBePresentInElement(WebDriverBy::id("uploadStatus"), "No file was selected to be uploaded"));
     $this->assertContains("No file was selected to be uploaded", $status->getText());
     $file = $this->driver->findElement(WebDriverBy::id("uploadfile"));
     $file->sendKeys(dirname(__DIR__) . "/res/some ramps.bls");
     $filename->sendKeys(KEYS::ENTER);
     $this->driver->wait(5, 250)->until(WebDriverExpectedCondition::not(WebDriverExpectedCondition::titleIs("Build Upload")));
 }