Tests can be performed over console messages as well as UIs.
For example, here is a test against console messages to check an extension is installed:
import { expect, test } from '@jupyterlab/galata';
/**
* Don't load JupyterLab webpage before running the tests.
* This is required to ensure we capture all log messages.
*/
test.use({ autoGoto: false });
test('should emit an activation console message', async ({ page }) => {
const logs: string[] = [];
page.on('console', message => {
logs.push(message.text());
});
await page.goto();
expect(
logs.filter(s => s === 'JupyterLab extension URDF is activated!')
).toHaveLength(1);
});
In the case of the empinken extension, we should also be able to write tests that check that eg whether a tagged cell has appropriate style tags applied to it.
JupyterLab supports testing helpers for use with
playwright
in the form of https://github.com/jupyterlab/jupyterlab/tree/master/galataTests can be performed over console messages as well as UIs.
For example, here is a test against console messages to check an extension is installed:
In the case of the empinken extension, we should also be able to write tests that check that eg whether a tagged cell has appropriate style tags applied to it.