{"id":15985444,"url":"https://github.com/konsalex/cyclopes","last_synced_at":"2025-03-17T23:31:16.232Z","repository":{"id":57651292,"uuid":"432842619","full_name":"konsalex/cyclopes","owner":"konsalex","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-23T20:11:06.000Z","size":17681,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T05:52:43.263Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konsalex.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-28T22:44:00.000Z","updated_at":"2022-01-11T10:28:56.000Z","dependencies_parsed_at":"2022-09-05T01:50:10.474Z","dependency_job_id":null,"html_url":"https://github.com/konsalex/cyclopes","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsalex%2Fcyclopes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsalex%2Fcyclopes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsalex%2Fcyclopes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsalex%2Fcyclopes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konsalex","download_url":"https://codeload.github.com/konsalex/cyclopes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243891961,"owners_count":20364610,"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-10-08T02:21:50.002Z","updated_at":"2025-03-17T23:31:15.983Z","avatar_url":"https://github.com/konsalex.png","language":"Go","readme":"# \u003ch1 align=\"center\"\u003e cyclopes \u003c/h1\u003e\n\n\u003c!-- toc --\u003e\n\n- [Description](#description)\n- [Installation](#installation)\n- [How to use](#how-to-use)\n- [How to configure](#how-to-configure)\n- [Useful Parameters](#useful-parameters)\n- [🔌 Adapters](#---adapters)\n  - [Slack adapter](#slack-adapter)\n  - [Trello adapter](#trello-adapter)\n\n\u003c!-- tocstop --\u003e\n\n---\n\n[![Release Cyclopes](https://github.com/konsalex/cyclopes/actions/workflows/release.yaml/badge.svg)](https://github.com/konsalex/cyclopes/actions/workflows/release.yaml)\n![npm](https://img.shields.io/npm/v/cyclopes)\n[![Gitter](https://badges.gitter.im/cyclopes-clip/community.svg)](https://gitter.im/cyclopes-clip/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![Go Report Card](https://goreportcard.com/badge/github.com/konsalex/cyclopes)](https://goreportcard.com/report/github.com/konsalex/cyclopes)\n\n## Description\n\n**Cyclopes is lightweight CLI tool to help us perform simple visual testing tasks, so we can feel more confident shipping our code.**\n\nVisual testing with Cyclopes includes screenshotting our desired pages, but also sending the results to the tools we use (like Slack) so we can make a quick review.\n\nSome useful use cases:\n\n1. Visual test your GatsbyJS/NextJS etc. marketing websites. If you are not writing tests (which is often the case with marketing websites), you can use **cyclopes** to check if your website is rendered as expected.\n\n2. Integrate visual testing with your CI, and send generated screeenshots to a dev Slack channel. The screenshots can be taken from Cypress.js or any other E2E testing framework you already use.\n\n**Cyclopes** is only using Chrome to test as it is based in [chromedp](https://github.com/chromedp/chromedp).\n\n\u003e 💡 Cyclopes is not Visual Testing as a Service (Percy, Chromatic etc), but something to bridge the gap between not having a visual test, and having a complicated setup to work with.\n\n## Installation\n\nWith `npm` or `yarn`\n\n```bash\n# npm\nnpm install cyclopes\n\n# yarn\nyarn add cyclopes\n```\n\nWith `go get`\n\n```bash\ngo get -u github.com/konsalex/cyclopes\n```\n\nOr you can download the binaries directly from [Github releases](https://github.com/konsalex/cyclopes/releases).\n\n## How to use\n\nThe usage is fairly simple. You can run\n\n```\ncyclopes\n```\n\nwhich will try to find the default yaml file `cyclops.yml` in the current directory.\n\nIf you want to use a different file name, you can use\n\n```bash\ncyclopes --config your-config.yml # or --config=./your-config.yml, the first provides better path auto-completion\n```\n\n## How to configure\n\nThe configuration (yaml) file will start with two root steps, the `visual` and `adapters`, both which are optional. Below is an example of a yaml configuration file and below a table with the values and their possible options.\n\n\u003e 💡 Easily create a configuration file by running `cyclopes --generate`\n\n```yaml\n# Directory where the images will be saved\n# and/or retrieved from the channel adapters\nimagesDir: \"./images\"\n\n# If visual is defined, it will be the first step\n# where the pages defined will be visited and screenshotted\n# one by one with the defined order\nvisual:\n  # (Optional): URL to visit. If this field does\n  # not exist, builDir is required\n  remoteURL: https://www.neo4j.com/\n  # Directory to serve for testing.\n  # Required only if remoteURL is missing\n  buildDir: \"./public\"\n  # If the testing session will be headless or not\n  # for debugging purposes\n  headless: true\n  # Pages to visit and screenshot\n  pages:\n    # Path of the page\n    - path: \"/\"\n      # Type of device to screenshot\n      device: \"both\"\n      # Delay after the page is loaded\n      delay: 2000\n      # Wait for an element to appear\n      waitSelector: \"#NeoCybotCookiebotDialogBodyButtonAccept\"\n      # If the screenshot should be fullpage or viewport\n      screenshot: \"fullpage\"\n      # Code to be executed inside the webpage\n      # This can help to remove Cookies banner for example\n      code: |\n        const cookiesButton = document.querySelector(\"#NeoCybotCookiebotDialogBodyButtonAccept\")\n        if (cookiesButton) {\n            cookiesButton.click()\n        }\n    - path: \"/product\"\n      device: \"mobile\"\n      screenshot: \"fullpage\"\n    - path: \"/product/graph-data-science/\"\n      device: \"desktop\"\n# Adapters\n# Each adapter will have it's own parameters\nadapters:\n  slack:\n    OAUTH_TOKEN: example-token\n    CHANNEL_ID: example-token\n```\n\n## Useful Parameters\n\n| parameter    | values                      | default value | required | description                                                                                     |\n| ------------ | --------------------------- | ------------- | -------- | ----------------------------------------------------------------------------------------------- |\n| `imagesDir`  | string                      | null          | yes      | The path where the images will be saved or retrieved from the adapters                          |\n| `headless`   | bool                        | true          | no       | If our visual testing session will open the chrome browser in headless mode                     |\n| `device`     | `desktop`, `mobile`, `both` | `both`        | no       | Viewport of device we should screenshot                                                         |\n| `screenshot` | `fullpage`, `viewport`      | `fullpage`    | no       | Screenshotting the current viewport or fullpage screenshot                                      |\n| `code`       | string                      |               | no       | Javascript code to execute inside page. It can be a Promise that will be waited to be fulfilled |\n\n## 🔌 Adapters\n\nRight now only Slack adapter is supported.\n\nSoon more will be added like Trello etc. Any recommendation is welcome.\n\n### Slack adapter\n\n\u003cdetails\u003e\n\u003csummary\u003eExpand\u003c/summary\u003e\n\n```yaml\nslack:\n  oauth_token: example-token\n  channel_id: example-channel-id\n```\n\nor as _environment variables_\n\n```sh\nexport ADAPTERS_SLACK_CHANNEL_ID=example-channel-id\nexport ADAPTERS_SLACK_OAUTH_TOKEN=example-token\n```\n\n\u003c/details\u003e\n\n### Trello adapter\n\n\u003cdetails\u003e\n\u003csummary\u003eExpand\u003c/summary\u003e\n\n```yaml\ntrello:\n  key: example-key\n  token: example-token\n  # check this from the URL\n  # Example https://trello.com/b/\u003cboard-id\u003e\n  board_id: example-board-id\n  # Find it inside: https://trello.com/b/\u003cboard-id\u003e.json\n  list_id: example-list-id\n  # Will only append existing labels based on the name of the label\n  labels: [\"existing label 1\", \"existing label 2\"]\n```\n\nor as _environment variables_\n\n```sh\nexport ADAPTERS_TRELLO_KEY=example-example-key\nexport ADAPTERS_TRELLO_TOKEN=example-example-token\nexport ADAPTERS_TRELLO_BOARD_ID=example-board-id\nexport ADAPTERS_TRELLO_LIST_ID=example-list-id\n```\n\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonsalex%2Fcyclopes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonsalex%2Fcyclopes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonsalex%2Fcyclopes/lists"}