Ghost Inspector

https://ghostinspector.com

Presented by:

Headless Browsers & Testing at Scale

Who am I? 👋

  • Justin Klemm
  • Founder of Ghost Inspector
  • 4+ year old browser testing service
  • Headless, Parallel, 250k tests / day
  • Active in technical support... 😬
  1. Headless Browsers
  2. Testing at Scale (in Parallel)
  3. Ghost Inspector Demo

Headless Browsers & Testing at Scale

"Traditional" Browser Testing

Chrome "Traditional" Example

Enter "Headless" Browsers

  • Browser that can run without display requirement (i.e. in a CLI)
  • PhantomJS (Webkit engine)

Modern Headless Browsers

  • Chrome & Firefox
  • More in the future? Maybe.

Chrome Headless Example

chrome --headless --disable-gpu https://www.google.com

Headless Advantages

  • Lightweight; More performant
  • No display (desktop or xvfb) requirement
  • Run from CLI; Run in containers
  • Easier CI integration
  • Cheaper

Headless Disadvantages

  • Not all browsers support it (yet?)
  • Initial rendering quirks (mostly resolved)
  • Occasional edge-case stuff (ex: unsigned SSL certificates)
  • Not ideal for manual inspection

Automation APIs & Tools

​All the same APIs still work.

  • WebDriver/Selenium
  • Puppeteer (Chrome)
  • SlimerJS (Firefox)
  • Others: Ghost Inspector (code-less, managed), *lots* of other packages and services

Choosing Automation Tools

​There are always trade-offs...

  • WebDriver/Selenium
  • Puppeteer (Chrome)
  • SlimerJS (Firefox)
  • Other stuff: Cypress, Ghost Inspector (code-less, managed), *lots* of others 

Understand your requirements.

Testing at Scale (in Parallel)

  • Previously heavy / expensive
  • Now light / cheap; Docker, Lambda, Fargate, etc.
  • Run 50+ tests concurrently, instead of 1
  • Massive speed / efficiency gains
  • Requires a shift in test design

Parallel Test Design

 Parallel Testing - Best Practices

  • Simple, independent tests are ideal
  • Avoid state conflicts and race conditions
  • Consider setting up and/or throwing away data
  • Dependencies are sometimes required; Separate sequential tests from parallel tests

Why is parallel testing worth it?

  • ​Scale
  • Speed
  • Independent debugging
  • Less brittle

But, don't forget about this...

Demo w/Ghost Inspector

Recap

  • Headless options available in Chrome and Firefox; Easy to use + lightweight
  • Automation APIs + tools have trade-offs
  • Huge efficiency gains when running tests in parallel
  • Design shift when testing in parallel: How do you deal with state?
  • Browser tests have significant maintenance costs; Test smart

Questions?

Ghost Inspector

https://ghostinspector.com

Presented by:

Justin Klemm

@justinklemm