Galen framework support library for automated testing of look and feel for your responsive websites
- Ease of use
- detailed reporting
- Fail/Success element screen shot
- Multiple web platforms ui layout validation support
- CSS and broken image validataion
This library provides utility methods for automated testing of look and feel validation for responsive websites using galen specs.
Method | Description |
---|---|
checkLayout(String specPath) | Checks layout of the page that is currently open in current thread. Takes driver from QAFTestBase This method uses following properties:
layoutvalidation.platforms=desktop;tablet layoutvalidation.tablet.screensize={'width':800,'height':750} |
checkLayout(String specPath, String... platforms) | Checks layout of the page that is currently open in current thread for given platforms. This method uses layoutvalidation.<platform>.screensize property. For example, platform provided in argument are tablet and desktop than it will look for layoutvalidation.tablet.screensize property for tablet and layoutvalidation.desktop.screensize property for desktop |
verifyImagesNotBroken | verifies images provided usig <img> tag on the page are not broken |
- Add qaf-support-galen dependecy to your project.
- Create layout specification
- Call approprivate utility method
import static com.qmetry.qaf.automation.support.galen.UiValidationUtils.checkLayout;
@Test
public void validateOroductFaqPageLayout() throws IOException {
getDriver().get("/ww/en/Categories/Products/PRD-101#tab-faqs");
checkLayout("resources/ui-specs/item-support-tab.spec");
}
BDD
When get '/ww/en/Categories/Products/PRD-101#tab-faqs'
Then check layout using 'resources/ui-specs/item-support-tab.spec'
Data-driven example:
recId | specs | url |
---|---|---|
products faq tab | resources/ui-specs/item-support-tab.spec | /ww/en/Categories/Products/PRD-101#tab-faqs |
products accessories tab | resources/ui-specs/pdp-page.spec | /ww/en/Categories/Products/PRD-101#tab-accessories |
@QAFDataProvider(dataFile = "resources/data/testdata.csv")
@Test
public void validateProductPageLayout(Map<String, Object> data) throws IOException {
getDriver().get((String) data.get("url"));
checkLayout((String) data.get("specs"));
}
BDD
@dataFile:resources/data/testdata.csv
Scenario: Validate ProductPage Layout
When get '${url}'
Then check layout using '${specs}'