{"id":13482683,"url":"https://github.com/mmacartney10/ocularjs","last_synced_at":"2025-03-27T13:32:32.763Z","repository":{"id":57313419,"uuid":"64378987","full_name":"mmacartney10/ocularjs","owner":"mmacartney10","description":"Quicker, more user friendly visual regression testing","archived":false,"fork":false,"pushed_at":"2017-02-22T17:38:21.000Z","size":335,"stargazers_count":7,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-24T06:02:45.617Z","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/mmacartney10.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}},"created_at":"2016-07-28T08:43:46.000Z","updated_at":"2020-03-17T14:42:39.000Z","dependencies_parsed_at":"2022-09-20T23:30:40.814Z","dependency_job_id":null,"html_url":"https://github.com/mmacartney10/ocularjs","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/mmacartney10%2Focularjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmacartney10%2Focularjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmacartney10%2Focularjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmacartney10%2Focularjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmacartney10","download_url":"https://codeload.github.com/mmacartney10/ocularjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222262451,"owners_count":16957584,"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-07-31T17:01:04.465Z","updated_at":"2024-10-30T16:31:37.185Z","avatar_url":"https://github.com/mmacartney10.png","language":"JavaScript","funding_links":[],"categories":["Deprecated  (a-z↓)","Tools and frameworks"],"sub_categories":[],"readme":"\n# Visual regression testing\n\nFaster, more user friendly visual regression testing. Used to tell a developer which components on a website have been affected by code changes, and gives a developer more visibility over a website. Involves three steps:\n\n* Create reference screenshots.\n* Create test screenshots.\n* Compare the two to check if the test screenshots have changed.\n\n# What is the purpose of Ocularjs\n\n* Super quick, can run 80 different tests in under 5 seconds.\n* Should be used to provide quick, easy-to-read feedback on what components have changed.\n* Removes the manual process of testing a whole site as it tells the user exactly what has changed.\n* The user can then decide if the changes are correct or not.\n\n# To Run\n```sh\nnpm install ocularjs -g\nocularjs init\nocularjs\n```\n\n# Ocularjs init\n\nThis creates a folder called `ocular` in the directory in which the command is run. Inside this folder will be a `data.json` file which is where the settings for the project will be set.\n\n# Data.json\n\n* **PageUrl**: This is the url that `Ocularjs` will open and take screenshots from, make sure all your components are on this page.\n* **Viewports**: This is an object with a list of viewports, `Ocularjs` will open every viewport and take a screenshot for each component. This object can have a list of named viewports, each with an array containing screen width and screen height in that order.\n* **SelectorList**: This contains the list of components that you want to take screenshots of, and each item requires a name and a selector. The selector can be a data attribute, class or and ID.\n\n```\n{\n  \"pageUrl\": \"http://localhost:7000/\",\n  \"viewports\": {\n    \"smallScreen\": [320, 480],\n    \"mediumScreen_landscape\": [768, 1024],\n    \"mediumScreen_portrait\": [1024, 768],\n    \"largeScreen\" : [1920, 1080]\n  },\n  \"selectorList\": {\n    \"containerOne\": \"[data-container-one]\",\n\t\t\"containerTwo\": \"[data-container-two]\"\n  }\n}\n```\n\n# Ocularjs\n\nThis will ask the user a question with three options:\n\n* **Reference**: This will create the base screenshots for each component on each breakpoint. This will be stored in the `ocular` folder under `screenshots/reference`.\n* **Test**: This will generate a second set of screenshots, for the same components and breakpoints as `Reference`. It will then compare the `Test` screenshots against the `Reference` screenshots and will tell the user which components have changed and what breakpoint they have changed on.\n* **Exit**: This will exit out of the `Ocularjs` process and will not ask another question. Both of the other options will ask the question again once that process has been completed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmacartney10%2Focularjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmacartney10%2Focularjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmacartney10%2Focularjs/lists"}