refactor e2e test to be runnable from npm run-script