1 5 package org.exoplatform.test.web.validator; 6 7 import org.exoplatform.test.web.ExoWebClient; 8 import com.meterware.httpunit.*; 9 15 public class ExpectImageWithAltTextValidator implements Validator { 16 private String text_ ; 17 18 public ExpectImageWithAltTextValidator(String text) { 19 text_ = text ; 20 } 21 22 public boolean validate(WebResponse response, ExoWebClient client) throws Exception { 23 Object image = response.getImageWithAltText(text_) ; 24 return image != null ; 25 } 26 27 public String getName() { return "ExpectImageWithAltTextValidator" ; } 28 29 public String getDescription() { 30 return "Make sure that the return xhtml has the image with alt text '" + text_ + "'" ; 31 } 32 } | Popular Tags |