Sort testcases into CSP directives and use mutation observers to catch all future changes to the DOM.