-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5f8e22
commit f000590
Showing
13 changed files
with
42 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-8 Bytes
(100%)
...test/jupyterlab/notebook-edit.test.ts-snapshots/split-cell-jupyterlab-linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,35 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
import { describe, galata, test } from '@jupyterlab/galata'; | ||
import { test } from '@jupyterlab/galata'; | ||
import { expect } from '@playwright/test'; | ||
import * as path from 'path'; | ||
|
||
const fileName = 'markdown_notebook.ipynb'; | ||
|
||
jest.setTimeout(60000); | ||
|
||
describe('Notebook Markdown', () => { | ||
beforeAll(async () => { | ||
await galata.resetUI(); | ||
galata.context.capturePrefix = 'notebook-markdown'; | ||
}); | ||
|
||
afterAll(() => { | ||
galata.context.capturePrefix = ''; | ||
}); | ||
|
||
test('Upload files to JupyterLab', async () => { | ||
await galata.contents.moveFileToServer( | ||
test.describe('Notebook Markdown', () => { | ||
test.beforeEach(async ({ page, tmpPath }) => { | ||
await page.contents.uploadFile( | ||
path.resolve(__dirname, `./notebooks/${fileName}`), | ||
`uploaded/${fileName}` | ||
`${tmpPath}/${fileName}` | ||
); | ||
expect( | ||
await galata.contents.fileExists(`uploaded/${fileName}`) | ||
).toBeTruthy(); | ||
}); | ||
|
||
test('Refresh File Browser', async () => { | ||
await expect(galata.filebrowser.refresh()).resolves.toBeUndefined(); | ||
}); | ||
|
||
test('Open directory uploaded', async () => { | ||
await galata.filebrowser.openDirectory('uploaded'); | ||
expect( | ||
await galata.filebrowser.isFileListedInBrowser(fileName) | ||
).toBeTruthy(); | ||
}); | ||
test('Highlight LaTeX syntax', async ({ page, tmpPath }) => { | ||
await page.notebook.openByPath(`${tmpPath}/${fileName}`); | ||
const imageName = 'highlight-latex.png'; | ||
await page.notebook.enterCellEditingMode(0); | ||
const cell = await page.notebook.getCell(0); | ||
|
||
test('Open Notebook', async () => { | ||
await galata.notebook.open(fileName); | ||
expect(await galata.notebook.isOpen(fileName)).toBeTruthy(); | ||
await galata.notebook.activate(fileName); | ||
expect(await galata.notebook.isActive(fileName)).toBeTruthy(); | ||
expect(await cell.screenshot()).toMatchSnapshot(imageName); | ||
}); | ||
|
||
test('Highlight LaTeX syntax', async () => { | ||
const imageName = 'highlight-latex'; | ||
await galata.notebook.enterCellEditingMode(0); | ||
const cell = await galata.notebook.getCell(0); | ||
await galata.capture.screenshot(imageName, cell); | ||
expect(await galata.capture.compareScreenshot(imageName)).toBe('same'); | ||
}); | ||
test('Do not highlight non-LaTeX syntax', async ({ page, tmpPath }) => { | ||
await page.notebook.openByPath(`${tmpPath}/${fileName}`); | ||
|
||
test('Do not highlight non-LaTeX syntax', async () => { | ||
const imageName = 'do-not-highlight-not-latex'; | ||
await galata.notebook.enterCellEditingMode(1); | ||
const cell = await galata.notebook.getCell(1); | ||
await galata.capture.screenshot(imageName, cell); | ||
expect(await galata.capture.compareScreenshot(imageName)).toBe('same'); | ||
}); | ||
|
||
test('Close Notebook', async () => { | ||
await expect(galata.notebook.activate(fileName)).resolves.toEqual(true); | ||
await expect(galata.notebook.close(true)).resolves.toEqual(true); | ||
}); | ||
|
||
test('Open home directory', async () => { | ||
await galata.sidebar.openTab('filebrowser'); | ||
await expect(galata.sidebar.isTabOpen('filebrowser')).resolves.toEqual( | ||
true | ||
); | ||
await expect(galata.filebrowser.openHomeDirectory()).resolves.toEqual(true); | ||
}); | ||
|
||
test('Delete uploaded directory', async () => { | ||
await expect(galata.contents.deleteDirectory('uploaded')).resolves.toEqual( | ||
true | ||
); | ||
const imageName = 'do-not-highlight-not-latex.png'; | ||
await page.notebook.enterCellEditingMode(1); | ||
const cell = await page.notebook.getCell(1); | ||
expect(await cell.screenshot()).toMatchSnapshot(imageName); | ||
}); | ||
}); |
Binary file added
BIN
+28.2 KB
...book-markdown.test.ts-snapshots/do-not-highlight-not-latex-jupyterlab-linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.3 KB
...terlab/notebook-markdown.test.ts-snapshots/highlight-latex-jupyterlab-linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+3.57 KB
...a/test/jupyterlab/texteditor.test.ts-snapshots/text-editor-jupyterlab-linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.5 KB
...jupyterlab/texteditor.test.ts-snapshots/text-editor-rulers-jupyterlab-linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-28.1 KB
...s/reference-output/screenshots/notebook_markdown_do_not_highlight_not_latex.png
Binary file not shown.
Binary file removed
BIN
-25.6 KB
ui-tests/reference-output/screenshots/notebook_markdown_highlight_latex.png
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-6.75 KB
ui-tests/reference-output/screenshots/text_editor_text_editor_rulers.png
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters