Skip to content

Add Playwright Tests - #394

Merged
MFA-X-AI merged 11 commits into
XpressAI:masterfrom
rabea-al:master
Apr 21, 2025
Merged

MFA-X-AI merged 11 commits into
XpressAI:masterfrom
rabea-al:master

Conversation

@rabea-al

Copy link
Copy Markdown
Contributor

Description

This PR introduces a new set of UI automation tests using Playwright (Python) located under ui-tests/.
These tests aim to verify key Xircuits canvas behaviors such as:

  • Argument prompt rendering
  • Remote run functionality
  • Dynamic port creation and removal
  • Node protection and locking logic

This PR also updates the README.md file under ui-tests/ to document how to run the tests.

New or Updated Files

  • arg_input_ui_test.py
  • remote_run_arguments_test.py
  • parameter-names-autoshift.py
  • parameter-names-despawn.py
  • parameter-names-spawn.py
  • protected-nodes-and-lock-test.py
  • README.md

Pull Request Type

  • Xircuits Core (Jupyterlab Related changes)
  • Xircuits Canvas (Custom RD Related changes)
  • Xircuits Component Library
  • Xircuits Project Template
  • Testing Automation
  • Documentation
  • Others (Please Specify)

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Test

  1. Launch JupyterLab with the extension loaded:

    jupyter lab --ServerApp.token= --ServerApp.password= --LabApp.default_url=/lab?reset
  2. From a separate terminal, run one or more UI tests:

    cd ui-tests
    python arg_input_ui_test.py
    python remote_run_arguments_test.py
    python autospawn_and_despawn_ports_test.py
    python protected-nodes-and-lock-test.py
  3. On CI, tests are triggered via GitHub Actions on every push and pull request.

Or you can read README file in ui-test

Tested On

  • Windows
  • Linux (Fedora)
  • macOS
  • GitHub Actions (Ubuntu)

@github-actions

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch rabea-al/xircuits/master

@MFA-X-AI MFA-X-AI left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Since we're going to upgrade to Jupyterlab 4.4 soon, these tests will come in handy. A few additional requests:

  • I noticed that you're using the gradio library. If possible, I'd like you to not use another library for testing, this is to not introduce unintended dependencies. For example if say for some reason we update the GradioInterface component to not use dynaports anymore, then this test would break. You can make a dynaport component in the xai-tests, or use the existing one.
  • I noticed that the test breaks on python 3.8. I think this is fine since we're dropping support for 3.8 anyways, but wanted to know the reason for it to fail.

@rabea-al

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! That makes sense — I'll remove the Gradio dependency and replace it with either an existing dynaport component or a custom one within xai-tests. Will update the PR shortly.

Yes, the failure is due to using list[str] syntax, which is only supported in Python 3.9+. Since we’re dropping 3.8 support, I kept it as-is.

@rabea-al

Copy link
Copy Markdown
Contributor Author

I created a PR to add a new component to xai-tests
XpressAI/xai-tests#2

@MFA-X-AI

Copy link
Copy Markdown
Member

okay, I've updated merge that PR. Feel free to update the tests so it pulls from xai-tests

@MFA-X-AI
MFA-X-AI merged commit a8496fd into XpressAI:master Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants