Open
Description
The idea is to have an automated test, that would go through vue-book and check there are no errors on any of the pages. This is meant as a relatively low effort test, as it's a singular effort that will require very little support in the future.
We might not keep this test in CI and run it before release for now.
- We have e2e folder with cypress attached, that might be a good point to start.
- Ideally we want that to be done in context of circleci (delegate that or move to another task if too big for one task).
- Documenting our e2e approach in notion would be a great boon as well.
Here's implementation from different project, we might be able to reuse it (done for playwright, but should be similar enough for cypress):
const browser = await create_spec_browser();
const context = await browser.newContext();
const page = await context.newPage();
page.setViewportSize(default_viewport);
await page.goto(book_endpoint)
let errorCount = 0
let currentDemo = ''
page.on('console', msg => {
if (msg.type() === 'error') {
console.error(`${currentDemo}: ${msg.text()}`)
errorCount++
}
})
const files = await page.$$('.BookComponentListItem')
for (const index in files ) {
await files[index].click()
currentDemo = await files[index].textContent()
await sleep(500)
}
expect(errorCount).toBe(0)
await sleep(5000)