Test Mobile Devices with Chrome Devtools – Howto

Press F12 or just open Chrome Dev Tools.
Click on the Toggle Device Icon (marked in blue).

In your browser window, you will see this resolution modifyier:

Modify according to your needs to test different screen resolutions.

NOTE: Screen Resolution CANNOT be simulated by changing the browser window size 😉

Multiple Webapps with Docker Compose

  • Learn how to setup a custom network for your containers: container A talks to container B
  • Learn how to run multiple webapps inside Docker containers on different ports with Docker Compose

Download complete source code here

  • Create the network with $docker network create skynet
  • Run with $docker-compose up
  • Stop with $<Ctrl + C>
  • Clean up from time to time (beware, network will be deleted as well) with $docker system prune -a -f
  • access via http://localhost:8080/sample
  • access via http://localhost:8081/sample

Helper functions in JavaScript / JS – use lodash

For instance in my JS Applications I do often need some helper functions, like I know them from Java, like #equals etc..

lodash provide an elegant suite of helper tools.
For instance in my React App, I do

import _ from "lodash";

And I can use their functions, like in this example:

if (_.isEmpty(this.myFooAttribute)) {...

Of course you need lodash as a dependency.
In your package.json do:

 "dependencies": {
     ...
    //version is an example. I always try to use the latest.
    "lodash": "^4.17.15", 

How to test Websites with Java

A very good way of testing a website is Selenium: http://seleniumhq.org/
The Groovy driven alternative is Tellurium which provides an easier entry but is not as good as Selenium for more complex Use Cases: http://code.google.com/p/aost/

Code driven (JUnit-like):

  • Java Tests for Selenium
  • Selenium will start to interact with your WebBrowser, as guided by the Tests.
  • Bears strong resemblance to normal UNIT Tests

Browser-driven:

  • Create a Selenium Test Suite by recording your clicks and website navigation in your browser.
  • Replay in your browser