Skip to content

Latest commit

 

History

History
 
 

blogs__codepen-demo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Codepen.io Testing Demo

Warning: no longer working

Warning ⚠️ Codepen.io has added a CAPTCHA to prevent scrapers and 3rd party tools from accessing the hosted web apps. The testing approach shown in this blog post no longer works, but we will keep it here for reference.

Demo of E2E testing HyperApp.js counter app running on Codepen.io.

  • Load Codepen and get around iframe security restrictions.
  • Use cy.request() to load a document into test iframe.
  • Test HyperApp.js application through the DOM and through actions.

Blog Post

Testing apps hosted on Codepen.io

E2E tests against Codepen.io

Codepen https://codepen.io/bahmutov/pen/ZaMxgz

note: before the better lifecycle events land you need to wrap your application code on Codepen in IIFE

(function() {
  const { h, app } = hyperapp;
  /** @jsx h */
  ...
}())