Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 1.17 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package com.blogspot.vardlokkur.pages;
  2.  
  3. import net.thucydides.core.annotations.At;
  4. import net.thucydides.core.annotations.DefaultUrl;
  5. import net.thucydides.core.pages.PageObject;
  6.  
  7. import org.openqa.selenium.By;
  8. import org.openqa.selenium.WebDriver;
  9.  
  10. /**
  11.  * Reflects results page functionality.
  12.  *
  13.  * @author warlock
  14.  */
  15. @At("#HOST/find.*")
  16. @DefaultUrl("http://www.imdb.com/find.*")
  17. public class ResultsPage extends PageObject {
  18.  
  19.     /**
  20.      * @see PageObject#PageObject(WebDriver)
  21.      */
  22.     public ResultsPage(final WebDriver driver) {
  23.         super(driver);
  24.     }
  25.  
  26.     /**
  27.      * @see PageObject#PageObject(WebDriver, int)
  28.      */
  29.     public ResultsPage(final WebDriver driver, final int ajaxTimeout) {
  30.         super(driver, ajaxTimeout);
  31.     }
  32.  
  33.     /**
  34.      * Verifies if there is at least one result for given query string.
  35.      *
  36.      * @param queryString query string
  37.      */
  38.     public void containsAtLeastOneResult(final String queryString) {
  39.         shouldBeVisible(By
  40.                         .xpath("//table//a[contains(translate(text(), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), '"
  41.                                         + queryString.toUpperCase() + "')]"));
  42.     }
  43.  
  44. }