Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeline slider test #405

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions ui-tests/tests/timeline-slider.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

import { expect, test } from '@jupyterlab/galata';
import { Page } from '@playwright/test';

async function capturePageErrors(page: Page) {
const pageErrors: string[] = [];
page.on('pageerror', (error) => pageErrors.push(error.message));
return pageErrors;
}

async function openNotebook(page: Page, notebookPath: string) {
await page.click('text=File');
await page.click('.lm-Menu-itemLabel:text("Open from Path…")');
await page.fill(
'input[placeholder="/path/relative/to/jlab/root"]',
notebookPath
);
await page.click('.jp-Dialog-buttonLabel:text("Open")');
await page.waitForSelector('.jp-Notebook', { state: 'visible' });
}

test.describe('Open from Path', () => {

test('should fail if there are console errors', async ({ page, tmpPath }) => {
const pageErrors = await capturePageErrors(page);

await page.notebook.createNew();
await page.notebook.save();
await page.notebook.close();

await openNotebook(page, `${tmpPath}/Untitled.ipynb`);

expect(pageErrors).toHaveLength(0);

Check failure on line 37 in ui-tests/tests/timeline-slider.spec.ts

View workflow job for this annotation

GitHub Actions / ui_tests

tests/timeline-slider.spec.ts:28:7 › Open from Path › should fail if there are console errors

1) tests/timeline-slider.spec.ts:28:7 › Open from Path › should fail if there are console errors ─ Error: expect(received).toHaveLength(expected) Expected length: 0 Received length: 1 Received array: ["Cannot read properties of undefined (reading 'split')"] 35 | await openNotebook(page, `${tmpPath}/Untitled.ipynb`); 36 | > 37 | expect(pageErrors).toHaveLength(0); | ^ 38 | }); 39 | }); 40 | at /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/tests/timeline-slider.spec.ts:37:24
});
});
Loading