Giter Site home page Giter Site logo

visual-regression-tracker / visual-regression-tracker Goto Github PK

View Code? Open in Web Editor NEW
570.0 17.0 54.0 12.77 MB

Backend and Frontend application for tracking differences via image comparison

Home Page: https://visual-regression-tracker.com

License: Apache License 2.0

Shell 84.94% Dockerfile 15.06%
visual-testing visual-tests regression-tests image-comparison cypress playwright docker testing hacktoberfest

visual-regression-tracker's Introduction

Stand With Ukraine

Visual Regression Tracker logo

Visual Regression Tracker

Open source, self hosted solution for visual testing and managing results of visual testing.

Hello

How it works

Service receives images, performs pixel by pixel comparison with it’s previously accepted baseline and provides immediate results in order to catch unexpected changes.

Demo

Features

  • Automation framework independent - no need to stick with specific automation tool, integrate with existing one
  • Platform independent - web, mobile, desktop etc. as long as you could make a screenshot
  • Baseline history - track how baseline image changed since the beginning
  • Ignore regions - improve stability by ignoring not important or not controllable parts of image
  • Language support - JS, Java, Python, .Net or any other via REST API (need more?)
  • Easy setup - everything is inside Docker images
  • Self-hosted - keep your data save inside your intranet
  • Can compare PDF too - use standalone jar to compare pdf and images from a folder

Glossary

  • TestVariation - historical record of Baselines by Name + Branch + OS + Browser + Viewport + Device,
  • Baseline - validated and accepted image, latest will be used as expected result in TestRun
  • TestRun - result of comparing image against Baseline
  • Build - list of TestRuns
  • Project - list of Builds and TestVariations

Set up

Use any of the below ways to setup the server. Docker has to be installed on the machine.

Quick Setup

Linux, macOS, WSL

  1. Download the installation script
curl https://raw.githubusercontent.com/Visual-Regression-Tracker/Visual-Regression-Tracker/master/vrt-install.sh -o vrt-install.sh
chmod a+x vrt-install.sh
  1. Run the installation script

./vrt-install.sh

Command line arguments

Installs the Visual Regression Tracker

Usage: ./vrt-install.sh

Arguments:
    -h | --help
    -a | --frontend-url <url>   Set the Front-end url. Default: http://localhost:8080
    -r | --backend-url <url>    Set the API url. Default: http://localhost:4200
    --jwt-secret <secret>       Set the JWT secret. Default: randomly generated
Manual Setup
  1. Copy docker-compose.yml

$ curl https://raw.githubusercontent.com/Visual-Regression-Tracker/Visual-Regression-Tracker/master/docker-compose.yml -o docker-compose.yml

  1. Copy .env

$ curl https://raw.githubusercontent.com/Visual-Regression-Tracker/Visual-Regression-Tracker/master/.env -o .env

  1. In .env file, ensure that the REACT_APP_API_URL has the right address. If it will be accessed from other machines, change localhost with IP or other resolvable name. Ensure the ports being used are free to use.

  2. Start service

$ docker-compose up

Wait until you see your creds printed.

New users and projects could be created via frontend app by default on http://localhost:8080

Success setup

Run VRT with logging enabled in Elasticsearch

This is for the users who want to monitor VRT logs via Kibana. It is expected to have basic knowledge of Elastic stack (especially Kibana) for the admin so that the logs can be managed and dashboards created in Kibana. Since logging will be retained by Elasticsearch, it will consume a little more memory and CPU. If you see error in the console, please consult Elasticsearch documentation.

It is recommended to run the program as root user which will ensure permission and ownership related issues will not have to be dealt with.

  1. Clone or download this repository.

  2. Move to the downloaded/cloned repository. In .env file, ensure that the REACT_APP_API_URL has the right address. If it will be accessed from other machines, change localhost with IP or other resolvable name. Ensure the ports being used are free to use.

  3. Follow either of below sub steps.

    • If your organization does not have Elasticsearch server running or if you want to start Elastic stack on your own, start service by giving below command.

      $ docker-compose -f docker-compose.yml -f docker-compose.elastic.logging.yml up

    • If you want to re-use the already running Elasticsearch server in your organization, go to filebeat/config/filebeat.yml and edit hosts to point to the Elasticsearch server. Also, point ELASTIC_URL to this server in .env file. Start service by giving below command.

      $ docker-compose -f docker-compose.yml -f docker-compose.logging.yml up

  4. If you are not using root user, in some OS, you may see an error Exiting: error loading config file: config file ("filebeat.yml") must be owned by the user identifier (uid=0) or root. In that case, press Ctrl+C, and follow Elasticsearch instructions. Once done, start the service again.

Integration

Use implemented libraries to integrate with existing automated suites by adding assertions based on image comparison. We provide native integration with automation libraries, core SDK and Rest API interfaces that allow the system to be used with any existing programming language.

Agents

Core SDK

Basic wrapper over API to be used for integration with existing tools

Getting started guide

Videos

Wiki

Integration examples

Here you could find examples

Contribution

  1. Try it, raise tickets with ideas, questions, bugs and share feedback :)
  2. More language support for SDK
  3. More integration with specific testing frameworks (agents)

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Pavel Strunkin
Pavel Strunkin

💻 💼 🤔 🔌
Daniel Crowe
Daniel Crowe

🔌 👀
Surat Das
Surat Das

💻 🔌
Oleksandr Romanov
Oleksandr Romanov

🔌
Terentev Denis
Terentev Denis

🔌
JustSittinHere
JustSittinHere

🔌
Dekara VanHoc
Dekara VanHoc

🔌
maddocnc
maddocnc

💻
Aaron Chelvan
Aaron Chelvan

💻 📖
marcm-qa
marcm-qa

🔌
Eduard-iCH
Eduard-iCH

🔌
Roman
Roman

💻
Dimitri Harding
Dimitri Harding

💻
vkostromin94
vkostromin94

🔌
Bruno Ferreira
Bruno Ferreira

💻
Loïc PÉRON
Loïc PÉRON

💻 🔌
Alexey Volkov
Alexey Volkov

🔌 💻
Egor Lipskiy
Egor Lipskiy

🔌
nitschSB
nitschSB

💻
polyvisual
polyvisual

💻
Juga Paazmaya
Juga Paazmaya

🔌 💻

This project follows the all-contributors specification. Contributions of any kind welcome!

visual-regression-tracker's People

Contributors

allcontributors[bot] avatar dortizesquivel avatar paazmaya avatar pashidlos avatar suratdas avatar tchiaspko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visual-regression-tracker's Issues

Exception if image size do not match to baseline

Steps:

  1. Create test with baseline accepted
  2. Upload image with another dimension

Exception:

api_1        | [Nest] 17   - 05/21/2020, 9:13:40 PM   [ExceptionsHandler] Image sizes do not match. +226762ms
api_1        | Error: Image sizes do not match.
api_1        |     at Object.pixelmatch [as default] (/node_modules/pixelmatch/index.js:21:15)
api_1        |     at TestRunsService.create (/dist/test-runs/test-runs.service.js:117:60)
api_1        |     at TestService.postTestRun (/dist/test/test.service.js:29:52)
api_1        |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
api_1        |     at async /node_modules/@nestjs/core/router/router-execution-context.js:45:28
api_1        |     at async /node_modules/@nestjs/core/router/router-proxy.js:8:17

Doesn't change imageOptions[] in test

Hello! I just tried your app and its very interesting and I found some issues. There is one of them:

In example we have const imageOptions = {} which I suppose should influence on browser config and env.
But if I changes this options in current test stays default settings and only text in web changes like this:
Снимок экрана 2020-05-20 в 13 41 44

Maybe I do something wrong?

Baseline image is removed after removing build

Variation stays in DB and still references to missing image
Leeds to error 500 when trying to get baseline that does not exists anymore

Steps:

  1. Accept test result
  2. Remove all builds
  3. Run test again

Error

api_1        | [Nest] 17   - 05/21/2020, 9:49:34 AM   [ExceptionsHandler] ENOENT: no such file or directory, open '/imageUploads/1590054492219.screenshot.png' +945529ms
api_1        | Error: ENOENT: no such file or directory, open '/imageUploads/1590054492219.screenshot.png'
api_1        |     at Object.openSync (fs.js:458:3)
api_1        |     at Object.readFileSync (fs.js:360:35)
api_1        |     at StaticService.getImage (/dist/shared/static/static.service.js:29:43)
api_1        |     at TestRunsService.create (/dist/test-runs/test-runs.service.js:97:49)
api_1        |     at TestService.postTestRun (/dist/test/test.service.js:29:52)
api_1        |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
api_1        |     at async /node_modules/@nestjs/core/router/router-execution-context.js:45:28
api_1        |     at async /node_modules/@nestjs/core/router/router-proxy.js:8:17

Sometimes default user and project are not created

Due to current set up of initial data seed
should wait before all migrations are applied

Error

api_1        | (node:17) UnhandledPromiseRejectionWarning: Error: 
api_1        | Invalid `prisma.user.findMany()` invocation in
api_1        | /dist/users/users.service.js:42:40
api_1        | 
api_1        | Error occurred during query execution:
api_1        | ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42P01"), message: "relation \"public.User\" does not exist", detail: None, hint: None, position: Some(Original(256)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("parse_relation.c"), line: Some(1173), routine: Some("parserOpenTable") }) }) })
api_1        |     at PrismaClientFetcher.request (/node_modules/@prisma/client/runtime/index.js:1:86042)
api_1        |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
api_1        | (node:17) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
api_1        | (node:17) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
api_1        | (node:17) UnhandledPromiseRejectionWarning: Error: 
api_1        | Invalid `prisma.project.findMany()` invocation in
api_1        | /dist/projects/projects.service.js:37:43
api_1        | 
api_1        | Error occurred during query execution:
api_1        | ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42P01"), message: "relation \"public.Project\" does not exist", detail: None, hint: None, position: Some(Original(128)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("parse_relation.c"), line: Some(1173), routine: Some("parserOpenTable") }) }) })
api_1        |     at PrismaClientFetcher.request (/node_modules/@prisma/client/runtime/index.js:1:86042)
api_1        |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
api_1        | (node:17) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Temp workaround

restart containers

Frontend. Add Variations list

All baselines are stored in variations
Display list of items to see all baselines for the project
Add option to remove it

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.