Skip to content

Usage with Web Component Tester

Ryan Leonard edited this page Jan 18, 2017 · 2 revisions

Web Component Tester (WCT) is a simple utility that tests Polymer elements. It ships with a Selenium server, with built-in support for tests written using Mocha, as well as several other components.

WCT ships with plugins to test code locally and through SauceLabs (plugin), which allows testing in SauceLabs cloud of operating systems and browsers.

Instead of using SauceLabs, Aragonite can be used to create a comparable environment in a self-hosted environment.

❗ This document currently outlines the methodology of Aragonite, including components that have not been fully developed. Once Aragonite is stable, technical instructions and details will be added.

1. Setting up the Aragonite Server

As a self-hosted solution, Aragonite needs it's own server. A physical machine could be used for an on-premise system, or cloud providers such as DigitalOcean or Google Compute Engine could provide a more on-demand solution.

The machine needs to have Aragonite installed, as well as VirtualBox to run different operating systems.

Linux virtual machines are simple to create, and Microsoft provides free virtual machine images to test Internet Explorer and Edge.

However, OSX has a restrictive license agreement. According to SauceLabs's Blog, the license agreement allows running OSX virtual machines, as long as you are running on Apple hardware. Aragonite could be installed on Apple hardware (new or used) to provide testing in Safari and other browsers in OSX virtual machines.

Please note this is not legal advise, and license agreements for Windows and OSX should be evaluated before installing Aragonite.

2. Creating Virtual Machine Snapshots

For each operating system environment, a VirtualBox virtual machine needs to be created.

The web browsers need to be installed, as well as [NodeJS][] to install and run the code. WCT and/or Selenium need Java installed, and some [NPM][] packages need Git, GCC, Python, and similar tools.

To quickly integrate with the Aragonite server, aragonite-runner can be installed to easily run shell commands to launch tests, and then parse the output to determine success and failure statistics.

On Windows, disabling the built-in firewall can prevent Node from being interrupted when it attempts to start a web server.

Once all the dependencies have been installed and the machine configured, a VirtualBox snapshot can be taken, creating a clean restore point to remove artifacts between tests.

3. CI Setup

If GitLab CI or Travis CI are being used, aragonite-ci-runner can connect to one or more Aragonite servers, and start tests running.

For Aragonite servers in the cloud, CI could start an Aragonite machine, only running it on demand to prevent any extra costs of running the server when it isn't being used.

Clone this wiki locally