Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qaf-tm/qaf-support-galen

Galen framework support library for automated testing of look and feel for your responsive websites
https://github.com/qaf-tm/qaf-support-galen

bdd galen qaf selenium-webdriver test-automation testng ui-testing

Last synced: about 10 hours ago
JSON representation

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

Awesome Lists containing this project

README

        

[![License](https://img.shields.io/github/license/qmetry/qaf-support-galen.svg)](http://www.opensource.org/licenses/mit-license.php)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.qmetry/qaf-support-galen/badge.svg)](https://mvnrepository.com/artifact/com.qmetry/qaf-support-galen/latest)
[![GitHub tag](https://img.shields.io/github/tag/qmetry/qaf-support-galen.svg)](https://github.com/qmetry/qaf-support-galen/tags)
[![javadoc](https://javadoc.io/badge2/com.qmetry/qaf-support-galen/javadoc.svg)](https://javadoc.io/doc/com.qmetry/qaf-support-galen)
# 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](/src/com/qmetry/qaf/automation/support/galen/UiValidationUtils.java) for automated testing of look and feel validation for responsive websites using [galen specs](http://galenframework.com/docs/reference-galen-spec-language-guide/).

## 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:
- Add [qaf-support-galen dependecy](https://mvnrepository.com/artifact/com.qmetry/qaf-support-galen/latest) to your project.
- Create [layout specification](http://galenframework.com/docs/reference-galen-spec-language-guide/)
- Call approprivate [utility method](/src/com/qmetry/qaf/automation/support/galen/UiValidationUtils.java)

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