viatui
is an experimental project exploring the integration of Large Language Models (LLMs) with UI testing. The project aims to leverage LLMs (e.g. inference and/or embeddings using cosine similarity) to analyze screenshots of UIs, perform actions like clicking, and report on the results. This approach is at the forefront of combining AI and UI testing. The concept isn't fully fleshed out yet.
- The code in
viatui
is experimental and demonstrated against the web extension for turbo-src. - This project is a starting point for discussions and further development in AI-driven UI testing.
- The automated user actions and screenshots all happen in
scripts/container_screenshots.py
. - Nix and docker are used crudely in order to create reproducible chromium environemnts.
- The ethos is 'get it to work, then optimize', so don't be alarmed by the insanely large docker images it prodocues, etc.
- Utilize LLMs or embeddings to interpret UI elements from screenshots.
- Automate UI interactions based on LLM analysis.
- Develop methods that are at least an order of magnitude easier and more effective for UI testing.
-
For whatever reason (e.g. dbus issues), you can't run viatui along with turbo-src in local mode. Turbosrc must be online.
-
For whatever reason, turbo-src buttons don't dynamically update (must refresh), possibly due to dbus issues.
-
Race conditions: a healthy delay between the launching of chromium and the starting of the script.
I'm testing the concept on turbo-src. For your own experimental needs I suggest to modify scripts/container_screenshots.py
for your UI tasks and screenshot tempo or edit entrypoint.sh
to run some other script you develop. You can always just use this as inspiration or fork for your own specific needs.
Build.
docker build -t viatui .
Run the script defined in entrypoint.sh
, currently scripts/container_screenshot.py
docker run -it \
-e DISPLAY=:1 \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--volume /var/run/dbus:/var/run/dbus \
--volume $(pwd):/app \
--privileged \
viatui
You must allow viatui to due its tasks up to repo creation. After that, the backend e2e tests can be ran.
-
Comment out the create user and create repo test in
turbo-src/tsrc-test
-
Run
./tsrc-dev init --testers
-
turbosrc.config
must be inrouter-client
mode. -
Run
./tsrc-dev init
-
In
viatui/scripts/container_screesnhot.py
, comment out everything beyond the creation of the repo. -
Run
docker-compose build viatui
-
Run
docker-compose run viatui
-
Run
./tsrc-dev start
-
Run `./tsrc-dev test run_tests
-
In
viatui/scripts/container_screesnhot.py
, comment everything except code to refresh page and screeshot. -
Open the screenshot in
chromium-nix-screenshots/
You want to capture screenshots as the tests move along.
This project is licensed under the MIT License.