Perform Automated Layout Testing using Galen Framework on BrowserStack.
BrowserStack is a cross-browser testing tool, to test public websites and protected servers, on a cloud infrastructure of desktop and mobile browsers. For more information visit https://www.browserstack.com.
Galen is an open-source tool for testing layout and responsive design of web applications. It is also a powerfull functional testing framework. For more information visit http://galenframework.com.
- For installing Galen on OSX and Linux visit http://galenframework.com/docs/getting-started-install-galen
- For configuring Galen on Windows visit http://mindengine.net/post/2014-01-08-configuring-galen-framework-for-windows
Just a few things you should ensure before running Galen tests on BrowserStack:
- First you need to have an account at BrowserStack (Sign-up). The free trial gets you access to 100 minutes of BrowserStack Automate with 5 parallel runs which should be enough for you to try out your Galen tests.
- Get your Automate
Username
andAccess Key
from here, after you login to your account. - Add these credentials to the test files, to point your tests to BrowserStack's Selenium Hub.
Here are the two kinds of galen tests which you can run on BrowserStack:
Using Galen Specs Language you are able to describe any complex layout including different screen sizes or browsers. It's not only easy to write, it is also easy to read if you are unfamiliar with the language. A list of all capabilities for running tests on various BrowserStack platforms can be found here.
Command to execute the Galen Spec test:
galen test BrowserStackTest.test --parallel-suites 2 -Dbrowserstack.username=<USERNANME> -Dbrowserstack.key=<KEY>
With JavaScript tests you are free to invent your own test framework and perform a lot of complex stuff. You can execute tests against a Galen Spec on a single congiguration or parameterize your test to run it against multiple configurations. You also have the flexibility to write functional tests using which you can interact with the browser elements.
Command to execute the Galen JavaScript test:
galen test BrowserStack.test.js --parallel-suites 2 -Dbrowserstack.username=<USERNANME> -Dbrowserstack.key=<KEY>
Command line arguments (More information here):
- htmlreport - path to folder in which Galen should generate html reports
- testngreport - path to xml file in which Galen should write testng report
- parallel-suites - amount of threads for running tests in parallel
- recursive - flag which is used in case you want to search for all .test files recursively in folder
- filter - a filter for a test name
- Selenium Testing on BrowserStack - https://www.browserstack.com/automate
- Galen Specs Language Guide - http://galenframework.com/docs/reference-galen-spec-language-guide
- Galen JavaScript Test Guide - http://galenframework.com/docs/reference-javascript-tests-guide