{"id":21702902,"url":"https://github.com/imrlopezag/cy-utilities","last_synced_at":"2026-01-26T18:50:46.477Z","repository":{"id":243766867,"uuid":"813025369","full_name":"ImRLopezAG/cy-utilities","owner":"ImRLopezAG","description":"This repository contains a collection of utilities that can be used to help with testing using Cypress, the tool provides a lot of features out of the box, but sometimes we need to extend it to make it more powerful.","archived":false,"fork":false,"pushed_at":"2024-08-24T03:52:46.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T01:47:29.529Z","etag":null,"topics":["cypress","npm","npm-package","testing"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cy-utilities?activeTab=readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ImRLopezAG.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-10T11:07:38.000Z","updated_at":"2024-08-24T03:52:49.000Z","dependencies_parsed_at":"2024-06-14T13:27:14.241Z","dependency_job_id":"29b71bce-b518-4f1b-8434-dff537f9da12","html_url":"https://github.com/ImRLopezAG/cy-utilities","commit_stats":null,"previous_names":["imrlopezag/cy-utilities"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ImRLopezAG/cy-utilities","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImRLopezAG%2Fcy-utilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImRLopezAG%2Fcy-utilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImRLopezAG%2Fcy-utilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImRLopezAG%2Fcy-utilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImRLopezAG","download_url":"https://codeload.github.com/ImRLopezAG/cy-utilities/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImRLopezAG%2Fcy-utilities/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28785168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cypress","npm","npm-package","testing"],"created_at":"2024-11-25T21:22:04.611Z","updated_at":"2026-01-26T18:50:46.462Z","avatar_url":"https://github.com/ImRLopezAG.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cypress Utilities\n\nThis repository contains a collection of utilities that can be used to help with testing using Cypress, the tool provides\na lot of features out of the box, but sometimes we need to extend it to make it more powerful.\n\n## Installation\n\nTo install the utilities, you can use the following command:\n\n```bash\nnpm install --save-dev cy-utilities\n```\n\n```bash\npnpm add --save-dev cy-utilities\n```\n\n```bash\nyarn add --dev cy-utilities\n```\n\n```bash\nbun add --dev cy-utilities\n```\n\n## Usage\n\nTo use the utilities, you need to import the functions you want to use in your test files, for example:\n\n```javascript\n// cypress/support/e2e.js\nimport 'cy-utilities'\n```\n\n```javascript\n// cypress/support/(your-file or your-folder)/*.js\nimport { SinglePOM, MultiPOM } from 'cy-utilities'\n\nexport const SitePOM = SinglePOM.create({\n  ITEMS: 'div#tbodyid \u003e div',\n  ITEM_1: 'div#tbodyid \u003e div:nth-child(1)',\n  ITEM_2: 'div#tbodyid \u003e div:nth-child(2)',\n  ITEM_3: 'div#tbodyid \u003e div:nth-child(3)',\n  NEXT_ITEMS: 'ul.pagination \u003e li \u003e button#next2',\n  PREV_ITEMS: 'ul.pagination \u003e li \u003e button#prev2'\n})\n\nexport const SiteMultiPOM = MultiPOM.create({\n  CART: {\n    ITEMS: 'div#tbodyid \u003e div',\n    PLACE_ORDER: 'button#place-order',\n    SUBTOTAL: 'span#subtotal'\n  },\n  HOME: {\n    ITEMS: 'div#tbodyid \u003e div',\n    ITEM_1: 'div#tbodyid \u003e div:nth-child(1)',\n    ITEM_2: 'div#tbodyid \u003e div:nth-child(2)'\n  }\n})\n```\n\n```javascript\n// cypress/e2e/your-test.spec.js\nimport { SitePOM, SiteMultiPOM } from '../support/(your-file or your-folder)/*.js';\n\ndescribe('Test', () =\u003e {\n  it('should do something', () =\u003e {\n    cy.visit('https://example.com');\n    SitePOM.get('ITEMS').should('have.length', 3);\n    SitePOM.get('ITEM_1').should('have.text', 'Item 1');\n    SitePOM.get('ITEM_2').should('have.text', 'Item 2');\n    SitePOM.get('ITEM_3').should('have.text', 'Item 3');\n    SitePOM.get('NEXT_ITEMS').click();\n    SitePOM.get('PREV_ITEMS').click();\n  });\n  it('should do something with the command', () =\u003e {\n    cy.visit('https://example.com');\n    // it will wait for each command to finish before executing the next one the quantity of milliseconds is the second parameter\n    cy.awaitableCluster([\n      () =\u003e SitePOM.get('ITEMS').should('have.length', 3);\n      () =\u003e SitePOM.get('ITEM_1').should('have.text', 'Item 1');\n      () =\u003e SitePOM.get('ITEM_2').should('have.text', 'Item 2');\n      () =\u003e SitePOM.get('ITEM_3').should('have.text', 'Item 3');\n      () =\u003e SitePOM.get('NEXT_ITEMS').click();\n      () =\u003e SitePOM.get('PREV_ITEMS').click();\n    ], 200)\n  });\n  it('should do something with the multi command', () =\u003e {\n    cy.visit('https://example.com');\n    SiteMultiPOM.getMultiElement('CART', 'ITEMS').should('have.length', 3);\n    SiteMultiPOM.getMultiElement('CART', 'PLACE_ORDER').click();\n    SiteMultiPOM.getMultiElement('CART', 'SUBTOTAL').should('have.text', '100.00');\n    SiteMultiPOM.getMultiElement('HOME', 'ITEMS').should('have.length', 2);\n    SiteMultiPOM.getMultiElement('HOME', 'ITEM_1').should('have.text', 'Item 1');\n    SiteMultiPOM.getMultiElement('HOME', 'ITEM_2').should('have.text', 'Item 2');\n  });\n});\n\n```\n\n\u003e [!Warning]\n\u003e You must be careful with the time and the quantity of commands you are going to execute, if you have a lot of commands and the time is too long, you can slow down the test execution.\n\n```javascript\n// cypress/e2e/your-test.spec.js\nimport { SitePOM } from '../support/(your-file or your-folder)/*.js';\n\ndescribe('Test', () =\u003e {\n  it('should do something with the command', () =\u003e {\n    cy.visit('https://example.com');\n    // it will wait for each command to finish before executing the next one the quantity of milliseconds is the second parameter\n    cy.awaitableCluster([\n      () =\u003e SitePOM.get('ITEMS').should('have.length', 3);\n      () =\u003e SitePOM.get('ITEM_1').should('have.text', 'Item 1');\n      () =\u003e SitePOM.get('ITEM_2').should('have.text', 'Item 2');\n      () =\u003e SitePOM.get('ITEM_3').should('have.text', 'Item 3');\n      () =\u003e SitePOM.get('NEXT_ITEMS').click();\n      () =\u003e SitePOM.get('PREV_ITEMS').click();\n    ], 200)\n  });\n});\n```\n\n### 🛠️ Tools\n\n[![Typescript](https://img.shields.io/badge/Typescript-3178C6?logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n[![Cypress](https://img.shields.io/badge/Cypress-17202C?logo=cypress\u0026logoColor=white)](https://www.cypress.io/)\n[![ESLint](https://img.shields.io/badge/ESLint-4B32C3?logo=eslint\u0026logoColor=white)](https://eslint.org/)\n[![Prettier](https://img.shields.io/badge/Prettier-F7B93E?logo=prettier\u0026logoColor=white)](https://prettier.io/)\n[![NodeJS](https://img.shields.io/badge/NodeJS-339933?logo=node.js\u0026logoColor=white)](https://nodejs.org/es/)\n\n## Authors\n\n[![ImRLopezAG](https://img.shields.io/badge/ImRLopezAG-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/ImRLopezAG)\n\n## 🔗 Links\n\n[![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white)](https://imrlopez.vercel.app)\n[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/in/angel-gabriel-lopez/)\n[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge\u0026logo=twitter\u0026logoColor=white)](https://twitter.com/imr_lopez)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrlopezag%2Fcy-utilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimrlopezag%2Fcy-utilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrlopezag%2Fcy-utilities/lists"}