vinoth selvaraj created ARQGRA-492:
--------------------------------------
Summary: Integrate RushEye with Graphene for automated visual validation
Key: ARQGRA-492
URL:
https://issues.jboss.org/browse/ARQGRA-492
Project: Arquillian Graphene
Issue Type: Feature Request
Reporter: vinoth selvaraj
I have provided a sample use case of a Page Object.
Graphene along with RushEye can compare the whole page or or just specific element (we can
get the coordinates of an element - get the corresponding image from the whole image)
{code:java}
@RushEye(pattern="/resources/login.png")
public class LoginPage{
@FindBy
private WebElement username;
@FindBy
private WebElement password;
@FindBy
private WebElement someDynamicContentElement;
@ArquillianResource
private ImageComparator imageComparator;
@RushEye(pattern="/resources/login/someElementWhichShouldMatchImge.png")
@FindBy
private WebElement someElementWhichShouldMatchImge;
//takes the screenshot of the current page on the fly
//compares with baseline & returns the status
//it can even highlight the difference in case of mismatch
public boolean isPageAsExpected(){
return imageComparator.compare();
}
//we might want to exclude some elements
//it might have dynamic content like current date/time etc
public boolean isPageAsExpectedAfterExcludingElements(){
return imageComparator.mask(someDynamicContentElement)
.mask(someOtherElement1)
.mask(someOtherElement2)
.compare();
}
//in some case we might not want to do whole page compare
//ex: it might have tons of adds
//So we might want to just compare one or more elements - not whole page
public boolean isSomeElementAsExpected(){
//take current coordinates of the element and get the image
//compare with baseline
return imageComparator.element(someElementWhichShouldMatchImge) //or list of elements
.compare();
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)