a1-test
test html files in one line
Testing web apps is a tedius task. Automate web tests can consume a lot of effort. This package saves precious time by allowing a really easy way to test a set of web pages.
The test will take a folder of html pages as input and it will run a headless chrome on them. If any console.error is captured on the page, the test is failed.
The test can also check external urls, use the depth parameter to browse around related pages. For devs: use https://developers.google.com/web/updates/2017/04/headless-chrome as tutorial and https://chromedevtools.github.io/devtools-protocol as reference
To test all the html files in a local folder:
const test = try const folder = '/home/steven/myApp' // index.html, landing.html, details/index.html ... await test // also test.folder(folder, '/usr/lib/chromium-browser/chromium-browser') assert catch e assert
To test url and related pages, use the url()
. The test will look for related tags, so use a depth parameter to limit the pages to test.
const test = try await test assert catch e assert
For devs:
Fork the github project and customize by following these links: