예제 #1
0
 public function testTabsFrameworkLoads()
 {
     $this->webDriver->get($this->url . '?test_name=statistics');
     try {
         // If this is the mobile view, we need to expand the dropdown
         // before the stats links are visible.
         $expand = $this->webDriver->findElement(WebDriverBy::ID("down"));
         $expand->click();
     } catch (ElementNotVisibleException $e) {
         // Using the desktop version, so the mobile link isn't visible and
         // doesn't need to be clicked.
     }
     // Ensure that Demographic Statistics link is there. There's nothing special
     // about Demographics, it's just a randomly chosen default tab to ensure that
     // something shows up. Ideally, this should loop through the StatisticsTabs
     // table and ensure that they all appear.
     try {
         $link = $this->webDriver->findElement(WebDriverBy::PartialLinkText("Demographic Statistics"));
         $this->assertContains("Demographic", $link->getText());
     } catch (NoSuchElementException $e) {
         print $this->webDriver->getPageSource();
         $this->fail("Could not find demographic tab link");
     }
 }
예제 #2
0
 /**
  * Tests Clear Form function in resolved conflicts
  * author: Wang Shen
  *
  * @return void
  */
 function testClearFormResolvedConflicts()
 {
     $this->safeGet($this->url . "/conflict_resolver/?submenu=resolved_conflicts");
     $keywordElement = $this->webDriver->findElement(WebDriverBy::Name("Question"));
     $keywordElement->sendkeys('TestTestTest');
     //click clear form button
     $this->webDriver->findElement(WebDriverBy::ID("testClearForm1"))->click();
     $bodyText = $this->webDriver->findElement(WebDriverBy::Name("Question"))->getText();
     $this->assertNotContains("TestTestTest", $bodyText);
 }