File size: 2,035 Bytes
07423df |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# UI Testing for LLM-Studio
## Overview
The UI testing framework for LLM-Studio leverages the principles of Behaviour Driven Development (BDD), combining the power of Playwright for automation and Behave for writing UI tests. This approach offers the best of both worlds, as it makes the tests easily understandable for humans while remaining straightforward for machines to execute. By adopting this framework, it eliminates the complexities associated with using Selenium.
## Design
The framework is designed to be flexible, capable of running on local and remote machines seamlessly. It is agnostic to the location of the application, making it ideal for release testing across various instances of H2OAI Integrated Cloud (HAIC).
## Execution
### Local Machine Setup
To set up and run UI tests locally, follow these steps:
```bash
export LOCAL_LOGIN=True
export PYTEST_BASE_URL=localhost:10101
make setup-dev
make llmstudio
make setup-ui
make test-ui-headed
```
### Remote Testing
You can conduct UI testing for LLM-Studio on a remote machine using the following approaches:
#### 1. **Running the App on a Remote Server**
- Set up the app on a remote Ubuntu instance:
```bash
make setup-dev
make llmstudio
```
- Obtain the app URL.
- Run the tests on the local machine:
```bash
export PYTEST_BASE_URL=<insert app url>
make setup-ui
make test-ui-headed
```
#### 2. **Running the App on HAMC** _(with Okta Login) <https://internal-genai.dedicated.h2o.ai/>_
```bash
export OKTA_USER=
export OKTA_PASSWORD=
export PYTEST_BASE_URL=
make test-ui
```
#### 3. **Running the App on HAIC** _(with Keycloak Login) <https://cloud-qa.h2o.ai/>_
```bash
export KEYCLOAK_USER=
export KEYCLOAK_PASSWORD=
export PYTEST_BASE_URL=
make test-ui
```
### Test Results
The results of the UI tests are stored in `reports/junit_ui.xml`. These reports provide valuable insights into the success and failure of the tests, aiding in the continuous improvement of the application.
|