extension-examples icon indicating copy to clipboard operation
extension-examples copied to clipboard

Documents example fails tests part 2

Open ericsnekbytes opened this issue 5 months ago • 1 comments

ui-tests fail for the documents example.

Related: #282

Steps to reproduce

  1. Follow the README/quickstart for cloning the repo and installing. Instead of moving to hello-world, move to the documents dir and install/run that example (it should build and install successfully).
  2. cd into ui-tests
  3. jlpm install
  4. jlpm playwright install chromium
  5. jlpm playwright test
  6. Observe playwright test failure

Expected behavior

A passing test.

Context

Command Line Output:

jlpm playwright test [WebServer] [I 2025-06-10 11:09:27.547 ServerApp] jupyter_lsp | extension was successfully linked. [WebServer] [I 2025-06-10 11:09:27.549 ServerApp] jupyter_server_terminals | extension was successfully linked. [WebServer] [I 2025-06-10 11:09:27.551 ServerApp] jupyterlab | extension was successfully linked. [WebServer] [I 2025-06-10 11:09:27.756 ServerApp] notebook_shim | extension was successfully linked. [WebServer] [W 2025-06-10 11:09:27.782 ServerApp] All authentication is disabled. Anyone who can connect to this server will be able to run code. [WebServer] [I 2025-06-10 11:09:27.782 ServerApp] notebook_shim | extension was successfully loaded. [WebServer] [I 2025-06-10 11:09:27.784 ServerApp] jupyter_lsp | extension was successfully loaded. [WebServer] [I 2025-06-10 11:09:27.784 ServerApp] jupyter_server_terminals | extension was successfully loaded. [WebServer] [I 2025-06-10 11:09:27.786 LabApp] JupyterLab extension loaded from /Users/egentry/workspace_ana/armconda/envs/jupyterlab-extension-examples/lib/python3.13/site-packages/jupyterlab [WebServer] [I 2025-06-10 11:09:27.786 LabApp] JupyterLab application directory is /Users/egentry/workspace_ana/armconda/envs/jupyterlab-extension-examples/share/jupyter/lab [WebServer] [I 2025-06-10 11:09:27.786 LabApp] Extension Manager is 'pypi'. [WebServer] [I 2025-06-10 11:09:27.821 ServerApp] jupyterlab | extension was successfully loaded. [WebServer] [I 2025-06-10 11:09:27.822 ServerApp] Serving notebooks from local directory: /var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/galata-test-fli9xkq1 [WebServer] [I 2025-06-10 11:09:27.822 ServerApp] Jupyter Server 2.16.0 is running at: [WebServer] [I 2025-06-10 11:09:27.822 ServerApp] http://localhost:8888/lab [WebServer] [I 2025-06-10 11:09:27.822 ServerApp] http://127.0.0.1:8888/lab [WebServer] [I 2025-06-10 11:09:27.822 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). (node:669) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created)

Running 1 test using 1 worker

[WebServer] [I 2025-06-10 11:09:28.028 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server ✘ 1 tests/documents.spec.ts:3:5 › should check if the cube is loaded (1.0m) (node:752) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) [WebServer] [W 2025-06-10 11:09:32.223 ServerApp] 404 GET /api/contents/tests-documents-should-check-if-the-cube-is-loaded?type=directory&content=1 (c0e756411fe74f5f81562f18045ec53f@::1) 0.76ms referer=None [WebServer] [W 2025-06-10 11:09:32.223 ServerApp] 404 GET /api/contents/tests-documents-should-check-if-the-cube-is-loaded?type=directory&content=1 (::1): No such file or directory: tests-documents-should-check-if-the-cube-is-loaded [WebServer] [I 2025-06-10 11:09:32.227 ServerApp] Uploading file to /tests-documents-should-check-if-the-cube-is-loaded [WebServer] [I 2025-06-10 11:09:33.209 LabApp] Build is up to date [WebServer] [I 2025-06-10 11:09:34.752 ServerApp] Creating new file in /tests-documents-should-check-if-the-cube-is-loaded [WebServer] [W 2025-06-10 11:10:31.644 ServerApp] delete /tests-documents-should-check-if-the-cube-is-loaded/untitled.txt [WebServer] [W 2025-06-10 11:10:31.821 ServerApp] 404 GET /api/contents/tests-documents-should-check-if-the-cube-is-loaded/untitled.txt?type=file&content=0 (c0e756411fe74f5f81562f18045ec53f@::1) 0.42ms referer=None [WebServer] [W 2025-06-10 11:10:31.821 ServerApp] 404 GET /api/contents/tests-documents-should-check-if-the-cube-is-loaded/untitled.txt?type=file&content=0 (::1): No such file or directory: tests-documents-should-check-if-the-cube-is-loaded/untitled.txt [WebServer] [W 2025-06-10 11:10:31.822 ServerApp] delete /tests-documents-should-check-if-the-cube-is-loaded [WebServer] [W 2025-06-10 11:10:31.826 ServerApp] 404 GET /api/contents/tests-documents-should-check-if-the-cube-is-loaded?type=file&content=0 (c0e756411fe74f5f81562f18045ec53f@::1) 0.31ms referer=None [WebServer] [W 2025-06-10 11:10:31.826 ServerApp] 404 GET /api/contents/tests-documents-should-check-if-the-cube-is-loaded?type=file&content=0 (::1): No such file or directory: tests-documents-should-check-if-the-cube-is-loaded

  1. tests/documents.spec.ts:3:5 › should check if the cube is loaded ──────────────────────────────
Test timeout of 60000ms exceeded.

Error: locator.fill: Test timeout of 60000ms exceeded.
Call log:
  - waiting for getByRole('region', { name: 'notebook content' }).getByRole('textbox')


   7 |     .getByRole('region', { name: 'notebook content' })
   8 |     .getByRole('textbox')
>  9 |     .fill('{\n\t"x": 177,\n\t"y": 301,\n\t"content": "Hello YJS!"\n}');
     |      ^
  10 |
  11 |   // Press s with modifiers
  12 |   await page.keyboard.press('Control+s');
    at /Users/egentry/workspace_ana/xtest/extension-examples/documents/ui-tests/tests/documents.spec.ts:9:6

attachment #1: video (video/webm) ──────────────────────────────────────────────────────────────
test-results/tests-documents-should-check-if-the-cube-is-loaded/video.webm
────────────────────────────────────────────────────────────────────────────────────────────────

Error Context: test-results/tests-documents-should-check-if-the-cube-is-loaded/error-context.md

1 failed tests/documents.spec.ts:3:5 › should check if the cube is loaded ───────────────────────────────

Serving HTML report at http://localhost:9323. Press Ctrl+C to quit.

ericsnekbytes avatar Jun 10 '25 15:06 ericsnekbytes

Observe playwright test failure

If that was failing on snapshot comparison, this might have been expected (different fonts on different systems etc), but looking at the details:

   7 |     .getByRole('region', { name: 'notebook content' })

This would likely be related to https://github.com/jupyterlab/jupyterlab/pull/17527 and replacing notebook content with main area content should solve it.

krassowski avatar Jun 10 '25 15:06 krassowski

@krassowski, I believe this one and #282 can be closed as https://github.com/jupyterlab/jupyterlab/pull/17527 and #284 have been merged.

cmarmo avatar Sep 19 '25 07:09 cmarmo

Closing as per above, thank you @cmarmo!

krassowski avatar Sep 19 '25 08:09 krassowski