Skip to content

Galen framework support library for automated testing of look and feel for your responsive websites

License

Notifications You must be signed in to change notification settings

qmetry/qaf-support-galen

Repository files navigation

License Maven Central GitHub tag javadoc

qaf-support-galen

Galen framework support library for automated testing of look and feel for your responsive websites

Features:

  • 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.

Methods:

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=list of tags to be included from specification (default is desktop)
  • layoutvalidation.<platform>.screensize= (default is browser maximized)
Example:
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.&ltplatform>.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

Usage:

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}'