{"id":21297658,"url":"https://github.com/bfulop/regression-server","last_synced_at":"2025-03-15T17:40:40.763Z","repository":{"id":80086161,"uuid":"126666852","full_name":"bfulop/regression-server","owner":"bfulop","description":"Fast front end regression tests","archived":false,"fork":false,"pushed_at":"2018-07-13T14:13:02.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T07:32:07.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bfulop.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-25T05:15:50.000Z","updated_at":"2018-07-13T14:13:03.000Z","dependencies_parsed_at":"2023-03-13T20:09:43.766Z","dependency_job_id":null,"html_url":"https://github.com/bfulop/regression-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfulop%2Fregression-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfulop%2Fregression-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfulop%2Fregression-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfulop%2Fregression-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfulop","download_url":"https://codeload.github.com/bfulop/regression-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243769946,"owners_count":20345215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T14:40:01.349Z","updated_at":"2025-03-15T17:40:40.701Z","avatar_url":"https://github.com/bfulop.png","language":"JavaScript","readme":"# Visual regression test server\n\nCreates screenshots of pages and page elements at different sizes and send back the results of the image diffing.\n\n### Under 1 second test feedback\n\n- Keeps the target (headless) browsers open\n- If you use it with Browsersync the CSS is injected, without having to reload the page\n- Adding a SHA checking can add an another level of filtering for the screenshots comparison (not implemented yet)\n\n### Targets definition\n\nTakes a targets definition in the following format:\n\n```javascript\nconst baseUrl = 'http://127.0.0.1:3014/[base path]/'\n\nconst testtargets = [\n  {\n    route: '[route/to/a/page]',\n    targets: [\n      {\n        width: 1200,\n        elements: ['[a valid puppeteer selector]']\n      },\n      {\n        width: 768,\n        elements: ['header.pageheader']\n      }\n    ]\n  }\n]\n```\n\nFor now it exposes two routes: `/snapshot` and `/compare`.\n\n`$ curl -s http://[your server's address]:3202/snapshot`\n\nWill take the snapshot images.\n\n`$ curl -s http://[your server's address]:3202/compare`\n\nWill give you back a list of targets and number of pixels that are different compared to the snapshot.\n\n\n### Regression watcher\n\nThe server is meant to be used with the _Regression watcher_ client (not yet published) that will notify the server to rerun the tests.\n\n### Use it on a (cloud) server\n\nIdeally you would use this on a server (Heroku, etc), but can of course be run locally as well. For Linux servers run `src/index` with the `nosandbox` option (`$ node src/index nosandbox`).  \nI prefer to run in on my server which is much faster than my laptop.\n\n### 🚧 Work in progress\n\nIt's just slightly more than a proof of concept. I put this together very quickly to help me with a frontend project, but I admit having little experience with Puppeteer and Pixelmatch.\n\n## Credits\n\nThe \"engine\" (using Puppeteer and Pixelmatch) is based on an article by Monica Dinculescu: [Automatic visual diffing with Puppeteer](https://meowni.ca/posts/2017-puppeteer-tests/)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfulop%2Fregression-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfulop%2Fregression-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfulop%2Fregression-server/lists"}