Skip to content

Commit

Permalink
added ui test that passes with PR but fails without it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Meriem-BenIsmail committed Nov 19, 2024
1 parent 1f4ad46 commit 7b44441
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions ui-tests/tests/timeline-slider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
import { expect, test } from '@jupyterlab/galata';
import { Page } from '@playwright/test';

test.describe('Timeline Slider', () => {

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' });
}
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);
Expand Down

0 comments on commit 7b44441

Please sign in to comment.