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

Widget calls requiring browser context hang during testing #99

Open
alex-treebeard opened this issue Feb 16, 2023 · 4 comments
Open

Widget calls requiring browser context hang during testing #99

alex-treebeard opened this issue Feb 16, 2023 · 4 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@alex-treebeard
Copy link
Member

alex-treebeard commented Feb 16, 2023

Describe the bug
The ITKWidgets project cannot test a notebooks that calls a widget which is only initialised when a browser is present

To Reproduce
See InsightSoftwareConsortium/itkwidgets#587

Expected behavior
Can call the initialised widget API successfully

Additional context
This issue occurs because nbclient is an alternative to running a full jupyter web app + server (architecture diagram) and doesn't run a browser context.

Problem cell example

image = itk.image_from_array(array)
print('Dimension', image.GetImageDimension())
print('Components', image.GetNumberOfComponentsPerPixel())

from ipynb.

@alex-treebeard alex-treebeard changed the title Widgets calls requiring browser context hang during testing Widget calls requiring browser context hang during testing Feb 16, 2023
@alex-treebeard
Copy link
Member Author

alex-treebeard commented Mar 10, 2023

This repo has a pretty advanced setup using Selenium's python APIs @thewtex you can see that they actually test the widget's functionality (not just load it).

@thewtex
Copy link

thewtex commented Apr 20, 2023

@alex-treebeard here is a high level architecture that aims to:

  1. Provide the needed JavaScript, WebGL context
  2. Be simple, requiring relatively little code
  3. Work with the existing nbmake code

References:

@alex-treebeard alex-treebeard added bug Something isn't working enhancement New feature or request labels Apr 26, 2023
@alex-treebeard
Copy link
Member Author

weights and biases have come up with an interesting cypress-based solution

https://github.com/wandb/weave/blob/4891c2f5d35bb9077d4add9ab4d92536dbf7b00c/integration_test/cypress/e2e/notebooks/notebooks.ts

@thewtex
Copy link

thewtex commented Oct 20, 2023

Interesting! It does not look like they are running the notebooks in an actual browser, though, from what I can tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants