Coder Social home page Coder Social logo

viatui's Introduction

viatui

Overview

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.

Experimental Nature

  • 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.

Vision

  • 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.

Issues to overcome

  1. For whatever reason (e.g. dbus issues), you can't run viatui along with turbo-src in local mode. Turbosrc must be online.

  2. For whatever reason, turbo-src buttons don't dynamically update (must refresh), possibly due to dbus issues.

  3. Race conditions: a healthy delay between the launching of chromium and the starting of the script.

Raw usage

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

Testing usage (turbo-src application)

You must allow viatui to due its tasks up to repo creation. After that, the backend e2e tests can be ran.

Connecting instance

  1. Comment out the create user and create repo test in turbo-src/tsrc-test

  2. Run ./tsrc-dev init --testers

Locally

  1. turbosrc.config must be in router-client mode.

  2. Run ./tsrc-dev init

  3. In viatui/scripts/container_screesnhot.py, comment out everything beyond the creation of the repo.

  4. Run docker-compose build viatui

  5. Run docker-compose run viatui

Connecting instance

  1. Run ./tsrc-dev start

  2. Run `./tsrc-dev test run_tests

Locally

  1. In viatui/scripts/container_screesnhot.py, comment everything except code to refresh page and screeshot.

  2. Open the screenshot in chromium-nix-screenshots/

You want to capture screenshots as the tests move along.

License

This project is licensed under the MIT License.

viatui's People

Contributors

7db9a avatar

Watchers

 avatar

Forkers

mariabenjon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.