To setup on Mac or Linux:
bash mac-setup.sh
source venv/bin/activate
To setup on Windows:
windows-setup.bat
venv\Scripts\activate.bat
The Streamlit tests contain most tests of basic functionality.
Run
streamlit run streamlit_test.py --server.port 8555
And then run
npm run test:streamlit -- --project=chromium
First, you need to run (from the mitosheet/ directory) in this same virtual environment::
jupyter labextension develop . --overwrite
For JupyterLab, run from the tests/ directory:
jupyter lab --config jupyter_server_test_config.py
And then in a separate terminal run from the tests/ directory:
npm run test:jupyterlab -- --project=chromium
For Jupyter notebook, run from the tests/ directory: :
jupyter notebook --config jupyter_notebook_config.py
And then in a separate terminal run from the tests/ directory:
npm run test:notebook -- --project=chromium
First, you need to run (from the mito-ai/ directory) in this same virtual environment:
jupyter labextension develop . --overwrite
jupyter server extension enable --py mito_ai
Then, from the tests/directory, set your OPENAI_API_KEY environment variable:
export OPENAI_API_KEY=<your-openai-api-key>
From the same terminal, run:
jupyter lab --config jupyter_server_test_config.py
And then in a separate terminal run from the tests/ directory:
npm run test:mitoai -- --project=chromium
First, run the following command to install the dependencies from the mito-sql-cell directory:
jupyter labextension develop . --overwrite
jupyter server extension enable mito_sql_cell
Then, run the following command to start the JupyterLab server from the tests/ directory:
jupyter lab --config jupyter_server_test_config.py
And then in a separate terminal run from the tests/ directory:
npm run test:mito-sql-cell -- --project=chromium
Run
python dash-test.py
Then, run the tests with
npm run test:dash -- --project=chromium
Add a --headed flag to see the test run.
See the Galata README.md here: https://github.com/jupyterlab/jupyterlab/tree/master/galata, where it fully documents how to create and record (!) tests.
Writing tests for Streamlit is actually a breeze, using VSCode's Playwright extension. To create new tests:
- Install the Playwright extenstion for VSCode
- Use the
Record Newtest functionality from the Playwright extension to create a basic test - Copy this into the Streamlit test folder. Then, change the setup for the test to use the utilities from the other tests.
Keep in mind that:
- Setup is done in a standard function.
- If you click a button that calls the backend (e.g. makes an edit) you need to use
clickButtonAndAwaitResponse.
Note that you can also edit a test with the Record at Cursor functionality.