This repository is for work on the user interface (UI) for the WaterTAP library. The UI installer can be downloaded from our homepage at: https://watertap-org.github.io/
The following steps assume that:
conda
is already installed and configuredRun the following command to create and activate a new Conda environment named watertap-ui-env
:
conda env create --file environment.yml && conda activate watertap-ui-env
This will install the correct runtime versions of both the backend (Python) and frontend (JavaScript/NodeJS/Electron) portions of the UI, as well as the backend (Python) dependencies.
Run the following commands to install the JavaScript dependencies:
npm --prefix electron clean-install
npm --prefix electron/ui clean-install
idaes get-extensions --verbose
By default, Step 1 above will install the watertap
Python package from the current main
branch of the watertap-org/watertap repository.
To use the WaterTAP UI with the development version of WaterTAP, run the following steps:
watertap-org/watertap
repository locallyIf you already have a local clone of the WaterTAP repository, you can skip this step.
Otherwise, run the following command to create a local clone of the WaterTAP repository in a directory of your choice, e.g. /path/to/my/watertap
:
git clone https://github.com/watertap-org/ /path/to/my/watertap
watertap-ui-env
Conda environment is activeconda activate watertap-ui-env
pip uninstall --yes watertap
The following assumes that the watertap-org/watertap
repository has been cloned to a directory named /path/to/my/watertap
.
bash -c "cd /path/to/my/watertap && pip install -r requirements-dev.txt"
watertap-ui-env
Conda environment is active and all dependencies are installedconda activate watertap-ui-env
cd <watertap-ui-path>/electron/ui
npm run app-start
cd <watertap-ui-path>/electron/ui
npm run electron-start
There are three sets of tests that can be run: Python tests, JavaScript unit tests, and JavaScript end-to-end tests.
To run the Python tests, make sure you have the appropriate version of watertap in your conda env. Then from the repository root directory run:
To run:
cd backend
pytest
This will take several minutes since one set of tests solves the UI flowsheets.
The unit tests are written using the testing-library package.
To run:
cd electron/ui
npm run test
Hit 'a' for "run all tests" if you want to run tests regardless of what changed.
The end-to-end tests are written in Cypress.
Before running the tests, start the back-end server, in another process (or shell):
cd electron/ui
npm run start-backend
Then, to run the tests:
cd electron/ui # if needed
npx cypress run
If there are errors, screenshots and videos can be found (in subdirectories named for each test) under electron/ui/cypress/screenshots
and electron/ui/cypress/videos
.
The following steps assume that:
conda
is already installed and configuredwatertap-ui-env
Conda environment is activecd <watertap-ui-path>/electron
npm --prefix electron run move-entrypoints
1) Windows operating system 2) The following environment variables must be set
cd <watertap-ui-path>/electron
npm run dist:win
1) Mac operationg system 2) Signed in to Apple developer account 3) A valid Developer ID Application certificate AND corresponding private key stored in keychain access
cd <watertap-ui-path>/electron
npm run dist:mac