-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore horizontal scrolling of outputs for Firefox (#15171)
* Add printed notebook test * Revert CSS changes to table except when using media print * Wait for MathJax message to disappear * Update Playwright Snapshots * Restore mobile snapshot * Fix style for mobile layout * Mobile: adjust margins and disable collapser overlay * Update Playwright Snapshots * Revert mermaid snapshot update * Workaround issue with notebook-mobile test * Update snapshot for mobile layout * Link the issue to setCell Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com> * Update Playwright Snapshots * Revert incorrect completer snapshot update --------- Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
- Loading branch information
1 parent
6646779
commit 64e0107
Showing
10 changed files
with
138 additions
and
22 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
+18 Bytes
(100%)
...jupyterlab/notebook-mobile.test.ts-snapshots/mobile-layout-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 modified
BIN
-17 Bytes
(100%)
...ab/notebook-run-vega.test.ts-snapshots/run-cells-dark-vega-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 modified
BIN
-14 Bytes
(100%)
...yterlab/notebook-run-vega.test.ts-snapshots/run-cells-vega-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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
import { expect, test } from '@jupyterlab/galata'; | ||
import * as path from 'path'; | ||
|
||
test.use({ autoGoto: false }); | ||
|
||
const fileName = 'simple_notebook.ipynb'; | ||
|
||
test.describe('Print layout', () => { | ||
test('Notebook', async ({ page, tmpPath }) => { | ||
await page.emulateMedia({ media: 'print' }); | ||
await page.contents.uploadFile( | ||
path.resolve(__dirname, `./notebooks/${fileName}`), | ||
`${tmpPath}/${fileName}` | ||
); | ||
await page.contents.uploadFile( | ||
path.resolve(__dirname, './notebooks/WidgetArch.png'), | ||
`${tmpPath}/WidgetArch.png` | ||
); | ||
|
||
await page.goto(); | ||
|
||
await page.notebook.openByPath(`${tmpPath}/${fileName}`); | ||
|
||
await page.getByText('Python 3 (ipykernel) | Idle').waitFor(); | ||
|
||
await page.notebook.run(); | ||
|
||
let printedNotebookURL = ''; | ||
await Promise.all([ | ||
page.waitForRequest( | ||
async request => { | ||
const url = request.url(); | ||
if (url.match(/\/nbconvert\//) !== null) { | ||
printedNotebookURL = url; | ||
return true; | ||
} | ||
return false; | ||
}, | ||
{ timeout: 1000 } | ||
), | ||
page.keyboard.press('Control+P') | ||
]); | ||
|
||
const newPage = await page.context().newPage(); | ||
|
||
await newPage.goto(printedNotebookURL, { waitUntil: 'networkidle' }); | ||
|
||
// Wait until MathJax loading message disappears | ||
const mathJaxMessage = newPage.locator('#MathJax_Message'); | ||
await expect(mathJaxMessage).toHaveCount(1); | ||
await mathJaxMessage.waitFor({ state: 'hidden' }); | ||
|
||
expect(await newPage.screenshot()).toMatchSnapshot('printed-notebook.png'); | ||
}); | ||
}); |
Binary file added
BIN
+30.5 KB
...a/test/jupyterlab/print.test.ts-snapshots/printed-notebook-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
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
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
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